net.sf.doolin.util.expression
Class ValueToken

java.lang.Object
  extended by net.sf.doolin.util.expression.AbstractToken
      extended by net.sf.doolin.util.expression.ValueToken
All Implemented Interfaces:
Token

public class ValueToken
extends AbstractToken

Token for a @{...} token.

Author:
Damien Coraboeuf

Constructor Summary
ValueToken()
          Instantiates a new value token.
 
Method Summary
 void add(Token add)
          Adds the.
 Token addText(char c)
          Adds the text.
 Object evaluate(Locale locale, Object context)
          Evaluate.
 String getPropertyPath()
          Returns the associated property path
 boolean isBound()
          Returns if the associated value must be bound with any change of the property value
 boolean isVariable()
          Checks if the expression contains parts which can vary according to the model.
 boolean supportAdd()
          Support add.
 void visitTokensWith(TokenVisitor visitor)
          Visits a the whole token tree with a visitor.
 
Methods inherited from class net.sf.doolin.util.expression.AbstractToken
close, getType, isClosed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueToken

public ValueToken()
Instantiates a new value token.

Method Detail

add

public void add(Token add)
Adds the.

Parameters:
add - the add

addText

public Token addText(char c)
Adds the text.

Parameters:
c - the c
Returns:
the token

evaluate

public Object evaluate(Locale locale,
                       Object context)
Evaluate.

Parameters:
locale - Locale used for the evaluation
context - Context for the evaluation
Returns:
Result of the evaluation

getPropertyPath

public String getPropertyPath()
Returns the associated property path

Returns:
Property path

isBound

public boolean isBound()
Returns if the associated value must be bound with any change of the property value

Returns:
true if the message must change whenever the property changes

isVariable

public boolean isVariable()
Description copied from interface: Token
Checks if the expression contains parts which can vary according to the model.

Returns:
true if some parts of the expression are dependent on the model.

supportAdd

public boolean supportAdd()
Support add.

Returns:
true, if successful

visitTokensWith

public void visitTokensWith(TokenVisitor visitor)
Description copied from interface: Token
Visits a the whole token tree with a visitor.

Parameters:
visitor - Visitor to apply for this token and each token underneath.


Copyright © 2011. All Rights Reserved.