abstract class MemberUtils
extends java.lang.Object
MethodUtils
when it was imported from Commons
BeanUtils.Modifier and Type | Field and Description |
---|---|
private static int |
ACCESS_TEST |
private static java.lang.reflect.Method |
IS_SYNTHETIC |
private static java.lang.Class[] |
ORDERED_PRIMITIVE_TYPES
Array of primitive number types ordered by "promotability"
|
Constructor and Description |
---|
MemberUtils() |
Modifier and Type | Method and Description |
---|---|
(package private) static int |
compareParameterTypes(java.lang.Class[] left,
java.lang.Class[] right,
java.lang.Class[] actual)
Compare the relative fitness of two sets of parameter types in terms of
matching a third set of runtime parameter types, such that a list ordered
by the results of the comparison would return the best match first
(least).
|
private static float |
getObjectTransformationCost(java.lang.Class srcClass,
java.lang.Class destClass)
Gets the number of steps required needed to turn the source class into
the destination class.
|
private static float |
getPrimitivePromotionCost(java.lang.Class srcClass,
java.lang.Class destClass)
Get the number of steps required to promote a primitive number to another
type.
|
private static float |
getTotalTransformationCost(java.lang.Class[] srcArgs,
java.lang.Class[] destArgs)
Returns the sum of the object transformation cost for each class in the
source argument list.
|
(package private) static boolean |
isAccessible(java.lang.reflect.Member m)
Check a Member for basic accessibility.
|
(package private) static boolean |
isPackageAccess(int modifiers)
Learn whether a given set of modifiers implies package access.
|
(package private) static boolean |
isSynthetic(java.lang.reflect.Member m)
Try to learn whether a given member, on JDK >= 1.5, is synthetic.
|
(package private) static void |
setAccessibleWorkaround(java.lang.reflect.AccessibleObject o)
XXX Default access superclass workaround
When a public class has a default access superclass with public members,
these members are accessible.
|
private static final int ACCESS_TEST
private static final java.lang.reflect.Method IS_SYNTHETIC
private static final java.lang.Class[] ORDERED_PRIMITIVE_TYPES
static void setAccessibleWorkaround(java.lang.reflect.AccessibleObject o)
o
- the AccessibleObject to set as accessiblestatic boolean isPackageAccess(int modifiers)
modifiers
- to teststatic boolean isAccessible(java.lang.reflect.Member m)
m
- Member to checkm
is accessiblestatic boolean isSynthetic(java.lang.reflect.Member m)
m
- Member to checkm
was introduced by the compiler.static int compareParameterTypes(java.lang.Class[] left, java.lang.Class[] right, java.lang.Class[] actual)
left
- the "left" parameter setright
- the "right" parameter setactual
- the runtime parameter types to match against
left
/right
compare
semanticsprivate static float getTotalTransformationCost(java.lang.Class[] srcArgs, java.lang.Class[] destArgs)
srcArgs
- The source argumentsdestArgs
- The destination argumentsprivate static float getObjectTransformationCost(java.lang.Class srcClass, java.lang.Class destClass)
srcClass
- The source classdestClass
- The destination classprivate static float getPrimitivePromotionCost(java.lang.Class srcClass, java.lang.Class destClass)
srcClass
- the (primitive) source classdestClass
- the (primitive) destination class