Class ExpressionHelper


  • public class ExpressionHelper
    extends Object
    A helper to deal with EL easier.
    • Method Detail

      • getString

        public String getString​(@CheckForNull
                                String expression)
        Resolves the given expression as string. Request's locale will be used.
        Parameters:
        expression - the expression to be resolved
        Returns:
        the resolved expression as a string, or null when expression is
      • getString

        public String getString​(@CheckForNull
                                String expression,
                                @Nonnull
                                Locale locale)
        Resolves the given expression as string, with the given locale.
        Parameters:
        expression - the expression to be resolved
        locale - the locale
        Returns:
        the resolved expression as a string, or null when expression is
      • getBoolean

        public boolean getBoolean​(@CheckForNull
                                  String expression)
        Resolves the given expression as boolean. Request's locale will be used.
        Parameters:
        expression - the expression to be resolved
        Returns:
        the resolved expression as a boolean, or null when expression is
      • getBoolean

        public boolean getBoolean​(@CheckForNull
                                  String expression,
                                  @Nonnull
                                  Locale locale)
        Resolves the given expression as boolean, with the given locale.
        Parameters:
        expression - the expression to be resolved
        locale - the locale
        Returns:
        the resolved expression as a boolean, or null when expression is
      • get

        public <T> T get​(@CheckForNull
                         String expression,
                         @Nonnull
                         Class<T> expectedType)
        Resolves the given expression. Request's locale will be used.
        Type Parameters:
        T - the type of the resolved expression
        Parameters:
        expression - the expression to be resolved
        expectedType - the expected type of the resolved expression
        Returns:
        the resolved expression, or null when expression is
      • get

        public <T> T get​(@CheckForNull
                         String expression,
                         @Nonnull
                         Locale locale,
                         @Nonnull
                         Class<T> expectedType)
        Resolves the given expression, with the given locale.
        Type Parameters:
        T - the type of the resolved expression
        Parameters:
        expression - the expression to be resolved
        locale - the locale
        expectedType - the expected type of the resolved expression
        Returns:
        the resolved expression, or null when expression is