Top Description Inners Fields Constructors Methods
com.sun.el.util

public Class ReflectionUtil

extends Object
Class Inheritance
Imports
java.beans.IntrospectionException, .Introspector, .PropertyDescriptor, java.lang.reflect.Array, .Constructor, .InvocationTargetException, .Method, .Modifier, java.util.ArrayList, .Arrays, .Iterator, .List, javax.el.ELContext, .ELException, .MethodNotFoundException, .PropertyNotFoundException, com.sun.el.lang.ELSupport

Utilities for Managing Serialization and Reflection
Author
Jacob Hookom [[email protected]]
Version
$Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: kchung $

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
protected static final String[]
protected static final String[]
protected static final Class<T>[]

Constructor Summary

AccessConstructor and Description
private

Method Summary

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

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

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

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

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

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

public static PropertyDescriptor

Returns:

The PropertyDescriptor for the base with the given property
getPropertyDescriptor
(Object
The base object
base
,
Object
The property
property
)

private static Class<?>[]
public static Object
invokeMethod(ELContext context, Method m, 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(ReflectionUtil.Wrapper wrapper1, ReflectionUtil.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)

public static Class<T>[]

Returns:

The array of Classes
toTypeArray
(String[] s)

Converts an array of Class names to Class types

public static String[]

Returns:

The array of Classes
toTypeNameArray
(Class<T>[] c)

Converts an array of Class types to Class names

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EMPTY_STRINGback to summary
protected static final String[] EMPTY_STRING
PRIMITIVE_NAMESback to summary
protected static final String[] PRIMITIVE_NAMES
PRIMITIVESback to summary
protected static final Class<T>[] PRIMITIVES

Constructor Detail

ReflectionUtilback to summary
private ReflectionUtil()

Method Detail

buildParametersback to summary
pack-priv static Object[] buildParameters(ELContext context, Class<?>[] parameterTypes, boolean isVarArgs, Object[] params)
findMethodback to summary
public static Method findMethod(Class<?> clazz, String methodName, Class<?>[] paramTypes, Object[] paramValues)
findMostSpecificWrapperback to summary
private static ReflectionUtil.Wrapper findMostSpecificWrapper(List<ReflectionUtil.Wrapper> candidates, Class<?>[] matchingTypes, boolean elSpecific, String errorMsg)
findWrapperback to summary
private static ReflectionUtil.Wrapper findWrapper(Class<?> clazz, List<ReflectionUtil.Wrapper> wrappers, String name, Class<?>[] paramTypes, Object[] paramValues)
forNameback to summary
public static Class<T> forName(String name) throws ClassNotFoundException
forNamePrimitiveback to summary
protected static Class<T> forNamePrimitive(String name)
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)
getMethodback to summary
pack-priv static Method getMethod(Class<?> type, Method m)
getPropertyDescriptorback to summary
public static PropertyDescriptor getPropertyDescriptor(Object base, Object property) throws ELException, PropertyNotFoundException
Parameters
base:Object

The base object

property:Object

The property

Returns:PropertyDescriptor

The PropertyDescriptor for the base with the given property

getTypesFromValuesback to summary
private static Class<?>[] getTypesFromValues(Object[] values)
invokeMethodback to summary
public static Object invokeMethod(ELContext context, Method m, 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(ReflectionUtil.Wrapper wrapper1, ReflectionUtil.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)
toTypeArrayback to summary
public static Class<T>[] toTypeArray(String[] s) throws ClassNotFoundException

Converts an array of Class names to Class types

Returns:Class<T>[]

The array of Classes

toTypeNameArrayback to summary
public static String[] toTypeNameArray(Class<T>[] c)

Converts an array of Class types to Class names

Returns:String[]

The array of Classes

com.sun.el.util back to summary

private Class ReflectionUtil.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 com.sun.el.util.ReflectionUtil.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 com.sun.el.util.ReflectionUtil.Wrapper.getParameterTypes.

Annotations
@Override
isBridgeback to summary
public boolean isBridge()

Implements abstract com.sun.el.util.ReflectionUtil.Wrapper.isBridge.

Annotations
@Override
isVarArgsback to summary
public boolean isVarArgs()

Implements abstract com.sun.el.util.ReflectionUtil.Wrapper.isVarArgs.

Annotations
@Override
unWrapback to summary
public Object unWrap()

Implements abstract com.sun.el.util.ReflectionUtil.Wrapper.unWrap.

Annotations
@Override
com.sun.el.util back to summary

private Class ReflectionUtil.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 com.sun.el.util.ReflectionUtil.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 com.sun.el.util.ReflectionUtil.Wrapper.getParameterTypes.

Annotations
@Override
isBridgeback to summary
public boolean isBridge()

Implements abstract com.sun.el.util.ReflectionUtil.Wrapper.isBridge.

Annotations
@Override
isVarArgsback to summary
public boolean isVarArgs()

Implements abstract com.sun.el.util.ReflectionUtil.Wrapper.isVarArgs.

Annotations
@Override
unWrapback to summary
public Object unWrap()

Implements abstract com.sun.el.util.ReflectionUtil.Wrapper.unWrap.

Annotations
@Override
com.sun.el.util back to summary

private abstract Class ReflectionUtil.Wrapper

extends Object
Class Inheritance
Known Direct Subclasses
com.sun.el.util.ReflectionUtil.MethodWrapper, com.sun.el.util.ReflectionUtil.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<ReflectionUtil.Wrapper>
wrap(Method[] methods, String name)

public static List<ReflectionUtil.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<ReflectionUtil.Wrapper> wrap(Method[] methods, String name)
wrapback to summary
public static List<ReflectionUtil.Wrapper> wrap(Constructor<?>[] constructors)