Package de.odysseus.el.tree.impl.ast
Class AstNode
- java.lang.Object
-
- de.odysseus.el.tree.impl.ast.AstNode
-
- All Implemented Interfaces:
ExpressionNode,Node
- Direct Known Subclasses:
AstEval,AstIdentifier,AstMethod,AstProperty,AstRightValue,AstText
public abstract class AstNode extends java.lang.Object implements ExpressionNode
-
-
Constructor Summary
Constructors Constructor Description AstNode()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidappendStructure(java.lang.StringBuilder builder, Bindings bindings)abstract java.lang.Objecteval(Bindings bindings, javax.el.ELContext context)protected java.lang.reflect.MethodfindAccessibleMethod(java.lang.reflect.Method method)private static java.lang.reflect.MethodfindPublicAccessibleMethod(java.lang.reflect.Method method)Find accessible method.java.lang.StringgetStructuralId(Bindings bindings)Get the canonical expression string for this node.java.lang.ObjectgetValue(Bindings bindings, javax.el.ELContext context, java.lang.Class<?> type)evaluate and return the (optionally coerced) result.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.odysseus.el.tree.ExpressionNode
getMethodInfo, getType, getValueReference, invoke, isLeftValue, isLiteralText, isMethodInvocation, isReadOnly, setValue
-
Methods inherited from interface de.odysseus.el.tree.Node
getCardinality, getChild
-
-
-
-
Method Detail
-
getValue
public final java.lang.Object getValue(Bindings bindings, javax.el.ELContext context, java.lang.Class<?> type)
evaluate and return the (optionally coerced) result.- Specified by:
getValuein interfaceExpressionNode- Parameters:
bindings- bindings containing variables and functionscontext- evaluation contexttype- result type- Returns:
- evaluated node, coerced to the expected type
-
appendStructure
public abstract void appendStructure(java.lang.StringBuilder builder, Bindings bindings)
-
eval
public abstract java.lang.Object eval(Bindings bindings, javax.el.ELContext context)
-
getStructuralId
public final java.lang.String getStructuralId(Bindings bindings)
Description copied from interface:ExpressionNodeGet the canonical expression string for this node. Variable and funtion names will be replaced in a way such that two expression nodes that have the same node structure and bindings will also answer the same value here. For example,"${foo:bar()+2*foobar}"may lead to"${<fn>() + 2 * <var>}"iffoobaris a bound variable. Otherwise, the structural id would be"${<fn>() + 2 * foobar}". If the bindings isnull, the full canonical subexpression is returned.- Specified by:
getStructuralIdin interfaceExpressionNode
-
findPublicAccessibleMethod
private static java.lang.reflect.Method findPublicAccessibleMethod(java.lang.reflect.Method method)
Find accessible method. Searches the inheritance tree of the class declaring the method until it finds a method that can be invoked.- Parameters:
method- method- Returns:
- accessible method or
null
-
findAccessibleMethod
protected java.lang.reflect.Method findAccessibleMethod(java.lang.reflect.Method method)
-
-