Package org.opensearch.painless.spi
Class WhitelistClass
- java.lang.Object
-
- org.opensearch.painless.spi.WhitelistClass
-
public final class WhitelistClass extends java.lang.ObjectClass represents the equivalent of a Java class in Painless complete with super classes, constructors, methods, and fields. There must be a one-to-one mapping of class names to Java classes. Though, since multiple allowlists may be combined into a single allowlist for a specific context, as long as multiple classes representing the same Java class have the same class name and have legal constructor/method overloading they can be merged together. Classes in Painless allow for arity overloading for constructors and methods. Arity overloading means that multiple constructors are allowed for a single class as long as they have a different number of parameters, and multiples methods with the same name are allowed for a single class as long as they have the same return type and a different number of parameters. Classes will automatically extend other allowlisted classes if the Java class they represent is a subclass of other classes including Java interfaces.
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.StringjavaClassNameThe Java class name this class represents.java.lang.StringoriginInformation about where this class was white-listed from.java.util.Map<java.lang.Class<?>,java.lang.Object>painlessAnnotationsTheMapof annotations for this class.java.util.List<WhitelistConstructor>whitelistConstructorsTheListof allowlisted (WhitelistConstructors) available to this class.java.util.List<WhitelistField>whitelistFieldsTheListof allowlisted (WhitelistFields) available to this class.java.util.List<WhitelistMethod>whitelistMethodsTheListof allowlisted (WhitelistMethods) available to this class.
-
Constructor Summary
Constructors Constructor Description WhitelistClass(java.lang.String origin, java.lang.String javaClassName, java.util.List<WhitelistConstructor> allowlistConstructors, java.util.List<WhitelistMethod> allowlistMethods, java.util.List<WhitelistField> allowlistFields, java.util.List<java.lang.Object> painlessAnnotations)Standard constructor.
-
-
-
Field Detail
-
origin
public final java.lang.String origin
Information about where this class was white-listed from.
-
javaClassName
public final java.lang.String javaClassName
The Java class name this class represents.
-
whitelistConstructors
public final java.util.List<WhitelistConstructor> whitelistConstructors
TheListof allowlisted (WhitelistConstructors) available to this class.
-
whitelistMethods
public final java.util.List<WhitelistMethod> whitelistMethods
TheListof allowlisted (WhitelistMethods) available to this class.
-
whitelistFields
public final java.util.List<WhitelistField> whitelistFields
TheListof allowlisted (WhitelistFields) available to this class.
-
painlessAnnotations
public final java.util.Map<java.lang.Class<?>,java.lang.Object> painlessAnnotations
TheMapof annotations for this class.
-
-
Constructor Detail
-
WhitelistClass
public WhitelistClass(java.lang.String origin, java.lang.String javaClassName, java.util.List<WhitelistConstructor> allowlistConstructors, java.util.List<WhitelistMethod> allowlistMethods, java.util.List<WhitelistField> allowlistFields, java.util.List<java.lang.Object> painlessAnnotations)Standard constructor. All values must be notnull.
-
-