|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.doolin.util.expression.Expression
public class Expression
A Expression is basically a text string whose content can be created
from bundle keys or properties in a bean model.
Tokens that are used are:
key. If the key has parameters, parameters can be indicated
using %{key:param1,param2} where parameters themselves are
Expression instances.
| Constructor Summary | |
|---|---|
Expression(Locale locale,
Object context,
String pattern)
Parses the expression |
|
Expression(Locale locale,
String text)
Builds an expression with a fixed text. |
|
Expression(Object context,
String pattern)
Parses the expression |
|
Expression(String text)
Builds an expression with a fixed text and for the default locale |
|
| Method Summary | |
|---|---|
protected void |
evaluate()
Internal method used to evaluate the value of the
expression. |
String |
getValue()
Gets the value for the expression |
boolean |
isVariable()
Checks if the expression contains parts which can vary according to the model. |
protected void |
setValue(String newValue)
Internal method that sets a new value to the expression |
String |
toString()
|
protected void |
visitTokensWith(TokenVisitor visitor)
Visits a the whole token tree with a visitor. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Expression(Locale locale,
Object context,
String pattern)
locale - Locale for the expressioncontext - Context objectpattern - Pattern used to build the expression
public Expression(Locale locale,
String text)
locale - Locale for this expressiontext - Fixed value for this expression (not parsed)
public Expression(Object context,
String pattern)
context - Context objectpattern - Pattern used to build the expressionpublic Expression(String text)
text - Fixed text (not parsed)Locale.getDefault()| Method Detail |
|---|
protected void evaluate()
value of the
expression.
public String getValue()
public boolean isVariable()
true if some parts of the expression are dependent
on the model.protected void setValue(String newValue)
newValue - New valuepublic String toString()
toString in class Objectprotected void visitTokensWith(TokenVisitor visitor)
visitor - Visitor to apply for each token.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||