The Haxe Reflection API allows retrieval of type information at runtime.

This class complements the more lightweight Reflect class, with a focus on class and enum instances.

See:

Static methods

staticcreateEnum<T> (e:Enum<T>, constr:String, ?params:Array<Dynamic>):T

Creates an instance of enum e by calling its constructor constr with arguments params.

If e or constr is null, or if enum e has no constructor named constr, or if the number of elements in params does not match the expected number of constructor arguments, or if any argument has an invalid type, the result is unspecified.

@:has_untypedstaticcreateInstance<T> (cl:Class<T>, args:Array<Dynamic>):T

Creates an instance of class cl, using args as arguments to the class constructor.

This function guarantees that the class constructor is called.

Default values of constructors arguments are not guaranteed to be taken into account.

If cl or args are null, or if the number of elements in args does not match the expected number of constructor arguments, or if any argument has an invalid type, or if cl has no own constructor, the result is unspecified.

In particular, default values of constructor arguments are not guaranteed to be taken into account.

@:has_untypedstaticgetClassName (c:Class<Dynamic>):String

Returns the name of class c, including its path.

If c is inside a package, the package structure is returned dot- separated, with another dot separating the class name: pack1.pack2.(...).packN.ClassName If c is a sub-type of a Haxe module, that module is not part of the package structure.

If c has no package, the class name is returned.

If c is null, the result is unspecified.

The class name does not include any type parameters.

@:has_untypedstaticgetInstanceFields (c:Class<Dynamic>):Array<String>

Returns a list of the instance fields of class c.

This only includes fields which are known at compile-time. In particular, using getInstanceFields(getClass(obj)) will not include any fields which were added to obj at runtime.

The order of the fields in the returned Array is unspecified.

If c is null, the result is unspecified.

(As3) This method only returns instance fields that are public.