Class Source

java.lang.Object
org.apache.commons.jexl3.internal.Source
All Implemented Interfaces:
Comparable<Source>

public final class Source extends Object implements Comparable<Source>
Maintains the set of allowed features associated with a script/expression source.

This is meant for caching scripts using their 'source' as key but still distinguishing scripts with different features and prevent false sharing.

  • Field Details

    • hashCode

      private final int hashCode
      The hash code, pre-computed for fast op.
    • features

      private final JexlFeatures features
      The set of features.
    • str

      private final String str
      The actual source script/expression.
  • Constructor Details

    • Source

      Source(JexlFeatures theFeatures, String theStr)
      Default constructor.
      Parameters:
      theFeatures - the features
      theStr - the script source
  • Method Details

    • compareTo

      public int compareTo(Source s)
      Specified by:
      compareTo in interface Comparable<Source>
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getFeatures

      public JexlFeatures getFeatures()
      Returns:
      the features associated with the source
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • length

      int length()
      Returns:
      the length of the script source
    • toString

      public String toString()
      Overrides:
      toString in class Object