|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.ClassCache<T>
class ClassCache<T>
Cache of per-class data, meant to help the performance of reflection methods.
Note: None of the methods perform access checks. It is up to the (package internal) clients of this code to perform such checks as necessary.
Also Note: None of the returned array values are protected in any way. It is up to the (again, package internal) clients of this code to protect the arrays if they should ever escape the package.
| Field Summary | |
|---|---|
(package private) static org.apache.harmony.kernel.vm.ReflectionAccess |
REFLECT
non-null; reflection access bridge |
| Constructor Summary | |
|---|---|
ClassCache(Class<T> clazz)
Constructs an instance. |
|
| Method Summary | |
|---|---|
static boolean |
compareClassLists(Class<?>[] a,
Class<?>[] b)
Compares two class lists for equality. |
static Method[] |
deepCopy(Method[] orig)
Makes a deep copy of the given array of methods. |
Method[] |
getAllMethods()
Gets the list of all methods, both directly declared and inherited. |
Method[] |
getAllPublicMethods()
Gets the list of all public methods, both directly declared and inherited. |
Method[] |
getDeclaredMethods()
Gets the list of all declared methods. |
Method[] |
getDeclaredMethods(boolean publicOnly)
Gets either the list of declared methods or the list of declared public methods. |
Method[] |
getDeclaredPublicMethods()
Gets the list of all declared public methods. |
T |
getEnumValue(String name)
Gets the enumerated value with a given name. |
T[] |
getEnumValuesByName()
Gets the array of enumerated values, sorted by name. |
T[] |
getEnumValuesInOrder()
Gets the array of enumerated values, in their original declared order. |
static Method |
getMatchingMethod(Method[] list,
String name,
Class<?>[] parameterTypes)
Finds and returns a method with a given name and signature. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
static final org.apache.harmony.kernel.vm.ReflectionAccess REFLECT
| Constructor Detail |
|---|
ClassCache(Class<T> clazz)
clazz - non-null; class that this instance represents| Method Detail |
|---|
public Method[] getDeclaredMethods()
public Method[] getDeclaredPublicMethods()
public Method[] getDeclaredMethods(boolean publicOnly)
publicOnly - whether to only return public methodspublic Method[] getAllMethods()
public Method[] getAllPublicMethods()
public static Method getMatchingMethod(Method[] list,
String name,
Class<?>[] parameterTypes)
throws NoSuchMethodException
list - non-null; the list of methods to search throughparameterTypes - non-null; the formal parameter list
NoSuchMethodExcpetion - thrown if the method does not exist
NoSuchMethodException
public static boolean compareClassLists(Class<?>[] a,
Class<?>[] b)
null lists are considered equal. This is useful
for matching methods and constructors.
TODO: Take into account assignment compatibility?
a - null-ok; the first list of typesb - null-ok; the second list of types
public static Method[] deepCopy(Method[] orig)
Note: In such cases, it is insufficient to just make
a shallow copy of the array, since method objects aren't
immutable due to the existence of AccessibleObject.setAccessible(java.lang.reflect.AccessibleObject[], boolean).
orig - non-null; array to copy
public T getEnumValue(String name)
name - non-null; name of the value
null
if this instance's class doesn't have such a value (including
if this instance isn't in fact an enumeration)public T[] getEnumValuesByName()
null if this
instance's class isn't in fact an enumerationpublic T[] getEnumValuesInOrder()
null if this
instance's class isn't in fact an enumeration
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||