Top Description Inners Fields Constructors Methods
jakarta.el

pack-priv Class ELUtil

extends Object
Class Inheritance
Imports
java.lang.reflect.AccessibleObject, .Array, .Constructor, .InvocationTargetException, .Method, .Modifier, java.text.MessageFormat, java.util.ArrayList, .HashMap, .Iterator, .List, .Locale, .Map, .MissingResourceException, .ResourceBundle

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.

Authors
edburns, Kin-man Chung, Dongbin Nie

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
private abstract static class

Field Summary

Modifier and TypeField and Description
private static ThreadLocal<Map<String, ResourceBundle>>
instance

The ThreadLocal variable used to record the jakarta.faces.context.FacesContext instance for each processing thread.

Constructor Summary

AccessConstructor and Description
private
ELUtil()

This class may not be constructed.

Method Summary

Modifier and TypeMethod and Description
pack-priv static Object[]
buildParameters(ELContext context, Class<?>[] parameterTypes, boolean isVarArgs, Object[] params)

pack-priv static boolean
canAccess(Object base, AccessibleObject accessibleObject)

pack-priv static Constructor<?>
findConstructor(Class<?> klass, Class<?>[] paramTypes, Object[] params)

pack-priv static Method
findMethod(Class<?> klass, Object base, String methodName, Class<?>[] paramTypes, Object[] params, boolean staticOnly)

pack-priv static Method
findMethod(Class<?> clazz, Object base, String methodName, Class<?>[] paramTypes, Object[] paramValues)

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

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

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

pack-priv static Constructor<?>
private static Map<String, ResourceBundle>

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.
getCurrentInstance
()

public static String

Returns:

a localized String for the argument messageId
getExceptionMessageString
(ELContext
the ELContext from which the Locale for this message is extracted.
context
,
String
the messageId String in the ResourceBundle
messageId
)

Convenience method, calls through to getExceptionMessageString(ELContext,java.lang.String,Object []).

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

pack-priv static Method
getMethod(Class<?> type, Object base, Method m)

private static Class<?>[]
pack-priv static Object
invokeConstructor(ELContext context, Constructor<?> constructor, Object[] params)

pack-priv static Object
invokeMethod(ELContext context, Method method, Object base, Object[] params)

pack-priv static boolean
isAssignableFrom(Class<?> src, Class<?> target)

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

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

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

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

private static void
setCurrentInstance(Map<String, ResourceBundle>
the Map to be stored in ThreadLocal storage.
context
)

Replace the Map with the argument context.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

instanceback to summary
private static ThreadLocal<Map<String, ResourceBundle>> instance

The ThreadLocal variable used to record the jakarta.faces.context.FacesContext instance for each processing thread.

Constructor Detail

ELUtilback to summary
private ELUtil()

This class may not be constructed.

Method Detail

buildParametersback to summary
pack-priv static Object[] buildParameters(ELContext context, Class<?>[] parameterTypes, boolean isVarArgs, Object[] params)
Annotations
@SuppressWarnings:null
canAccessback to summary
pack-priv static boolean canAccess(Object base, AccessibleObject accessibleObject)
findConstructorback to summary
pack-priv static Constructor<?> findConstructor(Class<?> klass, Class<?>[] paramTypes, Object[] params)
findMethodback to summary
pack-priv static Method findMethod(Class<?> klass, Object base, String methodName, Class<?>[] paramTypes, Object[] params, boolean staticOnly)
findMethodback to summary
pack-priv static Method findMethod(Class<?> clazz, Object base, String methodName, Class<?>[] paramTypes, Object[] paramValues)
findMostSpecificWrapperback to summary
private static ELUtil.Wrapper findMostSpecificWrapper(List<ELUtil.Wrapper> candidates, Class<?>[] matchingTypes, boolean elSpecific, String errorMsg)
findWrapperback to summary
private static ELUtil.Wrapper findWrapper(Class<?> clazz, List<ELUtil.Wrapper> wrappers, String name, Class<?>[] paramTypes, Object[] paramValues)
Annotations
@SuppressWarnings:null
getBoxingTypeIfPrimitiveback to summary
private static Class<?> getBoxingTypeIfPrimitive(Class<?> clazz)
getComparingParamTypesForVarArgsMethodback to summary
private static Class<?>[] getComparingParamTypesForVarArgsMethod(Class<?>[] paramTypes, int length)
getConstructorback to summary
pack-priv static Constructor<?> getConstructor(Class<?> type, Constructor<?> c)
getCurrentInstanceback to summary
private static Map<String, ResourceBundle> getCurrentInstance()
Returns:Map<String, ResourceBundle>

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.

getExceptionMessageStringback to summary
public static String getExceptionMessageString(ELContext context, String messageId)

Convenience method, calls through to getExceptionMessageString(ELContext,java.lang.String,Object []).

