|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object freemarker.template.expression.Dot
public final class Dot
The dot operator. Used to reference items inside a
TemplateHashModel
. It associates with other
Variable
expressions to its left.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface freemarker.template.expression.Unary |
---|
Unary.Association |
Constructor Summary | |
---|---|
Dot(Identifier id)
Create a new Dot instruction. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
Determines whether this object is equal to the given object. |
Unary.Association |
getAssociationType()
Retrieve the operator association for this operator. |
TemplateModel |
getAsTemplateModel(TemplateWriteableHashModel modelRoot)
The TemplateModel value of this
Expression . |
java.lang.String |
getName(TemplateWriteableHashModel modelRoot)
Retrieve the name of this portion of the variable. |
ExpressionBuilder.Precedence |
getPrecedence()
Return the precedence for this operator to the caller. |
java.util.Set<ExpressionUtils.ExpressionType> |
getType()
Determine the type of result that can be calculated by this expression. |
int |
hashCode()
Returns the hash code for this operator. |
boolean |
isComplete()
Are both the target and the identifier specified? |
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 |
setTarget(Expression target)
Sets the target of this Dot operator. |
void |
setTemplateModel(TemplateWriteableHashModel modelRoot,
TemplateModel value)
Implements a write of the given value to a writeable hash model. |
java.lang.String |
toString()
Returns a string representation of the object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Dot(Identifier id)
Dot
instruction.
id
- the identifier to the right of the dot.
java.lang.NullPointerException
- the identifier is nullMethod Detail |
---|
public java.lang.String getName(TemplateWriteableHashModel modelRoot)
getName
in interface Variable
modelRoot
- the model to be used in cases where the variable is
the result of an Expression
.public boolean isComplete()
isComplete
in interface Expression
true
if the target and identifier are both specified,
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
TemplateModel
value of this
Expression
.
getAsTemplateModel
in interface Expression
modelRoot
- the template model that will be evaluated by the expression
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 model, for determining contextvalue
- the value to be assigned
TemplateException
- there was a problem performing the assignmentpublic Unary.Association getAssociationType()
getAssociationType
in interface Unary
POSTFIX
.public void setTarget(Expression target)
Dot
operator.
setTarget
in interface Unary
java.lang.IllegalArgumentException
- the target is of the wrong type
for this operator.public ExpressionBuilder.Precedence getPrecedence()
getPrecedence
in interface Operator
public java.lang.String toString()
toString
in class java.lang.Object
String
representation of this expressionpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the object to be compared with
true
if the objects are equal, otherwise
false
public int hashCode()
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 |