Constructor
class in package klyn.reflection

    public class Constructor implements Invocable<Object>:

Constructor
All Implemented Interfaces: Invocable

Runtime representation of a constructor.

Constructors implement `Invocable<Object>` so frameworks can instantiate classes through reflection without falling back to raw allocation.

Example

    import klyn.reflection

    ctor = User.type.getConstructor()
    user = ctor([]) as User

Properties

Modifier and Type | Member | Description
--- | --- | ---
public readonly property | annotations `annotations as ArrayList<Annotation>:` | Constructor annotations.
public readonly property | declaringClass `declaringClass as String:` | Full reflected name of the declaring class.
public readonly property | flags `flags as Int:` | Raw modifier flags.
public readonly property | index `index as Int:` | Runtime constructor index on the declaring class.
public property | isAccessible `isAccessible as Boolean:` | Allows reflective access to non-public constructors when enabled.
public readonly property | isPrivate `isPrivate as Boolean:` | True when the constructor is private.
public readonly property | isProtected `isProtected as Boolean:` | True when the constructor is protected.
public readonly property | isPublic `isPublic as Boolean:` | True when the constructor is public.
public readonly property | name `name as String:` | Name required by `Invocable`.
public readonly property | parameterCount `parameterCount as Int:` | Number of constructor parameters.
public readonly property | parameters `parameters as ArrayList<Parameter>:` | Constructor parameters.
public readonly property | returnType `returnType as String:` | Constructed type name required by `Invocable`.

Inherited Properties
property Inherited Properties from Invocable: name, parameterCount, returnType
Constructors

Modifier and Type | Member | Description
--- | --- | ---
public | Constructor `Constructor(declaringClass as String = "", index as Int = -1, parameters as IList<Parameter> = [], flags as Int = 0, annotations as IList<Annotation> = []):` | Builds constructor metadata.

Methods

Modifier and Type | Member | Description
--- | --- | ---
public | invoke `invoke(args... as Object) as Object throws Exception:` | Invokes the constructor with a direct argument list.
public native | invoke `invoke(args as Object[]) as Object throws Exception` | Invokes the constructor with dynamic arguments packed in an `Object[]`.

Inherited Methods
method Inherited Methods from Invocable: invoke
Operators

Modifier and Type | Member | Description
--- | --- | ---
public | operator call(args as Object[]) as Object throws Exception: | Direct call operator.

Inherited Operators
operator Inherited Operators from Invocable: operator call(args as Object[]) as ReturnType throws Exception