|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnl.tudelft.simulation.language.reflection.ClassUtil
ClassUtil is a utility class providing assistance for Java Classes
(c) copyright 2003 Delft
University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: General Public
License (GPL) , no warranty
| Method Summary | |
static java.lang.reflect.Constructor[] |
getAllConstructors(java.lang.Class clazz,
java.lang.reflect.Constructor[] result)
gets all the constructors of a class and adds the result to result |
static java.lang.reflect.Method[] |
getAllMethods(java.lang.Class clazz,
java.lang.String name,
java.lang.reflect.Method[] result)
gets all the methods of a class and adds the result to result |
static java.lang.Class[] |
getClass(java.lang.Object[] array)
converts an array of objects to their corresponding classes |
static boolean |
isMoreSpecific(java.lang.Class[] a,
java.lang.Class[] b)
Determines & returns whether constructor 'a' is more specific than constructor 'b', as defined in the Java Language Specification §15.12. |
static boolean |
isMoreSpecific(java.lang.reflect.Constructor a,
java.lang.reflect.Constructor b)
Determines & returns whether constructor 'a' is more specific than constructor 'b', as defined in the Java Language Specification §15.12. |
static boolean |
isMoreSpecific(java.lang.reflect.Method a,
java.lang.reflect.Method b)
Determines & returns whether constructor 'a' is more specific than constructor 'b', as defined in the Java Language Specification §15.12. |
static boolean |
isVisible(java.lang.reflect.Constructor constructor,
java.lang.Class caller)
Returns whether a constructor is visible for a caller. |
static boolean |
isVisible(java.lang.reflect.Field field,
java.lang.Class caller)
Returns whether a field is visible for a caller. |
static boolean |
isVisible(int modifiers,
java.lang.Class declaringClass,
java.lang.Class caller)
Returns whether a declaringClass is accessible according to the modifiers |
static boolean |
isVisible(java.lang.reflect.Method method,
java.lang.Class caller)
Returns whether a method is visible for a caller. |
static java.lang.reflect.Constructor[] |
matchSignature(java.lang.reflect.Constructor[] constructors,
java.lang.Class[] argTypes)
Filters an array methods for signatures that are compatible with a given signature. |
static boolean |
matchSignature(java.lang.reflect.Constructor constructor,
java.lang.Class[] argTypes)
Filters an array methods for signatures that are compatible with a given signature. |
static java.lang.reflect.Method[] |
matchSignature(java.lang.reflect.Method[] methods,
java.lang.String name,
java.lang.Class[] argTypes)
Filters an array methods for signatures that are compatible with a given signature. |
static boolean |
matchSignature(java.lang.reflect.Method method,
java.lang.String name,
java.lang.Class[] argTypes)
Filters an array methods for signatures that are compatible with a given signature. |
static java.lang.reflect.Constructor |
resolveConstructor(java.lang.Class clazz,
java.lang.Class[] parameterTypes)
returns the interface method |
static java.lang.reflect.Constructor |
resolveConstructor(java.lang.Class clazz,
java.lang.Class callerClass,
java.lang.Class[] parameterTypes)
returns the interface method |
static java.lang.reflect.Constructor |
resolveConstructor(java.lang.Class clazz,
java.lang.Object[] arguments)
returns the constructor |
static java.lang.reflect.Field |
resolveField(java.lang.Class clazz,
java.lang.Class callerClass,
java.lang.String name)
returns the field |
static java.lang.reflect.Field |
resolveField(java.lang.Class clazz,
java.lang.String fieldName)
resolves the field for a class, taking into account inner classes |
static java.lang.reflect.Field |
resolveField(java.lang.Object object,
java.lang.String fieldName)
resolves the field for a given object instance |
static java.lang.reflect.Method |
resolveMethod(java.lang.Class clazz,
java.lang.Class callerClass,
java.lang.String name,
java.lang.Class[] parameterTypes)
returns the interface method |
static java.lang.reflect.Method |
resolveMethod(java.lang.Class clazz,
java.lang.String name,
java.lang.Class[] parameterTypes)
returns the interface method |
static java.lang.reflect.Method |
resolveMethod(java.lang.Object object,
java.lang.String name,
java.lang.Class[] parameterTypes)
resolves a method the method |
static java.lang.reflect.Method |
resolveMethod(java.lang.Object object,
java.lang.String name,
java.lang.Object[] arguments)
returns the method |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static java.lang.reflect.Constructor[] getAllConstructors(java.lang.Class clazz,
java.lang.reflect.Constructor[] result)
clazz - the classresult - the resulting set
public static java.lang.reflect.Constructor resolveConstructor(java.lang.Class clazz,
java.lang.Class callerClass,
java.lang.Class[] parameterTypes)
throws java.lang.NoSuchMethodException
clazz - the class to start withcallerClass - the calling classparameterTypes - the parameterTypes
java.lang.NoSuchMethodException - if the method cannot be resolved
public static java.lang.reflect.Constructor resolveConstructor(java.lang.Class clazz,
java.lang.Class[] parameterTypes)
throws java.lang.NoSuchMethodException
clazz - the class to start withparameterTypes - the parameterTypes
java.lang.NoSuchMethodException - if the method cannot be resolved
public static java.lang.reflect.Constructor resolveConstructor(java.lang.Class clazz,
java.lang.Object[] arguments)
throws java.lang.NoSuchMethodException
clazz - the clazz to start witharguments - the arguments
java.lang.NoSuchMethodException - on lookup failure
public static java.lang.reflect.Field resolveField(java.lang.Class clazz,
java.lang.String fieldName)
throws java.lang.NoSuchFieldException
clazz - the class to resolve the field for, including inner classesfieldName - name of the field
java.lang.NoSuchFieldException - on no such field
public static java.lang.reflect.Field resolveField(java.lang.Class clazz,
java.lang.Class callerClass,
java.lang.String name)
throws java.lang.NoSuchFieldException
clazz - the class to start withcallerClass - the calling classname - the fieldName
java.lang.NoSuchFieldException - if the method cannot be resolved
public static java.lang.reflect.Field resolveField(java.lang.Object object,
java.lang.String fieldName)
throws java.lang.NoSuchFieldException
object - the object to resolve the field forfieldName - name of the field to resolve
java.lang.NoSuchFieldException - if the field cannot be resolved
public static java.lang.reflect.Method[] getAllMethods(java.lang.Class clazz,
java.lang.String name,
java.lang.reflect.Method[] result)
clazz - the classname - the name of the methodresult - the resulting set
public static java.lang.reflect.Method resolveMethod(java.lang.Class clazz,
java.lang.Class callerClass,
java.lang.String name,
java.lang.Class[] parameterTypes)
throws java.lang.NoSuchMethodException
clazz - the class to start withcallerClass - the caller classname - the name of the methodparameterTypes - the parameterTypes
java.lang.NoSuchMethodException - on lookup failure
public static java.lang.reflect.Method resolveMethod(java.lang.Class clazz,
java.lang.String name,
java.lang.Class[] parameterTypes)
throws java.lang.NoSuchMethodException
clazz - the class to start withname - the name of the methodparameterTypes - the parameterTypes
java.lang.NoSuchMethodException - on lookup failure
public static java.lang.reflect.Method resolveMethod(java.lang.Object object,
java.lang.String name,
java.lang.Class[] parameterTypes)
throws java.lang.NoSuchMethodException
object - the object to start withname - the name of the methodparameterTypes - the parameterTypes
java.lang.NoSuchMethodException - on lookup failure
public static java.lang.reflect.Method resolveMethod(java.lang.Object object,
java.lang.String name,
java.lang.Object[] arguments)
throws java.lang.NoSuchMethodException
object - the object to start withname - the name of the methodarguments - the arguments
java.lang.NoSuchMethodException - on lookup failure
public static boolean isVisible(int modifiers,
java.lang.Class declaringClass,
java.lang.Class caller)
modifiers - the modifiersdeclaringClass - the declaringClasscaller - the caller
public static boolean isMoreSpecific(java.lang.Class[] a,
java.lang.Class[] b)
a - reflects the first constructorb - reflects the second constructor
public static boolean isMoreSpecific(java.lang.reflect.Constructor a,
java.lang.reflect.Constructor b)
a - reflects the first constructorb - reflects the second constructor
public static boolean isMoreSpecific(java.lang.reflect.Method a,
java.lang.reflect.Method b)
a - reflects the first methodb - reflects the second method
public static boolean isVisible(java.lang.reflect.Field field,
java.lang.Class caller)
field - The fieldcaller - The class of the caller for whom invocation visibility is
checked.
public static boolean isVisible(java.lang.reflect.Constructor constructor,
java.lang.Class caller)
constructor - The constructorcaller - The class of the caller for whom invocation visibility is
checked.
public static boolean isVisible(java.lang.reflect.Method method,
java.lang.Class caller)
method - The methodcaller - The class of the caller for whom invocation visibility is
checked.
public static java.lang.reflect.Method[] matchSignature(java.lang.reflect.Method[] methods,
java.lang.String name,
java.lang.Class[] argTypes)
methods - which are methods to be filtered.name - reflects the method's name, part of the signatureargTypes - are the method's argument types
public static boolean matchSignature(java.lang.reflect.Method method,
java.lang.String name,
java.lang.Class[] argTypes)
method - The method to be filtered.name - reflects the method's name, part of the signatureargTypes - are the method's argument types
public static boolean matchSignature(java.lang.reflect.Constructor constructor,
java.lang.Class[] argTypes)
constructor - which are constructors to be filtered.argTypes - are the constructor's argument types
public static java.lang.reflect.Constructor[] matchSignature(java.lang.reflect.Constructor[] constructors,
java.lang.Class[] argTypes)
constructors - which are constructors to be filtered.argTypes - are the constructor's argument types
public static java.lang.Class[] getClass(java.lang.Object[] array)
array - the array to invoke
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||