|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object freemarker.template.expression.HashLiteral
public final class HashLiteral
Represents a literal Hash model in a FM-Classic template. The hash model is not evaluated until run time, since the model may contain variables or other more complex expressions that can't be determined at compile time.
Constructor Summary | |
---|---|
HashLiteral(java.util.List<Expression> values)
Constructor that takes a list of Expression elements to be
evaluated as a hash model at run time. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
Determines whether this object is equal to the given object. |
TemplateModel |
getAsTemplateModel(TemplateWriteableHashModel modelRoot)
The TemplateModel value of this
Expression . |
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()
Has the HashLiteral been populated? |
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. |
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 HashLiteral(java.util.List<Expression> values)
Expression
elements to be
evaluated as a hash model at run time.
values
- the values to be added to the HashLiteral
java.lang.NullPointerException
- the value list is null
java.lang.IllegalArgumentException
- there are an odd number of arguments in the value listMethod Detail |
---|
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
FastHash
containing the values in the hash model
TemplateException
- the expression could not be evaluated for some reasonpublic boolean isComplete()
HashLiteral
been populated?
isComplete
in interface Expression
true
if the HashLiteral
is populated,
otherwise false
public java.util.Set<ExpressionUtils.ExpressionType> getType()
ExpressionUtils
class.
getType
in interface Expression
public boolean isConstant()
isConstant
in interface Expression
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() throws TemplateException
readResolve
method. Situations where this may be used are:
resolveExpression
in interface Expression
TemplateException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |