Class WhitelistMethod

java.lang.Object
org.elasticsearch.painless.spi.WhitelistMethod

public class WhitelistMethod extends Object
Method represents the equivalent of a Java method available as a whitelisted class method within Painless. Methods for Painless classes may be accessed exactly as methods for Java classes are using the '.' operator on an existing class variable/field. Painless classes may have multiple methods with the same name as long as they comply with arity overloading described in WhitelistClass. Classes may also have additional methods that are not part of the Java class the class represents - these are known as augmented methods. An augmented method can be added to a class as a part of any Java class as long as the method is static and the first parameter of the method is the Java class represented by the class. Note that the augmented method's parent Java class does not need to be whitelisted.
  • Field Details

    • origin

      public final String origin
      Information about where this method was whitelisted from.
    • augmentedCanonicalClassName

      public final String augmentedCanonicalClassName
      The class name for the owner of an augmented method. If the method is not augmented this should be null.
    • methodName

      public final String methodName
      The method name used to look up the method reflection object.
    • returnCanonicalTypeName

      public final String returnCanonicalTypeName
      The canonical type name for the return type.
    • canonicalTypeNameParameters

      public final List<String> canonicalTypeNameParameters
      A List of Strings that are the canonical type names for the parameters of the method used to look up the method reflection object.
    • painlessAnnotations

      public final Map<Class<?>,Object> painlessAnnotations
      The Map of annotations for this method.
  • Constructor Details

    • WhitelistMethod

      public WhitelistMethod(String origin, String augmentedCanonicalClassName, String methodName, String returnCanonicalTypeName, List<String> canonicalTypeNameParameters, List<Object> painlessAnnotations)
      Standard constructor. All values must be not null with the exception of augmentedCanonicalClassName; augmentedCanonicalClassName will be null unless the method is augmented as described in the class documentation.