Class DefaultELEngine

  • All Implemented Interfaces:
    ELEngine
    Direct Known Subclasses:
    TcclELEngine

    public class DefaultELEngine
    extends Object
    implements ELEngine
    ELEngine implementation that uses an ExpressionFactory and SimpleELContext to resolve variables and functions
    • Field Detail

      • elContext

        protected jakarta.el.ELContext elContext
      • expressionFactory

        protected jakarta.el.ExpressionFactory expressionFactory
    • Constructor Detail

      • DefaultELEngine

        public DefaultELEngine​(jakarta.el.ExpressionFactory expressionFactory)
    • Method Detail

      • setVariable

        public <T> void setVariable​(String key,
                                    T value)
        Sets a variable to resolve
        Specified by:
        setVariable in interface ELEngine
        Type Parameters:
        T - generic type of value
        Parameters:
        key - key to store
        value - value to resolve
      • setVariable

        public <T> void setVariable​(String key,
                                    T value,
                                    Class<? extends T> type)
        Sets a variable
        Specified by:
        setVariable in interface ELEngine
        Type Parameters:
        T - generic type of value
        Parameters:
        key - key to store
        value - value to resolve
        type - type of value
      • setFunction

        public void setFunction​(String prefix,
                                Method method)
        Sets a function to resolve
        Specified by:
        setFunction in interface ELEngine
        Parameters:
        prefix - the prefix of the function
        method - method to resolve
      • setFunction

        public void setFunction​(String prefix,
                                String name,
                                Method method)
        Sets a function to resolve
        Specified by:
        setFunction in interface ELEngine
        Parameters:
        prefix - the prefix of the function
        name - name of methhod
        method - method to resolve
      • resolve

        public String resolve​(String expression)
        Resolves expression
        Specified by:
        resolve in interface ELEngine
        Parameters:
        expression - expression to resolve
        Returns:
        resolved expression