@BeanIgnore public final class ConstructorInfo extends ExecutableInfo implements Comparable<ConstructorInfo>
Modifier | Constructor and Description |
---|---|
protected |
ConstructorInfo(ClassInfo declaringClass,
Constructor<?> c,
Constructor<?> rc)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(ConstructorInfo o) |
<T extends Annotation> |
getAnnotation(Class<T> a)
Finds the annotation of the specified type defined on this constructor.
|
<T extends Annotation> |
getAnnotation(Class<T> a,
MetaProvider mp)
Finds the annotation of the specified type defined on this constructor.
|
boolean |
hasAnnotation(Class<? extends Annotation> a)
Returns
|
<T> Constructor<T> |
inner()
Returns the wrapped method.
|
<T> T |
invoke(Object... args)
Shortcut for calling the new-instance method on the underlying constructor.
|
ConstructorInfo |
makeAccessible(Visibility v)
Makes constructor accessible if it matches the visibility requirements, or returns
|
static ConstructorInfo |
of(ClassInfo declaringClass,
Constructor<?> c,
Constructor<?> rc)
Convenience method for instantiating a
ConstructorInfo ; |
static ConstructorInfo |
of(Constructor<?> c)
Convenience method for instantiating a
ConstructorInfo ; |
getDeclaringClass, getExceptionTypes, getFullName, getParam, getParamCount, getParameterAnnotations, getParameterAnnotations, getParams, getParamType, getParamTypes, getRawExceptionTypes, getRawGenericParamType, getRawGenericParamTypes, getRawParameter, getRawParameters, getRawParamType, getRawParamTypes, getShortName, getSimpleName, hasFuzzyParamTypes, hasFuzzyParamTypes, hasName, hasName, hasName, hasNoParams, hasNumParams, hasParams, hasParamTypeParents, hasParamTypeParents, hasParamTypes, hasParamTypes, isAbstract, isAll, isAny, isConstructor, isDeprecated, isNotAbstract, isNotDeprecated, isNotPublic, isNotStatic, isPublic, isStatic, isVisible, setAccessible, toString
protected ConstructorInfo(ClassInfo declaringClass, Constructor<?> c, Constructor<?> rc)
declaringClass
- The class that declares this method.c
- The constructor being wrapped.rc
- The "real" constructor if the constructor above is defined against a CGLIB proxy.public static ConstructorInfo of(ClassInfo declaringClass, Constructor<?> c, Constructor<?> rc)
ConstructorInfo
;declaringClass
- The class that declares this method.c
- The constructor being wrapped.rc
- The "real" constructor if the constructor above is defined against a CGLIB proxy.ConstructorInfo
object, or public static ConstructorInfo of(Constructor<?> c)
ConstructorInfo
;c
- The constructor being wrapped.ConstructorInfo
object, or public <T> Constructor<T> inner()
public final <T extends Annotation> T getAnnotation(Class<T> a)
a
- The annotation to search for.public final <T extends Annotation> T getAnnotation(Class<T> a, MetaProvider mp)
a
- The annotation to search for.mp
- The meta provider for looking up annotations on classes/methods/fields.public final boolean hasAnnotation(Class<? extends Annotation> a)
a
- The annotation to check for.public <T> T invoke(Object... args) throws ExecutableException
args
- the arguments used for the method callExecutableException
- Exception occurred on invoked constructor/method/field.public ConstructorInfo makeAccessible(Visibility v)
Security exceptions thrown on the call to AccessibleObject.setAccessible(boolean)
are quietly ignored.
v
- The minimum visibility.AccessibleObject.setAccessible(boolean)
throws a security exception.public int compareTo(ConstructorInfo o)
compareTo
in interface Comparable<ConstructorInfo>
Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.