Class WhitelistMethod

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

public class WhitelistMethod
extends java.lang.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 Summary

    Fields 
    Modifier and Type Field Description
    java.lang.String augmentedCanonicalClassName
    The class name for the owner of an augmented method.
    java.util.List<java.lang.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.
    java.lang.String methodName
    The method name used to look up the method reflection object.
    java.lang.String origin
    Information about where this method was whitelisted from.
    java.util.Map<java.lang.Class<?>,​java.lang.Object> painlessAnnotations
    The Map of annotations for this method.
    java.lang.String returnCanonicalTypeName
    The canonical type name for the return type.
  • Constructor Summary

    Constructors 
    Constructor Description
    WhitelistMethod​(java.lang.String origin, java.lang.String augmentedCanonicalClassName, java.lang.String methodName, java.lang.String returnCanonicalTypeName, java.util.List<java.lang.String> canonicalTypeNameParameters, java.util.List<java.lang.Object> painlessAnnotations)
    Standard constructor.
  • Method Summary

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • origin

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

      public final java.lang.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 java.lang.String methodName
      The method name used to look up the method reflection object.
    • returnCanonicalTypeName

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

      public final java.util.List<java.lang.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 java.util.Map<java.lang.Class<?>,​java.lang.Object> painlessAnnotations
      The Map of annotations for this method.
  • Constructor Details

    • WhitelistMethod

      public WhitelistMethod​(java.lang.String origin, java.lang.String augmentedCanonicalClassName, java.lang.String methodName, java.lang.String returnCanonicalTypeName, java.util.List<java.lang.String> canonicalTypeNameParameters, java.util.List<java.lang.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.