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.
- Author:
- Mitchell
-
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) Expression<?>intReturns the line number on which the expression is defined on.Expression<?>getNode()
-
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
-
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.
-