|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectfreemarker.template.expression.Identifier
public final class Identifier
An identifer in a variable. Can be used stand-alone to represent a
variable in the root model, or combined with the Dot operator
to represent models contained within hash models.
| Constructor Summary | |
|---|---|
Identifier(java.lang.String name)
Constructs a new Identifier with the given name. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object o)
Tests the equality of two Identifiers. |
TemplateModel |
getAsTemplateModel(TemplateWriteableHashModel modelRoot)
Gets the identifier's referent in modelRoot. |
java.lang.String |
getName()
Retrieve the name of the identifier. |
java.lang.String |
getName(TemplateWriteableHashModel modelRoot)
Retrieve the name of this Identifier. |
java.util.Set<ExpressionUtils.ExpressionType> |
getType()
Determine the type of result that can be calculated by this expression. |
int |
hashCode()
Returns a hash code value for the Identifier. |
boolean |
isComplete()
Has the identifier's name been assigned? |
boolean |
isConstant()
Determine whether result calculated by this expression is a constant value. |
Expression |
resolveExpression()
Resolves the current expression, possibly into a different expression object. |
void |
setTemplateModel(TemplateWriteableHashModel modelRoot,
TemplateModel value)
Sets the identifier's referent in modelRoot. |
java.lang.String |
toString()
Returns the name of the identifier as a String. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Identifier(java.lang.String name)
Identifier with the given name.
name - the name of the identifier| Method Detail |
|---|
public java.lang.String getName()
public java.lang.String getName(TemplateWriteableHashModel modelRoot)
Identifier.
getName in interface VariablemodelRoot - the TemplateModelRoot used to evaluate
the name of the identifier
public boolean isComplete()
isComplete in interface Expressiontrue if the identifier is named, otherwise falsepublic java.util.Set<ExpressionUtils.ExpressionType> getType()
ExpressionUtils class.
getType in interface Expressionpublic boolean isConstant()
isConstant in interface Expression
public TemplateModel getAsTemplateModel(TemplateWriteableHashModel modelRoot)
throws TemplateException
getAsTemplateModel in interface ExpressionmodelRoot - the root node of the data model.
TemplateModel that the variable refers to.
TemplateException - the expression could not be evaluated for some reason
public void setTemplateModel(TemplateWriteableHashModel modelRoot,
TemplateModel value)
throws TemplateException
setTemplateModel in interface VariablemodelRoot - the root node of the data model.value - the TemplateModel that the identifier will be
set to
TemplateException - the value could not be assigned to the modelpublic java.lang.String toString()
String.
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
Identifiers.
equals in class java.lang.Objecttrue if the identifiers are equal, otherwise falsepublic int hashCode()
Identifier.
hashCode in class java.lang.Objectpublic Expression resolveExpression()
readResolve method. Situations where this may be used are:
resolveExpression in interface Expression
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||