Method
class in package klyn.reflection

    public class Method implements Invocable<Object>:

Method
All Implemented Interfaces: Invocable

Class representing a method.

Implements Invocable for uniform invocation across functions, methods, and constructors.

    import klyn.reflection

    method = MyClass.class.getMethod("process")
    if method is Invocable<String>:
    result = method.invoke([])

Properties

Modifier and Type | Member | Description
--- | --- | ---
public readonly property | annotations `annotations as IList<Annotation>:` | Method annotations
public readonly property | body `body as String:` | Method to get the body of the method
public readonly property | declaringClass `declaringClass as String:` | Declaring class
public readonly property | flags `flags as Int:` | Raw modifier flags
public property | isAccessible `isAccessible as Boolean:` | Accessibility flag for private/protected member access.
public readonly property | name `name as String:` | Method to get the name of the method
public readonly property | parameterCount `parameterCount as Int:` | Parameter count for Invocable interface
public readonly property | parameters `parameters as IList<Parameter>:` | Method to get the parameters of the method
public readonly property | returnType `returnType as String:` | Method to get the return type name required by Invocable
public readonly property | returnTypeInfo `returnTypeInfo as Type:` | Method to get the return type metadata

Properties inherited from Invocable: name, parameterCount, returnType
Constructors

Modifier and Type | Member | Description
--- | --- | ---
public | Method `Method(name as String, returnType as Type, parameters as IList<Parameter> = [], body as String = "", flags as Int = 0, annotations as IList<Annotation> = [], declaringClass as String = null):` | Constructor for Method

Methods

Modifier and Type | Member | Description
--- | --- | ---
public | invoke `invoke(args as Object[]) as Object throws Exception:` | Invokes the method with dynamic arguments.
public | invokeOn `invokeOn(instance as Object, args as Object[]) as Object throws Exception:` | Invokes the method on an instance.
public override | toString `toString() as String:` | Method to convert the method to a string representation

Methods inherited from Invocable: invoke
Operators

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

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