Package com.hubspot.jinjava.el.ext.eager
Class EagerAstNodeDecorator
- java.lang.Object
-
- de.odysseus.el.tree.impl.ast.AstNode
-
- com.hubspot.jinjava.el.ext.eager.EagerAstNodeDecorator
-
- All Implemented Interfaces:
EvalResultHolder
,de.odysseus.el.tree.ExpressionNode
,de.odysseus.el.tree.Node
public class EagerAstNodeDecorator extends de.odysseus.el.tree.impl.ast.AstNode implements EvalResultHolder
This decorator exists to ensure that every EvalResultHolder is an instanceof AstNode. When using eager parsing, every AstNode should either be an EvalResultHolder or wrapped with this decorator.
-
-
Field Summary
Fields Modifier and Type Field Description protected Object
evalResult
protected boolean
hasEvalResult
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendStructure(StringBuilder stringBuilder, de.odysseus.el.tree.Bindings bindings)
Object
eval(de.odysseus.el.tree.Bindings bindings, javax.el.ELContext elContext)
static EvalResultHolder
getAsEvalResultHolder(de.odysseus.el.tree.impl.ast.AstNode astNode)
int
getCardinality()
de.odysseus.el.tree.Node
getChild(int i)
Object
getEvalResult()
javax.el.MethodInfo
getMethodInfo(de.odysseus.el.tree.Bindings bindings, javax.el.ELContext elContext, Class<?> aClass, Class<?>[] classes)
String
getPartiallyResolved(de.odysseus.el.tree.Bindings bindings, javax.el.ELContext context, DeferredParsingException deferredParsingException, IdentifierPreservationStrategy identifierPreservationStrategy)
Class<?>
getType(de.odysseus.el.tree.Bindings bindings, javax.el.ELContext elContext)
javax.el.ValueReference
getValueReference(de.odysseus.el.tree.Bindings bindings, javax.el.ELContext elContext)
boolean
hasEvalResult()
Object
invoke(de.odysseus.el.tree.Bindings bindings, javax.el.ELContext elContext, Class<?> aClass, Class<?>[] classes, Object[] objects)
boolean
isLeftValue()
boolean
isLiteralText()
boolean
isMethodInvocation()
boolean
isReadOnly(de.odysseus.el.tree.Bindings bindings, javax.el.ELContext elContext)
void
setEvalResult(Object evalResult)
void
setValue(de.odysseus.el.tree.Bindings bindings, javax.el.ELContext elContext, Object o)
-
Methods inherited from class de.odysseus.el.tree.impl.ast.AstNode
findAccessibleMethod, getStructuralId, getValue
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.hubspot.jinjava.el.ext.eager.EvalResultHolder
checkEvalResultSize, eval
-
-
-
-
Field Detail
-
evalResult
protected Object evalResult
-
hasEvalResult
protected boolean hasEvalResult
-
-
Method Detail
-
getAsEvalResultHolder
public static EvalResultHolder getAsEvalResultHolder(de.odysseus.el.tree.impl.ast.AstNode astNode)
-
getEvalResult
public Object getEvalResult()
- Specified by:
getEvalResult
in interfaceEvalResultHolder
-
setEvalResult
public void setEvalResult(Object evalResult)
- Specified by:
setEvalResult
in interfaceEvalResultHolder
-
hasEvalResult
public boolean hasEvalResult()
- Specified by:
hasEvalResult
in interfaceEvalResultHolder
-
appendStructure
public void appendStructure(StringBuilder stringBuilder, de.odysseus.el.tree.Bindings bindings)
- Specified by:
appendStructure
in classde.odysseus.el.tree.impl.ast.AstNode
-
eval
public Object eval(de.odysseus.el.tree.Bindings bindings, javax.el.ELContext elContext)
- Specified by:
eval
in classde.odysseus.el.tree.impl.ast.AstNode
-
getPartiallyResolved
public String getPartiallyResolved(de.odysseus.el.tree.Bindings bindings, javax.el.ELContext context, DeferredParsingException deferredParsingException, IdentifierPreservationStrategy identifierPreservationStrategy)
- Specified by:
getPartiallyResolved
in interfaceEvalResultHolder
-
isLiteralText
public boolean isLiteralText()
- Specified by:
isLiteralText
in interfacede.odysseus.el.tree.ExpressionNode
-
isLeftValue
public boolean isLeftValue()
- Specified by:
isLeftValue
in interfacede.odysseus.el.tree.ExpressionNode
-
isMethodInvocation
public boolean isMethodInvocation()
- Specified by:
isMethodInvocation
in interfacede.odysseus.el.tree.ExpressionNode
-
getValueReference
public javax.el.ValueReference getValueReference(de.odysseus.el.tree.Bindings bindings, javax.el.ELContext elContext)
- Specified by:
getValueReference
in interfacede.odysseus.el.tree.ExpressionNode
-
getType
public Class<?> getType(de.odysseus.el.tree.Bindings bindings, javax.el.ELContext elContext)
- Specified by:
getType
in interfacede.odysseus.el.tree.ExpressionNode
-
isReadOnly
public boolean isReadOnly(de.odysseus.el.tree.Bindings bindings, javax.el.ELContext elContext)
- Specified by:
isReadOnly
in interfacede.odysseus.el.tree.ExpressionNode
-
setValue
public void setValue(de.odysseus.el.tree.Bindings bindings, javax.el.ELContext elContext, Object o)
- Specified by:
setValue
in interfacede.odysseus.el.tree.ExpressionNode
-
getMethodInfo
public javax.el.MethodInfo getMethodInfo(de.odysseus.el.tree.Bindings bindings, javax.el.ELContext elContext, Class<?> aClass, Class<?>[] classes)
- Specified by:
getMethodInfo
in interfacede.odysseus.el.tree.ExpressionNode
-
invoke
public Object invoke(de.odysseus.el.tree.Bindings bindings, javax.el.ELContext elContext, Class<?> aClass, Class<?>[] classes, Object[] objects)
- Specified by:
invoke
in interfacede.odysseus.el.tree.ExpressionNode
-
getCardinality
public int getCardinality()
- Specified by:
getCardinality
in interfacede.odysseus.el.tree.Node
-
getChild
public de.odysseus.el.tree.Node getChild(int i)
- Specified by:
getChild
in interfacede.odysseus.el.tree.Node
-
-