Package org.apache.juneau.reflect
Class ConstructorInfo
java.lang.Object
org.apache.juneau.reflect.ExecutableInfo
org.apache.juneau.reflect.ConstructorInfo
- All Implemented Interfaces:
- Comparable<ConstructorInfo>
Lightweight utility class for introspecting information about a constructor.
 
See Also:
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedConstructorInfo(ClassInfo declaringClass, Constructor<?> c) Constructor.
- 
Method SummaryModifier and TypeMethodDescriptionaccept(Predicate<ConstructorInfo> test, Consumer<ConstructorInfo> action) Performs an action on this object if the specified predicate test passes.Attempts to callx.setAccessible(and quietly ignores security exceptions.true )Makes constructor accessible if it matches the visibility requirements, or returnsnull if it doesn't.booleanReturnstrue if this constructor can accept the specified arguments in the specified order.int<A extends Annotation>
 AgetAnnotation(Class<A> type) Finds the annotation of the specified type defined on this constructor.<A extends Annotation>
 AgetAnnotation(AnnotationProvider annotationProvider, Class<A> type) Finds the annotation of the specified type defined on this constructor.<A extends Annotation>
 booleanhasAnnotation(Class<A> type) Returnstrue if the specified annotation is present on this constructor.<A extends Annotation>
 booleanhasAnnotation(AnnotationProvider annotationProvider, Class<A> type) Returnstrue if the specified annotation is present on this constructor.<A extends Annotation>
 booleanhasNoAnnotation(AnnotationProvider annotationProvider, Class<A> type) Returnstrue if the specified annotation is not present on this constructor.<T> Constructor<T>inner()Returns the wrapped method.<T> TShortcut for calling the new-instance method on the underlying constructor.<T> TinvokeFuzzy(Object... args) Shortcut for calling the new-instance method on the underlying constructor.booleanmatches(Predicate<ConstructorInfo> test) Returnstrue if this object passes the specified predicate test.static ConstructorInfoof(Constructor<?> c) Convenience method for instantiating aConstructorInfo;static ConstructorInfoof(ClassInfo declaringClass, Constructor<?> c) Convenience method for instantiating aConstructorInfo;Methods inherited from class org.apache.juneau.reflect.ExecutableInfoforEachParam, forEachParameterAnnotation, fuzzyArgsMatch, fuzzyArgsMatch, fuzzyArgsMatch, getDeclaringClass, getExceptionTypes, getFullName, getParam, getParamCount, getParams, getParamType, getParamTypes, getRawGenericParamType, getRawGenericParamTypes, getRawParameter, getRawParameters, getRawParamType, getRawParamTypes, getShortName, getSimpleName, hasFuzzyParamTypes, hasFuzzyParamTypes, hasMatchingParamTypes, hasMatchingParamTypes, hasName, hasName, hasName, hasNoParams, hasNumParams, hasParams, hasParamTypes, hasParamTypes, is, isAbstract, isAll, isAny, isConstructor, isDeprecated, isNotAbstract, isNotDeprecated, isNotProtected, isNotPublic, isNotStatic, isProtected, isPublic, isStatic, isVisible, setAccessible, toString
- 
Constructor Details- 
ConstructorInfoConstructor.- Parameters:
- declaringClass- The class that declares this method.
- c- The constructor being wrapped.
 
 
- 
- 
Method Details- 
ofConvenience method for instantiating aConstructorInfo;- Parameters:
- declaringClass- The class that declares this method.
- c- The constructor being wrapped.
- Returns:
- A new ConstructorInfoobject, ornull if the method was null;
 
- 
ofConvenience method for instantiating aConstructorInfo;- Parameters:
- c- The constructor being wrapped.
- Returns:
- A new ConstructorInfoobject, ornull if the method was null;
 
- 
innerReturns the wrapped method.- Type Parameters:
- T- The inner class type.
- Returns:
- The wrapped method.
 
- 
getAnnotationFinds the annotation of the specified type defined on this constructor.- Type Parameters:
- A- The annotation type to look for.
- Parameters:
- type- The annotation to look for.
- Returns:
- The annotation if found, or null if not.
 
- 
getAnnotationFinds the annotation of the specified type defined on this constructor.- Type Parameters:
- A- The annotation type to look for.
- Parameters:
- annotationProvider- The annotation provider.
- type- The annotation to look for.
- Returns:
- The first annotation found, or null if it doesn't exist.
 
- 
hasAnnotationReturnstrue if the specified annotation is present on this constructor.- Type Parameters:
- A- The annotation type to look for.
- Parameters:
- type- The annotation to look for.
- Returns:
- true if the specified annotation is present on this constructor.
 
- 
hasAnnotationpublic <A extends Annotation> boolean hasAnnotation(AnnotationProvider annotationProvider, Class<A> type) Returnstrue if the specified annotation is present on this constructor.- Type Parameters:
- A- The annotation type to look for.
- Parameters:
- annotationProvider- The annotation provider.
- type- The annotation to look for.
- Returns:
- true if the specified annotation is present on this constructor.
 
- 
hasNoAnnotationpublic <A extends Annotation> boolean hasNoAnnotation(AnnotationProvider annotationProvider, Class<A> type) Returnstrue if the specified annotation is not present on this constructor.- Type Parameters:
- A- The annotation type to look for.
- Parameters:
- annotationProvider- The annotation provider.
- type- The annotation to look for.
- Returns:
- true if the specified annotation is not present on this constructor.
 
- 
matchesReturnstrue if this object passes the specified predicate test.- Parameters:
- test- The test to perform.
- Returns:
- true if this object passes the specified predicate test.
 
- 
acceptPerforms an action on this object if the specified predicate test passes.- Parameters:
- test- A test to apply to determine if action should be executed. Can be- null .
- action- An action to perform on this object.
- Returns:
- This object.
 
- 
canAcceptReturnstrue if this constructor can accept the specified arguments in the specified order.- Parameters:
- args- The arguments to check.
- Returns:
- true if this constructor can accept the specified arguments in the specified order.
 
- 
invokeFuzzyShortcut for calling the new-instance method on the underlying constructor.- Type Parameters:
- T- The constructor class type.
- Parameters:
- args- the arguments used for the method call.
 Extra parameters are ignored.
 Missing parameters are set to null.
- Returns:
- The object returned from the constructor.
- Throws:
- ExecutableException- Exception occurred on invoked constructor/method/field.
 
- 
invokeShortcut for calling the new-instance method on the underlying constructor.- Type Parameters:
- T- The constructor class type.
- Parameters:
- args- the arguments used for the method call.
- Returns:
- The object returned from the constructor.
- Throws:
- ExecutableException- Exception occurred on invoked constructor/method/field.
 
- 
accessibleMakes constructor accessible if it matches the visibility requirements, or returnsnull if it doesn't.Security exceptions thrown on the call to Constructor.setAccessible(boolean)are quietly ignored.- Parameters:
- v- The minimum visibility.
- Returns:
- The same constructor if visibility requirements met, or null if visibility requirement not met or call toConstructor.setAccessible(boolean)throws a security exception.
 
- 
compareTo- Specified by:
- compareToin interface- Comparable<ConstructorInfo>
 
- 
accessibleDescription copied from class:ExecutableInfoAttempts to callx.setAccessible(and quietly ignores security exceptions.true )- Overrides:
- accessiblein class- ExecutableInfo
- Returns:
- This object.
 
 
-