Class ClassReflectionIndex
- java.lang.Object
-
- org.jboss.as.server.deployment.reflect.ClassReflectionIndex
-
public final class ClassReflectionIndex extends Object
A short-lived index of all the declared fields and methods of a class. The ClassReflectionIndex is only available during the deployment.- Author:
- David M. Lloyd
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<Method>getAllMethods(String name)Get a collection of methods declared on this object by method name.Collection<Method>getAllMethods(String name, int paramCount)Get a collection of methods declared on this object by method name and parameter count.Set<Method>getClassMethods()Constructor<?>getConstructor(Class<?>... paramTypes)Get a constructor declared on this class.Constructor<?>getConstructor(String... paramTypeNames)Get a constructor declared on this class.Collection<Constructor<?>>getConstructors()Get the full collection of constructors declared on this object.FieldgetField(String name)Get a field declared on this object.Collection<Field>getFields()Get a collection of fields declared on this object.Class<?>getIndexedClass()Get the class indexed by this object.MethodgetMethod(Class<?> returnType, String name, Class<?>... paramTypes)Get a method declared on this object.MethodgetMethod(Method method)Get the canonical method declared on this object.MethodgetMethod(String returnType, String name, String... paramTypeNames)Get a method declared on this object.MethodgetMethod(org.jboss.invocation.proxy.MethodIdentifier methodIdentifier)Get a method declared on this object.Collection<Method>getMethods()Get a collection of methods declared on this object.Collection<Method>getMethods(String name, Class<?>... paramTypes)Get a collection of methods declared on this object.Collection<Method>getMethods(String name, String... paramTypeNames)Get a collection of methods declared on this object.
-
-
-
Method Detail
-
getIndexedClass
public Class<?> getIndexedClass()
Get the class indexed by this object.- Returns:
- the class
-
getField
public Field getField(String name)
Get a field declared on this object.- Parameters:
name- the field name- Returns:
- the field, or
nullif no field of that name exists
-
getFields
public Collection<Field> getFields()
Get a collection of fields declared on this object.- Returns:
- The (possibly empty) collection of all declared fields on this object
-
getMethod
public Method getMethod(Class<?> returnType, String name, Class<?>... paramTypes)
Get a method declared on this object.- Parameters:
returnType- the method return typename- the name of the methodparamTypes- the parameter types of the method- Returns:
- the method, or
nullif no method of that description exists
-
getMethod
public Method getMethod(Method method)
Get the canonical method declared on this object.- Parameters:
method- the method to look up- Returns:
- the canonical method object, or
nullif no matching method exists
-
getMethod
public Method getMethod(String returnType, String name, String... paramTypeNames)
Get a method declared on this object.- Parameters:
returnType- the method return type namename- the name of the methodparamTypeNames- the parameter type names of the method- Returns:
- the method, or
nullif no method of that description exists
-
getMethod
public Method getMethod(org.jboss.invocation.proxy.MethodIdentifier methodIdentifier)
Get a method declared on this object.- Parameters:
methodIdentifier- the method identifier- Returns:
- the method, or
nullif no method of that description exists
-
getMethods
public Collection<Method> getMethods(String name, Class<?>... paramTypes)
Get a collection of methods declared on this object.- Parameters:
name- the name of the methodparamTypes- the parameter types of the method- Returns:
- the (possibly empty) collection of methods matching the description
-
getMethods
public Collection<Method> getMethods(String name, String... paramTypeNames)
Get a collection of methods declared on this object.- Parameters:
name- the name of the methodparamTypeNames- the parameter type names of the method- Returns:
- the (possibly empty) collection of methods matching the description
-
getAllMethods
public Collection<Method> getAllMethods(String name)
Get a collection of methods declared on this object by method name.- Parameters:
name- the name of the method- Returns:
- the (possibly empty) collection of methods with the given name
-
getAllMethods
public Collection<Method> getAllMethods(String name, int paramCount)
Get a collection of methods declared on this object by method name and parameter count.- Parameters:
name- the name of the methodparamCount- the number of parameters- Returns:
- the (possibly empty) collection of methods with the given name and parameter count
-
getMethods
public Collection<Method> getMethods()
Get a collection of methods declared on this object.- Returns:
- the (possibly empty) collection of all declared methods
-
getConstructors
public Collection<Constructor<?>> getConstructors()
Get the full collection of constructors declared on this object.- Returns:
- the constructors
-
getConstructor
public Constructor<?> getConstructor(Class<?>... paramTypes)
Get a constructor declared on this class.- Parameters:
paramTypes- the constructor argument types- Returns:
- the constructor, or
nullof no such constructor exists
-
getConstructor
public Constructor<?> getConstructor(String... paramTypeNames)
Get a constructor declared on this class.- Parameters:
paramTypeNames- the constructor argument type names- Returns:
- the constructor, or
nullof no such constructor exists
-
-