Type system class

You can use the class gw.lang.reflect.TypeSystem for advanced type system introspection. For example, its getByFullName method returns a Type object from a String containing the fully qualified name of the type. You can perform further actions on the Type object, to get further information about the type or to instantiate an object of the type. Although each Type object itself has properties and methods, you typically use the properties and methods on the type.TypeInfo object. For example, you can get a type’s complete set of properties and methods at run time by getting the TypeInfo object.

For example, the following code gets a type by a String version of its fully qualified name and instantiates an object of that type by using the type information.

var myFullClassName = "com.mycompany.MyType"
var type = TypeSystem.getByFullName( myFullClassName )
var instance = type.TypeInfo.getConstructor( null ).Constructor.newInstance( null )