Parameters
context:ELContext

the ELContext from which the Locale for this message is extracted.

messageId:String

the messageId String in the ResourceBundle

Returns:String

a localized String for the argument messageId

getExceptionMessageStringback to summary
public static String getExceptionMessageString(ELContext context, String messageId, Object[] params)
getMethodback to summary
pack-priv static Method getMethod(Class<?> type, Object base, Method m)
getTypesFromValuesback to summary
private static Class<?>[] getTypesFromValues(Object[] values)
invokeConstructorback to summary
pack-priv static Object invokeConstructor(ELContext context, Constructor<?> constructor, Object[] params)
invokeMethodback to summary
pack-priv static Object invokeMethod(ELContext context, Method method, Object base, Object[] params)
isAssignableFromback to summary
pack-priv static boolean isAssignableFrom(Class<?> src, Class<?> target)
isCoercibleFromback to summary
private static boolean isCoercibleFrom(Object src, Class<?> target)
isMoreSpecificback to summary
private static int isMoreSpecific(ELUtil.Wrapper wrapper1, ELUtil.Wrapper wrapper2, Class<?>[] matchingTypes, boolean elSpecific)
isMoreSpecificback to summary
private static int isMoreSpecific(Class<?> type1, Class<?> type2, Class<?> matchingType, boolean elSpecific)
paramStringback to summary
private static final String paramString(Class<?>[] types)
setCurrentInstanceback to summary
private static void setCurrentInstance(Map<String, ResourceBundle> context)

Replace the Map with the argument context.

Parameters
context:Map<String, ResourceBundle>

the Map to be stored in ThreadLocal storage.

jakarta.el back to summary

private Class ELUtil.ConstructorWrapper

extends Wrapper
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final Constructor<?>
c

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Class<?>[]
public boolean
public boolean
public Object
Inherited from jakarta.el.ELUtil.Wrapper:
wrapwrap

Field Detail

cback to summary
private final Constructor<?> c

Constructor Detail

ConstructorWrapperback to summary
public ConstructorWrapper(Constructor<?> c)

Method Detail

getParameterTypesback to summary
public Class<?>[] getParameterTypes()

Implements abstract jakarta.el.ELUtil.Wrapper.getParameterTypes.

Annotations
@Override
isBridgeback to summary
public boolean isBridge()

Implements abstract jakarta.el.ELUtil.Wrapper.isBridge.

Annotations
@Override
isVarArgsback to summary
public boolean isVarArgs()

Implements abstract jakarta.el.ELUtil.Wrapper.isVarArgs.

Annotations
@Override
unWrapback to summary
public Object unWrap()

Implements abstract jakarta.el.ELUtil.Wrapper.unWrap.

Annotations
@Override
jakarta.el back to summary

private Class ELUtil.MethodWrapper

extends Wrapper
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final Method
m

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Class<?>[]
public boolean
public boolean
public Object
Inherited from jakarta.el.ELUtil.Wrapper:
wrapwrap

Field Detail

mback to summary
private final Method m

Constructor Detail

MethodWrapperback to summary
public MethodWrapper(Method m)

Method Detail

getParameterTypesback to summary
public Class<?>[] getParameterTypes()

Implements abstract jakarta.el.ELUtil.Wrapper.getParameterTypes.

Annotations
@Override
isBridgeback to summary
public boolean isBridge()

Implements abstract jakarta.el.ELUtil.Wrapper.isBridge.

Annotations
@Override
isVarArgsback to summary
public boolean isVarArgs()

Implements abstract jakarta.el.ELUtil.Wrapper.isVarArgs.

Annotations
@Override
unWrapback to summary
public Object unWrap()

Implements abstract jakarta.el.ELUtil.Wrapper.unWrap.

Annotations
@Override
jakarta.el back to summary

private abstract Class ELUtil.Wrapper

extends Object
Class Inheritance
Known Direct Subclasses
jakarta.el.ELUtil.MethodWrapper, jakarta.el.ELUtil.ConstructorWrapper

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public abstract Class<?>[]
public abstract boolean
public abstract boolean
public abstract Object
public static List<ELUtil.Wrapper>
wrap(Method[] methods, String name)

public static List<ELUtil.Wrapper>
wrap(Constructor<?>[] constructors)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Wrapperback to summary
private Wrapper()

Method Detail

getParameterTypesback to summary
public abstract Class<?>[] getParameterTypes()
isBridgeback to summary
public abstract boolean isBridge()
isVarArgsback to summary
public abstract boolean isVarArgs()
unWrapback to summary
public abstract Object unWrap()
wrapback to summary
public static List<ELUtil.Wrapper> wrap(Method[] methods, String name)
wrapback to summary
public static List<ELUtil.Wrapper> wrap(Constructor<?>[] constructors)