KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > text > template > DataBindingValue


1 /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

5 package org.exoplatform.text.template;
6
7 import org.exoplatform.commons.utils.ExpressionUtil;
8
9 /**
10  * @author Tuan Nguyen (tuan08@users.sourceforge.net)
11  * @since Feb 2, 2005
12  * @version $Id$
13  */

14 public class DataBindingValue extends Value {
15   public String JavaDoc method_ ;
16   
17   public DataBindingValue(String JavaDoc expression) {
18     super(expression) ;
19     method_ = ExpressionUtil.removeBindingExpression(expression) ;
20     char[] buf = method_.toCharArray() ;
21     if(method_.endsWith("()")) {
22       method_ = method_.substring(0, method_.length() - 2) ;
23     } else {
24       if(Character.isLowerCase(buf[0])) {
25         buf[0] = Character.toUpperCase(buf[0]) ;
26       }
27       method_ = "get" + new String JavaDoc(buf) ;
28     }
29   }
30   
31   public String JavaDoc getMethodName() { return method_ ; }
32 }
Popular Tags