Functions
func parseParameterTypes(String)
public func parseParameterTypes(parameters: String): Array<TypeInfo>
Description: Parses parameter types from a string and converts them into an array of types for use by functions such as getStaticFunction.
The qualified name of a function parameter type refers to the parameter type portion of the function type, excluding the parameter names, default values, and outermost parentheses (). Therefore, for the following Cangjie function:
import m1.p1.T1
func f(a: Int64, b: T1, c!: Int64 = 0, d!: Int64 = 0): Int64 { ... }
The qualified name should be "Int64, p1.T1, Int64, Int64". The qualified name of a function without parameters should be "".
Parameters:
- parameters: String: qualified name of the function parameter types
Returns:
Throws:
- IllegalArgumentException: If the string format is incorrect, this exception is thrown.
- InfoNotFoundException: If the type information of the parameters cannot be obtained, this exception is thrown.
Example:
import std.reflect.*
class A {
}
main(): Unit {
println(parseParameterTypes("Int64, String, default.A"))
}
Running result:
[Int64, String, default.A]