|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An Expression can return a TemplateModel value. An expression is used whenever we want to interact with the template models. An expression can be simple, such as an identifier, or more complex, such as a dynamic key name or a concatenation operator.
Expressions can be (in fact, usually are) nested. For instance, a comparison of two concatenation operations may be represented as follows:
Equals | +----------------+---------------+ | | |Plus | Plus +----+----+ +-----+-----+ | | | | | | | | identifier identifier identifier + dynamic-key-name | | + identifier
Each node on the tree represents a different expression object.
Once complete (i.e. parsed), expressions should be considered immutable.
Method Summary | |
TemplateModel |
getAsTemplateModel(TemplateModelRoot modelRoot)
The TemplateModel value of this
Expression . |
int |
getType()
Determine the type of result that can be calculated by this expression. |
boolean |
isComplete()
Is the Expression complete? |
Method Detail |
public TemplateModel getAsTemplateModel(TemplateModelRoot modelRoot) throws TemplateException
TemplateModel
value of this
Expression
.modelRoot
- the template model that will be evaluated by the expressionTemplateException
- the expression could not be evaluated for some reasonpublic boolean isComplete()
Expression
complete?true
if this Expression
is complete,
otherwise false
public int getType()
ExpressionUtils
class.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |