public class Constructor implements Invocable<Object>:
Runtime representation of a constructor.
Constructors implement Invocable<Object> so frameworks can instantiate classes through reflection without falling back to raw allocation.
import klyn.reflection ctor = User.type.getConstructor() user = ctor([]) as User
| Modifier and Type | Member | Description |
|---|---|---|
| public readonly property | annotationsannotations as ArrayList<Annotation>: |
Constructor annotations. |
| public readonly property | declaringClassdeclaringClass as String: |
Full reflected name of the declaring class. |
| public readonly property | flagsflags as Int: |
Raw modifier flags. |
| public readonly property | indexindex as Int: |
Runtime constructor index on the declaring class. |
| public property | isAccessibleisAccessible as Boolean: |
Allows reflective access to non-public constructors when enabled. |
| public readonly property | isPrivateisPrivate as Boolean: |
True when the constructor is private. |
| public readonly property | isProtectedisProtected as Boolean: |
True when the constructor is protected. |
| public readonly property | isPublicisPublic as Boolean: |
True when the constructor is public. |
| public readonly property | namename as String: |
Name required by Invocable. |
| public readonly property | parameterCountparameterCount as Int: |
Number of constructor parameters. |
| public readonly property | parameters | Constructor parameters. |
| public readonly property | returnTypereturnType as String: |
Constructed type name required by Invocable. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | ConstructorConstructor(declaringClass as String = "", index as Int = -1, parameters as IList<Parameter> = [], flags as Int = 0, annotations as IList<Annotation> = []): |
Builds constructor metadata. |
| Modifier and Type | Member | Description |
|---|---|---|
| public native | invoke | Invokes the constructor with dynamic arguments. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | operator call(args as Object[]) as Object throws Exception: | Direct call operator. |