Class reflection.ClassInfo - leonard-thieu/monkey GitHub Wiki
ClassInfo objects describe classes declared by your program and in modules.
Attributes : Int ()
ElementType : ClassInfo ()
Interfaces : ClassInfo[] ()
Name : String ()
SuperClass : ClassInfo ()
ArrayLength : Int ( inst:Object )
ExtendsClass : Bool ( clas:ClassInfo )
GetConst : ConstInfo ( name:String, recursive:Bool )
GetConstructor : FunctionInfo ( argTypes:ClassInfo )
GetConstructors : FunctionInfo[] ()
GetConsts : ConstInfo[] ( recursive:Bool )
GetElement : Object ( inst:Object, index:Int )
GetField : FieldInfo ( name:String, recursive:Bool )
GetFields : FieldInfo[] ( recursive:Bool )
GetFunction : FunctionInfo ( name:String, argTypes:ClassInfo, recursive:Bool )
GetFunctions : FunctionInfo[] ( recursive:Bool )
GetGlobal : GlobalInfo ( name:String, recursive:Bool )
GetGlobals : GlobalInfo[] ( recursive:Bool )
GetMethod : MethodInfo ( name:String, argTypes:ClassInfo, recursive:Bool )
GetMethods : MethodInfo[] ( recursive:Bool )
NewArray : Object ( length:Int )
NewInstance : Object ()
SetElement : Void ( inst:Object, index:Int, value:Object )
ClassInfo objects describe classes declared by your program and in modules.
The ArrayLength, GetElement, SetElement and NewArray methods are only valid if the class represents an array box class. You can determine whether a class is an array box class with the ElementType method. If ElementType returns non-null, then the class is an array box class.
The recursive parameter of the GetConst, GetGlobal, GetField, GetMethod and GetFunction methods indicates whether or not the entire class hierarchy should be searched, or only the current class.
The recursive parameter of the GetConsts, GetGlobals, GetFields, GetMethods and GetFunctions methods indicates whether or not all declarations spanning the entire class hierarchy should be returned, or only those declared within the current class.
Method Attributes : Int ()
Get class attributes.
Method ElementType : ClassInfo ()
Get array element type.
Get interfaces implemented by this class, or interfaces extended by this interface.
Method Name : String ()
Get name of class.
Method SuperClass : ClassInfo ()
Get super class of class.
Get length of an array.
Check if class extends another class, or implements an interface.
Get a class const.
Method GetConstructor : FunctionInfo ( argTypes:ClassInfo )
Get a class constructor.
Get all constructors declared by class.
Method GetConsts : ConstInfo[] ( recursive:Bool )
Get all consts declared by class.
Get an array element.
Get a class field.
Method GetFields : FieldInfo[] ( recursive:Bool )
Get all fields declared by class.
Method GetFunction : FunctionInfo ( name:String, argTypes:ClassInfo, recursive:Bool )
Get a class function.
Method GetFunctions : FunctionInfo[] ( recursive:Bool )
Get all functions declared by class.
Method GetGlobal : GlobalInfo ( name:String, recursive:Bool )
Get a class global.
Method GetGlobals : GlobalInfo[] ( recursive:Bool )
Get all globals declared by class.
Method GetMethod : MethodInfo ( name:String, argTypes:ClassInfo, recursive:Bool )
Get a class method.
Method GetMethods : MethodInfo[] ( recursive:Bool )
Get all methods declared by class.
Create a new array box object of this class.
Method NewInstance : Object ()
Create a new object of this class.
Set an array element.