net.sf.doolin.util.expression
Class TextToken

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

public class TextToken
extends AbstractToken

Fixed text token.

Author:
Damien Coraboeuf

Constructor Summary
TextToken()
          Constructor.
TextToken(String text)
          Constructor.
 
Method Summary
 void add(Token add)
          Adds the.
 Token addText(char c)
          Adds the text.
 Object evaluate(Locale locale, Object context)
          Evaluate.
 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

TextToken

public TextToken()
Constructor.


TextToken

public TextToken(String text)
Constructor.

Parameters:
text - Initial text
Method Detail

add

public void add(Token add)
Description copied from interface: Token
Adds the.

Parameters:
add - the add

addText

public Token addText(char c)
Description copied from interface: Token
Adds the text.

Parameters:
c - the c
Returns:
the token

evaluate

public Object evaluate(Locale locale,
                       Object context)
Description copied from interface: Token
Evaluate.

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

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()
Description copied from interface: Token
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.