|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--freemarker.template.expression.DynamicKeyName
A unary operator that uses the string value of an expression as a hash key.
It associates with other Variable
expressions to its left.
Fields inherited from interface freemarker.template.expression.Unary |
POSTFIX, PREFIX |
Constructor Summary | |
DynamicKeyName(Expression key)
Constructor that takes an Expression used to evaluate the
key name at run time. |
Method Summary | |
boolean |
equals(java.lang.Object o)
Determines whether this object is equal to the given object. |
int |
getAssociationType()
Retrieve the operator association for this operator. |
TemplateModel |
getAsTemplateModel(TemplateModelRoot modelRoot)
Sets the target of this DynamicKeyName operator. |
java.lang.String |
getName(TemplateModelRoot modelRoot)
Retrieve the name of this portion of the variable. |
int |
getOperatorClass()
Return the type of operator this is to the caller. |
int |
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 key name and target specified? |
void |
setTarget(Expression target)
Sets the target of the dynamic key. |
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 DynamicKeyName(Expression key)
Expression
used to evaluate the
key name at run time.key
- the expression to be used to evaluate the key nameNullPointerException
- the key expression was nulljava.lang.IllegalArgumentException
- the key could not be evaluated as a
number or a StringMethod Detail |
public void setTarget(Expression target)
setTarget
in interface Unary
target
- the target of the dynamic keyjava.lang.IllegalArgumentException
- the expression was not suitable for a
dynamic key name evaluationpublic boolean isComplete()
isComplete
in interface Expression
true
if both target and key name are specified,
otherwise false
public int getType()
ExpressionUtils
class.getType
in interface Expression
public int getAssociationType()
getAssociationType
in interface Unary
POSTFIX
.public TemplateModel getAsTemplateModel(TemplateModelRoot modelRoot) throws TemplateException
DynamicKeyName
operator.getAsTemplateModel
in interface Expression
TemplateException
- the target is of the wrong type
for this operator.public java.lang.String getName(TemplateModelRoot modelRoot) throws TemplateException
getName
in interface Variable
modelRoot
- the model to be used in cases where the variable is
the result of an Expression
.TemplateException
- the name could not be determinedpublic int getOperatorClass()
getOperatorClass
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 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 |