Package jakarta.el

Class ELUtil

java.lang.Object
jakarta.el.ELUtil

class ELUtil extends Object
Utility methods for this portion of the Jakarta Expression Language implementation

Methods on this class use a Map instance stored in ThreadLocal storage to minimize the performance impact on operations that take place multiple times on a single Thread. The keys and values of the Map are implementation private.

  • Field Details

  • Constructor Details

    • ELUtil

      private ELUtil()
      This class may not be constructed.
  • Method Details

    • getCurrentInstance

      private static Map<String,ResourceBundle> getCurrentInstance()
      Returns:
      a Map stored in ThreadLocal storage. This may be used by methods of this class to minimize the performance impact for operations that may take place multiple times on a given Thread instance.
    • setCurrentInstance

      private static void setCurrentInstance(Map<String,ResourceBundle> context)
      Replace the Map with the argument context.
      Parameters:
      context - the Map to be stored in ThreadLocal storage.
    • getExceptionMessageString

      public static String getExceptionMessageString(ELContext context, String messageId)
      Convenience method, calls through to getExceptionMessageString(ELContext,java.lang.String,Object []).
      Parameters:
      context - the ELContext from which the Locale for this message is extracted.
      messageId - the messageId String in the ResourceBundle
      Returns:
      a localized String for the argument messageId
    • getExceptionMessageString

      public static String getExceptionMessageString(ELContext context, String messageId, Object[] params)
    • getExpressionFactory

      static ExpressionFactory getExpressionFactory()
    • findConstructor

      static Constructor<?> findConstructor(Class<?> klass, Class<?>[] paramTypes, Object[] params)
    • invokeConstructor

      static Object invokeConstructor(ELContext context, Constructor<?> constructor, Object[] params)
    • findMethod

      static Method findMethod(Class<?> klass, String methodName, Class<?>[] paramTypes, Object[] params, boolean staticOnly)
    • invokeMethod

      static Object invokeMethod(ELContext context, Method method, Object base, Object[] params)
    • findMethod

      static Method findMethod(Class<?> clazz, String methodName, Class<?>[] paramTypes, Object[] paramValues)
    • findWrapper

      private static ELUtil.Wrapper findWrapper(Class<?> clazz, List<ELUtil.Wrapper> wrappers, String name, Class<?>[] paramTypes, Object[] paramValues)
    • findMostSpecificWrapper

      private static ELUtil.Wrapper findMostSpecificWrapper(List<ELUtil.Wrapper> candidates, Class<?>[] matchingTypes, boolean elSpecific, String errorMsg)
    • isMoreSpecific

      private static int isMoreSpecific(ELUtil.Wrapper wrapper1, ELUtil.Wrapper wrapper2, Class<?>[] matchingTypes, boolean elSpecific)
    • isMoreSpecific

      private static int isMoreSpecific(Class<?> type1, Class<?> type2, Class<?> matchingType, boolean elSpecific)
    • getBoxingTypeIfPrimitive

      private static Class<?> getBoxingTypeIfPrimitive(Class<?> clazz)
    • getComparingParamTypesForVarArgsMethod

      private static Class<?>[] getComparingParamTypesForVarArgsMethod(Class<?>[] paramTypes, int length)
    • paramString

      private static final String paramString(Class<?>[] types)
    • isAssignableFrom

      static boolean isAssignableFrom(Class<?> src, Class<?> target)
    • isCoercibleFrom

      private static boolean isCoercibleFrom(Object src, Class<?> target)
    • getTypesFromValues

      private static Class<?>[] getTypesFromValues(Object[] values)
    • getMethod

      static Method getMethod(Class<?> type, Method m)
    • getConstructor

      static Constructor<?> getConstructor(Class<?> type, Constructor<?> c)
    • buildParameters

      static Object[] buildParameters(ELContext context, Class<?>[] parameterTypes, boolean isVarArgs, Object[] params)