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 ArgumentsNode
private final Expression
<?> private final String
private final int
private 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 TypeMethodDescriptionvoid
accept
(NodeVisitor visitor) evaluate
(PebbleTemplateImpl self, EvaluationContextImpl context) private Object[]
getArgumentValues
(PebbleTemplateImpl self, EvaluationContextImpl context) Fully evaluates the individual arguments.Expression
<?> int
Returns 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:
evaluate
in interfaceExpression<Object>
- Throws:
PebbleException
-
getArgumentValues
Fully evaluates the individual arguments. -
accept
-
getNode
-
getAttributeNameExpression
-
getArgumentsNode
-
getLineNumber
public int getLineNumber()Description copied from interface:Expression
Returns the line number on which the expression is defined on.- Specified by:
getLineNumber
in interfaceExpression<Object>
- Returns:
- the line number on which the expression is defined on.
-