Class DefaultAttributeResolver
- java.lang.Object
-
- io.pebbletemplates.pebble.attributes.DefaultAttributeResolver
-
- All Implemented Interfaces:
AttributeResolver
public class DefaultAttributeResolver extends java.lang.Object implements AttributeResolver
-
-
Field Summary
Fields Modifier and Type Field Description private MemberCacheUtilsmemberCacheUtils
-
Constructor Summary
Constructors Constructor Description DefaultAttributeResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.Class<?>[]getArgumentTypes(java.lang.Object[] argumentValues)private java.lang.ObjectinvokeMember(java.lang.Object object, java.lang.reflect.Member member, java.lang.Object[] argumentValues, java.lang.String filename, int lineNumber)Invoke the "Member" that was found via reflection.ResolvedAttributeresolve(java.lang.Object instance, java.lang.Object attributeNameValue, java.lang.Object[] argumentValues, ArgumentsNode args, EvaluationContextImpl context, java.lang.String filename, int lineNumber)Attempts to resolve an attribute of the given instance.
-
-
-
Field Detail
-
memberCacheUtils
private final MemberCacheUtils memberCacheUtils
-
-
Method Detail
-
resolve
public ResolvedAttribute resolve(java.lang.Object instance, java.lang.Object attributeNameValue, java.lang.Object[] argumentValues, ArgumentsNode args, EvaluationContextImpl context, java.lang.String filename, int lineNumber)
Description copied from interface:AttributeResolverAttempts to resolve an attribute of the given instance. If this method returnsnull, Pebble asks the next attribute resolver in the list.- Specified by:
resolvein interfaceAttributeResolver- Parameters:
instance- The object which is being accessedattributeNameValue- The name of the attribute to resolveargumentValues- fully evaluated positional argumentsargs- The argumentscontext- The evaluation contextfilename- Filename of the templatelineNumber- the line number on which the expression is defined on.- Returns:
- a
ResolvedAttributewrapping the attribute value, ornullif the attribute could not be resolved
-
getArgumentTypes
private java.lang.Class<?>[] getArgumentTypes(java.lang.Object[] argumentValues)
-
invokeMember
private java.lang.Object invokeMember(java.lang.Object object, java.lang.reflect.Member member, java.lang.Object[] argumentValues, java.lang.String filename, int lineNumber)Invoke the "Member" that was found via reflection.
-
-