Class AugmentedAnnotation

java.lang.Object
org.elasticsearch.painless.spi.annotation.AugmentedAnnotation

public class AugmentedAnnotation extends Object
Use an augmented annotation to augment a class to have available a static final field from a different class. Example: // Whitelist ... class java.lang.Integer { ... } class Augmented { int MAX_VALUE @augmented[augmented_canonical_class_name="java.lang.Integer"] int MIN_VALUE @augmented[augmented_canonical_class_name="java.lang.Integer"] } ... // Script ... long value = <some_value>; int augmented = 0; if (value < Augmented.MAX_VALUE && value > Augmented.MIN_VALUE) { augmented = (int)value; } ...
  • Field Details

  • Constructor Details

    • AugmentedAnnotation

      public AugmentedAnnotation(String augmentedCanonicalClassName)
  • Method Details

    • getAugmentedCanonicalClassName

      public String getAugmentedCanonicalClassName()