Package de.odysseus.el.tree.impl.ast
Class AstFunction
- java.lang.Object
-
- de.odysseus.el.tree.impl.ast.AstNode
-
- de.odysseus.el.tree.impl.ast.AstRightValue
-
- de.odysseus.el.tree.impl.ast.AstFunction
-
- All Implemented Interfaces:
ExpressionNode,FunctionNode,Node
public class AstFunction extends AstRightValue implements FunctionNode
-
-
Field Summary
Fields Modifier and Type Field Description private intindexprivate java.lang.Stringnameprivate AstParametersparamsprivate booleanvarargs
-
Constructor Summary
Constructors Constructor Description AstFunction(java.lang.String name, int index, AstParameters params)AstFunction(java.lang.String name, int index, AstParameters params, boolean varargs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendStructure(java.lang.StringBuilder b, Bindings bindings)java.lang.Objecteval(Bindings bindings, javax.el.ELContext context)intgetCardinality()Get the node's number of children.AstNodegetChild(int i)Get i'th childintgetIndex()Get the unique index of this identifier in the expression (e.g.java.lang.StringgetName()Get the full function nameprotected AstNodegetParam(int i)intgetParamCount()Get the number of parameters for this functionprotected java.lang.Objectinvoke(Bindings bindings, javax.el.ELContext context, java.lang.Object base, java.lang.reflect.Method method)Invoke method.booleanisVarArgs()java.lang.StringtoString()-
Methods inherited from class de.odysseus.el.tree.impl.ast.AstRightValue
getMethodInfo, getType, getValueReference, invoke, isLeftValue, isLiteralText, isMethodInvocation, isReadOnly, setValue
-
Methods inherited from class de.odysseus.el.tree.impl.ast.AstNode
findAccessibleMethod, getStructuralId, getValue
-
-
-
-
Field Detail
-
index
private final int index
-
name
private final java.lang.String name
-
params
private final AstParameters params
-
varargs
private final boolean varargs
-
-
Constructor Detail
-
AstFunction
public AstFunction(java.lang.String name, int index, AstParameters params)
-
AstFunction
public AstFunction(java.lang.String name, int index, AstParameters params, boolean varargs)
-
-
Method Detail
-
invoke
protected java.lang.Object invoke(Bindings bindings, javax.el.ELContext context, java.lang.Object base, java.lang.reflect.Method method) throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException
Invoke method.- Parameters:
bindings-context-base-method-- Returns:
- method result
- Throws:
java.lang.reflect.InvocationTargetExceptionjava.lang.IllegalAccessException
-
eval
public java.lang.Object eval(Bindings bindings, javax.el.ELContext context)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
appendStructure
public void appendStructure(java.lang.StringBuilder b, Bindings bindings)- Specified by:
appendStructurein classAstNode
-
getIndex
public int getIndex()
Description copied from interface:FunctionNodeGet the unique index of this identifier in the expression (e.g. preorder index)- Specified by:
getIndexin interfaceFunctionNode
-
getName
public java.lang.String getName()
Description copied from interface:FunctionNodeGet the full function name- Specified by:
getNamein interfaceFunctionNode
-
isVarArgs
public boolean isVarArgs()
- Specified by:
isVarArgsin interfaceFunctionNode- Returns:
trueif this node supports varargs.
-
getParamCount
public int getParamCount()
Description copied from interface:FunctionNodeGet the number of parameters for this function- Specified by:
getParamCountin interfaceFunctionNode
-
getParam
protected AstNode getParam(int i)
-
getCardinality
public int getCardinality()
Description copied from interface:NodeGet the node's number of children.- Specified by:
getCardinalityin interfaceNode
-
-