public class CachedConstructor
extends ParameterTypes
implements MetaMember
Caches reflection information about a single constructor for fast lookup and invocation.
Extends ParameterTypes to manage parameter type information and implements MetaMember for meta-programming support. Provides methods to invoke constructors with argument coercion and error handling.
| Constructor and description |
|---|
CachedConstructor(CachedClass clazz, Constructor c)Constructs a CachedConstructor for the given constructor within a cached class. |
CachedConstructor(Constructor c)Constructs a CachedConstructor for the given Java constructor.
|
| Type Params | Return Type | Name and description |
|---|---|---|
|
public Object |
doConstructorInvoke(Object[] argumentArray)Invokes this constructor with the specified arguments after coercing them to the parameter types. |
|
public static CachedConstructor |
find(Constructor constructor)Finds a CachedConstructor corresponding to the specified Java constructor
by searching the cached constructors of its declaring class. |
|
public CachedClass |
getCachedClass()Returns the cached class that declares this constructor. |
|
public Constructor |
getCachedConstructor()Returns the underlying Java constructor object, making it accessible if necessary. |
|
public Class |
getDeclaringClass()Returns the class that declares this constructor. |
|
public int |
getModifiers()Returns the modifiers of this constructor (e.g., public, private, protected). |
|
public String |
getName()Returns the name of the constructor (same as the declaring class name). |
|
protected Class[] |
getPT() |
|
public Object |
invoke(Object[] argumentArray)Invokes this constructor with the specified arguments. |
|
public boolean |
isSynthetic()Returns whether this constructor is synthetic (generated by the compiler). |
|
public String |
toString()Returns the string representation of this cached constructor. |
| Methods inherited from class | Name |
|---|---|
class ParameterTypes |
coerceArgumentsToClasses, correctArguments, getNativeParameterTypes, getPT, getParameterTypes, isValidExactMethod, isValidExactMethod, isValidMethod, isValidMethod, isVargsMethod, isVargsMethod, setParametersTypes |
Constructs a CachedConstructor for the given constructor within a cached class.
clazz - the cached class that declares this constructorc - the Java constructor to cache Constructs a CachedConstructor for the given Java constructor.
Automatically resolves the cached class from the constructor's declaring class.
c - the Java constructor to cacheInvokes this constructor with the specified arguments after coercing them to the parameter types.
argumentArray - the arguments to pass to the constructor Finds a CachedConstructor corresponding to the specified Java constructor
by searching the cached constructors of its declaring class.
constructor - the constructor to findReturns the cached class that declares this constructor.
Returns the underlying Java constructor object, making it accessible if necessary.
Returns the class that declares this constructor.
Returns the modifiers of this constructor (e.g., public, private, protected). See Modifier for modifier constants.
Returns the name of the constructor (same as the declaring class name).
Invokes this constructor with the specified arguments. Handles access control, abstract class checks, and exception wrapping.
argumentArray - the arguments to pass to the constructorReturns whether this constructor is synthetic (generated by the compiler).
true if this constructor is synthetic; false otherwiseReturns the string representation of this cached constructor.
Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.