public abstract class ExecutableInfo extends Object
ConstructorInfo
and MethodInfo
.Modifier | Constructor and Description |
---|---|
protected |
ExecutableInfo(ClassInfo declaringClass,
Executable e,
Executable re)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
ExecutableInfo |
accessible()
Attempts to call
x.setAccessible( and quietly ignores security exceptions. |
int |
fuzzyArgsMatch(Class<?>... argTypes)
Returns how well this method matches the specified arg types.
|
int |
fuzzyArgsMatch(ClassInfo... argTypes)
Returns how well this method matches the specified arg types.
|
ClassInfo |
getDeclaringClass()
Returns metadata about the class that declared this method or constructor.
|
List<ClassInfo> |
getExceptionTypes()
Returns the exception types on this executable.
|
String |
getFullName()
Returns the full name of this executable.
|
ParamInfo |
getParam(int index)
Returns parameter information at the specified index.
|
int |
getParamCount()
Returns the number of parameters in this executable.
|
Annotation[][] |
getParameterAnnotations()
Returns the parameter annotations on this executable.
|
Annotation[] |
getParameterAnnotations(int index)
Returns the parameter annotations on the parameter at the specified index.
|
List<ParamInfo> |
getParams()
Returns the parameters defined on this executable.
|
ClassInfo |
getParamType(int index)
Returns the parameter type of the parameter at the specified index.
|
List<ClassInfo> |
getParamTypes()
Returns the parameter types on this executable.
|
Class<?>[] |
getRawExceptionTypes()
Returns the raw exception types on this executable.
|
Type |
getRawGenericParamType(int index)
Returns the raw generic parameter type of the parameter at the specified index.
|
List<Type> |
getRawGenericParamTypes()
Returns the raw generic parameter types on this executable.
|
Parameter |
getRawParameter(int index)
Returns the raw
Parameter object that represents the parameter at the specified index. |
List<Parameter> |
getRawParameters()
Returns an array of raw
Parameter objects that represent all the parameters to the underlying executable represented by this object. |
Class<?> |
getRawParamType(int index)
Returns the raw parameter type of the parameter at the specified index.
|
List<Class<?>> |
getRawParamTypes()
Returns the raw parameter types on this executable.
|
String |
getShortName()
Returns the short name of this executable.
|
String |
getSimpleName()
Returns the simple name of the underlying method.
|
boolean |
hasFuzzyParamTypes(Class<?>... args)
Returns
|
boolean |
hasFuzzyParamTypes(ClassInfo... args)
Returns
|
boolean |
hasMatchingParamTypes(Class<?>... args)
Returns
|
boolean |
hasMatchingParamTypes(ClassInfo... args)
Returns
|
boolean |
hasName(Set<String> names)
Returns
|
boolean |
hasName(String... names)
Returns
|
boolean |
hasName(String name)
Returns
|
boolean |
hasNoParams()
Returns
|
boolean |
hasNumParams(int number)
Returns
|
boolean |
hasParams()
Returns
|
boolean |
hasParamTypes(Class<?>... args)
Returns
|
boolean |
hasParamTypes(ClassInfo... args)
Returns
|
boolean |
isAbstract()
Returns
|
boolean |
isAll(ReflectFlags... flags)
Returns
|
boolean |
isAny(ReflectFlags... flags)
Returns
|
boolean |
isConstructor()
Returns
Constructor . |
boolean |
isDeprecated()
Returns
@Deprecated annotation on it. |
boolean |
isNotAbstract()
Returns
|
boolean |
isNotDeprecated()
Returns
@Deprecated annotation on it. |
boolean |
isNotPublic()
Returns
|
boolean |
isNotStatic()
Returns
|
boolean |
isPublic()
Returns
|
boolean |
isStatic()
Returns
|
boolean |
isVisible(Visibility v)
Identifies if the specified visibility matches this method.
|
boolean |
setAccessible()
Attempts to call
x.setAccessible( and quietly ignores security exceptions. |
String |
toString() |
protected ExecutableInfo(ClassInfo declaringClass, Executable e, Executable re)
declaringClass
- The class that declares this method or constructor.e
- The constructor or method that this info represents.re
- The "real" constructor if the constructor above is defined against a CGLIB proxy.public final ClassInfo getDeclaringClass()
public final boolean isConstructor()
Constructor
.Constructor
and can be cast to ConstructorInfo
.
Method
and can be cast to MethodInfo
.public final int getParamCount()
Same as calling Executable.getParameterCount()
.
public final boolean hasParams()
Same as calling Executable.getParameterCount()
and comparing with zero.
public final boolean hasNoParams()
Same as calling Executable.getParameterCount()
and comparing with zero.
public final boolean hasNumParams(int number)
Same as calling Executable.getParameterCount()
and comparing the count.
number
- The number of expected arguments.public final List<ParamInfo> getParams()
Same as calling Executable.getParameters()
but wraps the results
public final ParamInfo getParam(int index)
index
- The parameter index.public final List<ClassInfo> getParamTypes()
public final ClassInfo getParamType(int index)
index
- The parameter index.public final List<Class<?>> getRawParamTypes()
public final Class<?> getRawParamType(int index)
index
- The parameter index.public final List<Type> getRawGenericParamTypes()
public final Type getRawGenericParamType(int index)
index
- The parameter index.public final List<Parameter> getRawParameters()
Parameter
objects that represent all the parameters to the underlying executable represented by this object.Parameter
objects, or an empty array if executable has no parameters.Executable.getParameters()
public final Parameter getRawParameter(int index)
Parameter
object that represents the parameter at the specified index.index
- The parameter index.Parameter
object that represents the parameter at the specified index.Executable.getParameters()
public final Annotation[][] getParameterAnnotations()
public final Annotation[] getParameterAnnotations(int index)
index
- The parameter index.public final List<ClassInfo> getExceptionTypes()
public final Class<?>[] getRawExceptionTypes()
public final boolean isAll(ReflectFlags... flags)
flags
- The flags to test for.public final boolean isAny(ReflectFlags... flags)
flags
- The flags to test for.public final boolean hasParamTypes(Class<?>... args)
args
- The arguments to test for.public final boolean hasParamTypes(ClassInfo... args)
args
- The arguments to test for.public final boolean hasMatchingParamTypes(Class<?>... args)
args
- The arguments to test for.public final boolean hasMatchingParamTypes(ClassInfo... args)
args
- The arguments to test for.public final boolean hasFuzzyParamTypes(Class<?>... args)
args
- The arguments to test for.public int fuzzyArgsMatch(Class<?>... argTypes)
The number returned is the number of method arguments that match the passed in arg types.
Returns
argTypes
- The arg types to check against.public boolean hasFuzzyParamTypes(ClassInfo... args)
args
- The arguments to test for.public int fuzzyArgsMatch(ClassInfo... argTypes)
The number returned is the number of method arguments that match the passed in arg types.
Returns
argTypes
- The arg types to check against.public final boolean isDeprecated()
@Deprecated
annotation on it.@Deprecated
annotation on it.public final boolean isNotDeprecated()
@Deprecated
annotation on it.@Deprecated
annotation on it.public final boolean isAbstract()
public final boolean isNotAbstract()
public final boolean isPublic()
public final boolean isNotPublic()
public final boolean isStatic()
public final boolean isNotStatic()
public ExecutableInfo accessible()
x.setAccessible(true )
and quietly ignores security exceptions.public final boolean setAccessible()
x.setAccessible(true )
and quietly ignores security exceptions.public final boolean isVisible(Visibility v)
v
- The visibility to validate against.public final boolean hasName(String name)
name
- The name to test for.public final boolean hasName(String... names)
names
- The names to test for.public final boolean hasName(Set<String> names)
names
- The names to test for.public final String getFullName()
public final String getShortName()
public final String getSimpleName()
Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.