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 void
accept(ExpressionVisitor visitor)
Allows an expression visitor to visit this expression and it's sub-expressions (implements Visitor design pattern).String
getIdentifierName()
Gets the name of identifier.Type
getReturnType()
Gets the return type of the expression.ValueObject
getValue()
Executes and returns the value of this expression.void
initialize(ExpressionContext expressionContext, Object parameters, boolean validate)
Initializes the identifier nameString
toString()
void
uninitialize(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:Expression
Gets the return type of the expression.- Specified by:
getReturnType
in 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:Expression
Executes 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:
getValue
in 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:
initialize
in 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:Expression
This is used to un-initialize the expression, so that expression can be reused.- Specified by:
uninitialize
in interfaceExpression
- Parameters:
expressionContext
- contextual information, may help in un-initialization- See Also:
Expression.uninitialize(org.vedantatree.expressionoasis.ExpressionContext)
-
toString
public String toString()
- Overrides:
toString
in 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:
accept
in interfaceExpression
- Parameters:
visitor
- a visitor object that this expression must visit when accept is called.- See Also:
Expression.accept(org.vedantatree.expressionoasis.ExpressionVisitor)
-
-