net.sf.doolin.util.expression
Class KeyToken

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

public class KeyToken
extends TokenList

Token for a #{...} token.

Author:
Damien Coraboeuf

Constructor Summary
KeyToken()
          Constructor.
 
Method Summary
 void add(Token add)
          Adds the.
 Token addText(char c)
          Adds the text.
 Object evaluate(Locale locale, Object context)
          Evaluate.
 boolean hasSwitchedToParams()
          Checks if the token is currently evaluating its parameters.
 void switchToParams()
          Switch to the evaluation of the parameters, after the : character.
 void visitTokensWith(TokenVisitor visitor)
          Visits a the whole token tree with a visitor.
 
Methods inherited from class net.sf.doolin.util.expression.TokenList
getTokens, isVariable, supportAdd
 
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

KeyToken

public KeyToken()
Constructor.

Method Detail

add

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

Specified by:
add in interface Token
Overrides:
add in class TokenList
Parameters:
add - the add

addText

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

Specified by:
addText in interface Token
Overrides:
addText in class TokenList
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

hasSwitchedToParams

public boolean hasSwitchedToParams()
Checks if the token is currently evaluating its parameters.

Returns:
true if the token is currently evaluating its parameters.

switchToParams

public void switchToParams()
Switch to the evaluation of the parameters, after the : character.

See Also:
hasSwitchedToParams()

visitTokensWith

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

Specified by:
visitTokensWith in interface Token
Overrides:
visitTokensWith in class TokenList
Parameters:
visitor - Visitor to apply for this token and each token underneath.


Copyright © 2011. All Rights Reserved.