Class IdentifierExpression
- java.lang.Object
-
- org.vedantatree.expressionoasis.expressions.IdentifierExpression
-
- All Implemented Interfaces:
Expression
public class IdentifierExpression extends Object implements Expression
This is the expression for identifier. This identifier can be used as variable or any reference name to get the corresponding value.
-
-
Constructor Summary
Constructors Constructor Description IdentifierExpression()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(ExpressionVisitor visitor)Allows an expression visitor to visit this expression and it's sub-expressions (implements Visitor design pattern).StringgetIdentifierName()Gets the name of identifier.TypegetReturnType()Gets the return type of the expression.ValueObjectgetValue()Executes and returns the value of this expression.voidinitialize(ExpressionContext expressionContext, Object parameters, boolean validate)Initializes the identifier nameStringtoString()voiduninitialize(ExpressionContext expressionContext)This is used to un-initialize the expression, so that expression can be reused.
-
-
-
Method Detail
-
getReturnType
public Type getReturnType() throws ExpressionEngineException
Description copied from interface:ExpressionGets the return type of the expression.- Specified by:
getReturnTypein interfaceExpression- Returns:
- the type of expression
- Throws:
ExpressionEngineException- If there is any problem during execution- See Also:
Expression.getReturnType()
-
getValue
public ValueObject getValue() throws ExpressionEngineException
Description copied from interface:ExpressionExecutes and returns the value of this expression. If expression is not at node level, it will further evaluate its related expression which may represents operands or operators and return the final outcome.- Specified by:
getValuein interfaceExpression- Returns:
- the value of expression (after expression evaluation)
- Throws:
ExpressionEngineException- if there is any problem during execution- See Also:
Expression.getValue()
-
initialize
public void initialize(ExpressionContext expressionContext, Object parameters, boolean validate) throws ExpressionEngineException
Initializes the identifier name- Specified by:
initializein interfaceExpression- Parameters:
expressionContext- contextual information, may help in initializationparameters- for example, sub expressions and identifiers- Throws:
ExpressionEngineException- if there is any problem during execution- See Also:
org.vedantatree.expressionoasis.expressions.Expression#initialize(org.vedantatree.expressionoasis.ExpressionContext, java.lang.Object)
-
getIdentifierName
public String getIdentifierName()
Gets the name of identifier.- Returns:
- Returns the identifierName.
-
uninitialize
public void uninitialize(ExpressionContext expressionContext)
Description copied from interface:ExpressionThis is used to un-initialize the expression, so that expression can be reused.- Specified by:
uninitializein interfaceExpression- Parameters:
expressionContext- contextual information, may help in un-initialization- See Also:
Expression.uninitialize(org.vedantatree.expressionoasis.ExpressionContext)
-
toString
public String toString()
- Overrides:
toStringin classObject- See Also:
Object.toString()
-
accept
public void accept(ExpressionVisitor visitor)
Allows an expression visitor to visit this expression and it's sub-expressions (implements Visitor design pattern).- Specified by:
acceptin interfaceExpression- Parameters:
visitor- a visitor object that this expression must visit when accept is called.- See Also:
Expression.accept(org.vedantatree.expressionoasis.ExpressionVisitor)
-
-