public class Method implements Invocable<Object>:
Class representing a method.
Implements Invocable for uniform invocation across functions, methods, and constructors.
import klyn.reflection
user = User("root")
method = type(user).getMethod("displayName")
if method is Invocable<String>:
result = method.invokeOn(user, [] as Object[])| Modifier and Type | Member | Description |
|---|---|---|
| public readonly property | annotationsannotations as ArrayList<Annotation>: |
Method annotations |
| public readonly property | bodybody as String: |
Method to get the body of the method |
| public readonly property | declaringClassdeclaringClass as String: |
Declaring class |
| public readonly property | flagsflags as Int: |
Raw modifier flags |
| public property | isAccessibleisAccessible as Boolean: |
Accessibility flag for private/protected member access. |
| public readonly property | isNativeisNative as Boolean: |
True when the method is native. |
| public readonly property | isPrivateisPrivate as Boolean: |
True when the method is private. |
| public readonly property | isProtectedisProtected as Boolean: |
True when the method is protected. |
| public readonly property | isPublicisPublic as Boolean: |
True when the method is public. |
| public readonly property | isStaticisStatic as Boolean: |
True when the method is static. |
| public readonly property | namename as String: |
Method to get the name of the method |
| public readonly property | parameterCountparameterCount as Int: |
Parameter count for Invocable interface |
| public readonly property | parameters | Method to get the parameters of the method |
| public readonly property | returnTypereturnType as String: |
Method to get the return type name required by Invocable |
| public readonly property | returnTypeInforeturnTypeInfo as Type: |
Method to get the return type metadata |
| Modifier and Type | Member | Description |
|---|---|---|
| public | Method | Constructor for Method |
| Modifier and Type | Member | Description |
|---|---|---|
| public native | invoke | Invokes a static method with dynamic arguments. |
| public native | invokeOn | Invokes the method on an instance. |
| public override | toStringtoString() as String: |
Method to convert the method to a string representation |
| Modifier and Type | Member | Description |
|---|---|---|
| public | operator call(args as Object[]) as Object throws Exception: | Direct call operator. |