Class 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.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.
      ResolvedAttribute resolve​(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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultAttributeResolver

        public DefaultAttributeResolver()
    • 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: AttributeResolver
        Attempts to resolve an attribute of the given instance. If this method returns null, Pebble asks the next attribute resolver in the list.
        Specified by:
        resolve in interface AttributeResolver
        Parameters:
        instance - The object which is being accessed
        attributeNameValue - The name of the attribute to resolve
        argumentValues - fully evaluated positional arguments
        args - The arguments
        context - The evaluation context
        filename - Filename of the template
        lineNumber - the line number on which the expression is defined on.
        Returns:
        a ResolvedAttribute wrapping the attribute value, or null if 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.