|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectfreemarker.template.expression.ListLiteral
public final class ListLiteral
Represents a literal List model in a FM-Classic template. The list 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 | |
|---|---|
ListLiteral(java.util.List<Expression> values)
Constructor that takes a list of Expression elements to be
evaluated as a list 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.List<TemplateModel> |
getModelList(TemplateWriteableHashModel modelRoot)
For the benefit of method calls, return the list of arguments as a list of TemplateModel values. |
java.util.Set<ExpressionUtils.ExpressionType> |
getType()
Determine the type of result that can be calculated by this expression. |
java.util.List<java.lang.String> |
getValueList(TemplateWriteableHashModel modelRoot)
For the benefit of method calls, return the list of arguments as a list of String values. |
int |
hashCode()
Returns the hash code for this operator. |
boolean |
isComplete()
Has the ListLiteral 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 ListLiteral(java.util.List<Expression> values)
Expression elements to be
evaluated as a list model at run time.
values - the values to be added to the ListLiteral
java.lang.NullPointerException - the value list is null| Method Detail |
|---|
public TemplateModel getAsTemplateModel(TemplateWriteableHashModel modelRoot)
throws TemplateException
TemplateModel value of this
Expression.
getAsTemplateModel in interface ExpressionmodelRoot - the template model that will be evaluated by the expression
FastList containing the values in the list model
TemplateException - the expression could not be evaluated for some reason
public java.util.List<TemplateModel> getModelList(TemplateWriteableHashModel modelRoot)
throws TemplateException
TemplateModel values.
modelRoot - the template model that will be evaluated by the expression
List of TemplateModels contained
in the ListLiteral
TemplateException - the literal list could not be returned
public java.util.List<java.lang.String> getValueList(TemplateWriteableHashModel modelRoot)
throws TemplateException
String values.
modelRoot - the template model that will be evaluated by the expression
List of Strings contained
in the ListLiteral
TemplateException - the literal list could not be returnedpublic boolean isComplete()
ListLiteral been populated?
isComplete in interface Expressiontrue if the ListLiteral is populated,
otherwise falsepublic java.util.Set<ExpressionUtils.ExpressionType> getType()
ExpressionUtils class.
getType in interface Expressionpublic boolean isConstant()
isConstant in interface Expressionpublic java.lang.String toString()
toString in class java.lang.ObjectString representation of this expressionpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - the object to be compared with
true if the objects are equal, otherwise
falsepublic 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 ExpressionTemplateException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||