|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjfun.yan.util.ClassDescriptor<T>
public class ClassDescriptor<T>
A descriptor class for all methods/fields/contructors of a class. Hash table is pre-built to speed up query.
throughout this class, public members are defined as members defined with "public" keyword and declared in a public type. public members declared by a non-public class is considered non-public because access to it from outside is prohibited by the java access control anyway.
public members defined in public classes are always prefered even when we allow private/protected members and types to be visible. So if a non-public subtype and a public super type both have a field with the same name, the field in the public super type is always used.
| Method Summary | |
|---|---|
java.lang.reflect.Method |
filterMethod(java.lang.String name,
MethodPredicate pred)
Get a public Method with a certain name and satisfies a certain predicate. |
java.lang.reflect.Method |
filterMethod(java.lang.String name,
MethodPredicate pred,
boolean suppress_security)
Get a Method with a certain name and satisfies a certain predicate. |
java.lang.reflect.Constructor<T> |
getConstructor()
Get the only one public constructor declared in the type. |
java.lang.reflect.Constructor<T> |
getConstructor(boolean suppress_security)
Get the only one constructor declared in the type. |
java.lang.reflect.Constructor<T> |
getConstructor(java.lang.Class[] param_types)
Get the public Constructor object identified by an array of parameter types. |
java.lang.reflect.Constructor<T> |
getConstructor(java.lang.Class[] param_types,
boolean suppress_security)
Get the Constructor object identified by an array of parameter types. |
java.lang.reflect.Constructor<T> |
getConstructor(int param_count)
Get the only one public constructor declared in the type. |
java.lang.reflect.Constructor<T> |
getConstructor(int param_count,
boolean suppress_security)
Get the only one constructor declared in the type. |
java.lang.reflect.Field |
getField(java.lang.String name)
Get the public Field object identified by name. |
java.lang.reflect.Field |
getField(java.lang.String name,
boolean suppress_security)
Get the Field object identified by name. |
java.lang.reflect.Method |
getMethod(java.lang.String name)
Get the public method with a certain name. |
java.lang.reflect.Method |
getMethod(java.lang.String name,
boolean suppress_security)
Get the method with a certain name. |
java.lang.reflect.Method |
getMethod(java.lang.String name,
java.lang.Class[] param_types)
Get the public method identified by a signature. |
java.lang.reflect.Method |
getMethod(java.lang.String name,
java.lang.Class[] param_types,
boolean suppress_security)
Get the method identified by a signature. |
java.lang.Class<T> |
getType()
Get the class object that this descriptor describes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public java.lang.reflect.Constructor<T> getConstructor(java.lang.Class[] param_types,
boolean suppress_security)
param_types - the parameter types.suppress_security - whether access to non-public constructor is allowed.
public java.lang.reflect.Constructor<T> getConstructor(java.lang.Class[] param_types)
param_types - the parameter types.
public java.lang.reflect.Constructor<T> getConstructor(boolean suppress_security)
throws AmbiguityException
suppress_security - whether access to non-public constructor is allowed.
AmbiguityException - if more than one constructor is found.
public java.lang.reflect.Constructor<T> getConstructor()
throws AmbiguityException
AmbiguityException - if more than one constructor is found.
public java.lang.reflect.Constructor<T> getConstructor(int param_count,
boolean suppress_security)
throws AmbiguityException
param_count - the number of formal parameters.suppress_security - whether access to non-public constructor is allowed.
AmbiguityException - if more than one constructor is found.
public java.lang.reflect.Constructor<T> getConstructor(int param_count)
throws AmbiguityException
param_count - the number of formal parameters.
AmbiguityException - if more than one constructor is found.
public java.lang.reflect.Method getMethod(java.lang.String name,
boolean suppress_security)
throws AmbiguityException
name - the method name.suppress_security - whether to look at non-public ones.
AmbiguityException - when more than one are found.
public java.lang.reflect.Method getMethod(java.lang.String name)
throws AmbiguityException
name - the method name.
AmbiguityException - when more than one are found.
public java.lang.reflect.Method filterMethod(java.lang.String name,
MethodPredicate pred)
throws AmbiguityException
name - the method name. the method name.pred - the predicate.
pred.toString() is used in the ambiguity exception error message.
AmbiguityException - when more than one qualified methods
are found.
public java.lang.reflect.Method filterMethod(java.lang.String name,
MethodPredicate pred,
boolean suppress_security)
throws AmbiguityException
name - the method name. the method name.pred - the predicate.
pred.toString() is used in the ambiguity exception error message.suppress_security - whether to look at non-public ones.
AmbiguityException - when more than one qualified methods
are found.
public java.lang.reflect.Method getMethod(java.lang.String name,
java.lang.Class[] param_types,
boolean suppress_security)
name - the method name.param_types - the formal parameter types.suppress_security - whether to look at non-public ones.
public java.lang.reflect.Method getMethod(java.lang.String name,
java.lang.Class[] param_types)
name - the method name.param_types - the formal parameter types.
public java.lang.reflect.Field getField(java.lang.String name,
boolean suppress_security)
name - the field name.suppress_security - whether to look at non-public ones.
public java.lang.reflect.Field getField(java.lang.String name)
name - the field name.
public java.lang.Class<T> getType()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||