Class GetAttributeExpression
java.lang.Object
io.pebbletemplates.pebble.node.expression.GetAttributeExpression
- All Implemented Interfaces:
Expression<Object>,Node
Used to get an attribute from an object. It will look up attributes in the following order: map
entry, array item, list item, get method, is method, has method, public method, public field.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ArgumentsNodeprivate final Expression<?> private final Stringprivate final intprivate final Expression<?> -
Constructor Summary
ConstructorsConstructorDescriptionGetAttributeExpression(Expression<?> node, Expression<?> attributeNameExpression, ArgumentsNode args, String filename, int lineNumber) GetAttributeExpression(Expression<?> node, Expression<?> attributeNameExpression, String filename, int lineNumber) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(NodeVisitor visitor) evaluate(PebbleTemplateImpl self, EvaluationContextImpl context) private Object[]getArgumentValues(PebbleTemplateImpl self, EvaluationContextImpl context) Fully evaluates the individual arguments.Expression<?> intReturns the line number on which the expression is defined on.Expression<?> getNode()
-
Field Details
-
node
-
attributeNameExpression
-
args
-
filename
-
lineNumber
private final int lineNumber
-
-
Constructor Details
-
GetAttributeExpression
public GetAttributeExpression(Expression<?> node, Expression<?> attributeNameExpression, String filename, int lineNumber) -
GetAttributeExpression
public GetAttributeExpression(Expression<?> node, Expression<?> attributeNameExpression, ArgumentsNode args, String filename, int lineNumber)
-
-
Method Details
-
evaluate
public Object evaluate(PebbleTemplateImpl self, EvaluationContextImpl context) throws PebbleException - Specified by:
evaluatein interfaceExpression<Object>- Throws:
PebbleException
-
getArgumentValues
Fully evaluates the individual arguments. -
accept
-
getNode
-
getAttributeNameExpression
-
getArgumentsNode
-
getLineNumber
public int getLineNumber()Description copied from interface:ExpressionReturns the line number on which the expression is defined on.- Specified by:
getLineNumberin interfaceExpression<Object>- Returns:
- the line number on which the expression is defined on.
-