|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--freemarker.template.expression.Constant
Represents a constant value within an expression. This is calculated by
the ExpressionBuilder
and stored within the parse tree in place
of a more complex expression. The value is stored as a TemplateModel,
which is returned on demand.
Constructor Summary | |
Constant(TemplateModel constantValue)
Creates a new constant expression with the given model as its value. |
Method Summary | |
boolean |
equals(java.lang.Object o)
Determines whether this object is equal to the given object. |
TemplateModel |
getAsTemplateModel(TemplateModelRoot modelRoot)
The TemplateModel value of this constant Expression . |
int |
getType()
Determine the type of result that can be calculated by this expression. |
int |
hashCode()
Returns the hash code for this constant expression. |
boolean |
isComplete()
Is the Expression complete? |
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 Constant(TemplateModel constantValue)
constantValue
- the value to be returned when a template model
is requestedNullPointerException
- the value is nullMethod Detail |
public boolean isComplete()
Expression
complete?isComplete
in interface Expression
true
since the constant Expression
is
always completepublic int getType()
ExpressionUtils
class.getType
in interface Expression
public TemplateModel getAsTemplateModel(TemplateModelRoot modelRoot) throws TemplateException
TemplateModel
value of this constant Expression
.getAsTemplateModel
in interface Expression
modelRoot
- the template model that will be evaluated by the expressionTemplateException
- the expression could not be evaluated for some reasonpublic java.lang.String toString()
toString
in class java.lang.Object
String
representation of this constant expressionpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the object to be compared withtrue
if the objects are equal, otherwise
false
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |