|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object freemarker.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 Identifier s. |
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 identifierMethod Detail |
---|
public java.lang.String getName()
public java.lang.String getName(TemplateWriteableHashModel modelRoot)
Identifier
.
getName
in interface Variable
modelRoot
- the TemplateModelRoot
used to evaluate
the name of the identifier
public boolean isComplete()
isComplete
in interface Expression
true
if the identifier is named, otherwise false
public java.util.Set<ExpressionUtils.ExpressionType> getType()
ExpressionUtils
class.
getType
in interface Expression
public boolean isConstant()
isConstant
in interface Expression
public TemplateModel getAsTemplateModel(TemplateWriteableHashModel modelRoot) throws TemplateException
getAsTemplateModel
in interface Expression
modelRoot
- the root node of the data model.
TemplateModel
that the variable refers to.
TemplateException
- the expression could not be evaluated for some reasonpublic void setTemplateModel(TemplateWriteableHashModel modelRoot, TemplateModel value) throws TemplateException
setTemplateModel
in interface Variable
modelRoot
- 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.Object
public boolean equals(java.lang.Object o)
Identifier
s.
equals
in class java.lang.Object
true
if the identifiers are equal, otherwise false
public int hashCode()
Identifier
.
hashCode
in class java.lang.Object
public 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 |