Class Engine

    • Field Detail

      • PROPERTY_FEATURES

        protected static final JexlFeatures PROPERTY_FEATURES
        The features allowed for property set/get methods.
      • logger

        protected final org.apache.commons.logging.Log logger
        The Log to which all JexlEngine messages will be logged.
      • uberspect

        protected final JexlUberspect uberspect
        The JexlUberspect instance.
      • functions

        protected final java.util.Map<java.lang.String,​java.lang.Object> functions
        The map of 'prefix:function' to object implementing the namespaces.
      • classNameSolver

        protected final FqcnResolver classNameSolver
        The default class name resolver.
      • stackOverflow

        protected final int stackOverflow
        The maximum stack height.
      • strict

        protected final boolean strict
        Whether this engine considers unknown variables, methods and constructors as errors.
      • safe

        protected final boolean safe
        Whether this engine considers null in navigation expression as errors.
      • silent

        protected final boolean silent
        Whether expressions evaluated by this engine will throw exceptions (false) or return null (true) on errors. Default is false.
      • cancellable

        protected final boolean cancellable
        Whether expressions evaluated by this engine will throw JexlException.Cancel (true) or return null (false) when interrupted. Default is true when not silent and strict.
      • debug

        protected final boolean debug
        Whether error messages will carry debugging information.
      • scriptFeatures

        protected final JexlFeatures scriptFeatures
        The set of default script parsing features.
      • expressionFeatures

        protected final JexlFeatures expressionFeatures
        The set of default expression parsing features.
      • charset

        protected final java.nio.charset.Charset charset
        The default charset.
      • parserFactory

        protected final java.util.function.Supplier<JexlScriptParser> parserFactory
        The Jexl script parser factory.
      • parsing

        protected final java.util.concurrent.atomic.AtomicBoolean parsing
        The atomic parsing flag; true whilst parsing.
      • parser

        protected final JexlScriptParser parser
        The Parser; when parsing expressions, this engine uses the parser if it is not already in use otherwise it will create a new temporary one.
      • cacheThreshold

        protected final int cacheThreshold
        The expression max length to hit the cache.
      • cache

        protected final JexlCache<Source,​java.lang.Object> cache
        The expression cache.
      • collectMode

        protected final int collectMode
        Collect all or only dot references.
      • options

        protected final JexlOptions options
        A cached version of the options.
      • metaCache

        protected final MetaCache metaCache
        The set of caches created by this engine.

        Caches are soft-referenced by the engine so they can be cleaned on class loader change.

    • Constructor Detail

      • Engine

        public Engine()
        Creates an engine with default arguments.
      • Engine

        public Engine​(JexlBuilder conf)
        Creates a JEXL engine using the provided JexlBuilder.
        Parameters:
        conf - the builder
    • Method Detail

      • getUberspect

        public static Uberspect getUberspect​(org.apache.commons.logging.Log logger,
                                             JexlUberspect.ResolverStrategy strategy,
                                             JexlPermissions permissions)
        Gets the default instance of Uberspect.

        This is lazily initialized to avoid building a default instance if there is no use for it.

        The main reason for not using the default Uberspect instance are:
      • Using a (low level) introspector created with a given logger instead of the default one
      • Using a (restricted) set of permissions
Parameters:
logger - the logger to use for the underlying Uberspect
strategy - the property resolver strategy
permissions - the introspection permissions
Returns:
Uberspect the default uberspector instance.
Since:
3.3