Provides sanitized and blacklisted access to haxe's Reflection functions. Used for sandboxing in scripts.

Static methods

@SuppressWarnings("checkstyle:FieldDocComment")staticcallMethod(obj:Any, name:String, args:Array<Any>):Any

This function is not allowed to be used by scripts.

Throws:

error

When called by a script.

staticcompare(valueA:Any, valueB:Any):Int

Compares two objects by value.

Parameters:

valueA

First value to compare

valueB

Second value to compare

Returns:

Int indicating relative order of values

staticcompareMethods(functionA:Any, functionB:Any):Bool

Compare the two Function objects to determine whether they are the same.

Parameters:

functionA

A method closure to compare.

functionB

A method closure to compare.

Returns:

Whether functionA and functionB are equal.

staticcompareValues(valueA:Any, valueB:Any):Int

Compares two values and returns an integer indicating their relative order. Returns: - -1 if valueA < valueB - 0 if valueA == valueB - 1 if valueA > valueB

Parameters:

valueA

First value to compare

valueB

Second value to compare

Returns:

An integer indicating relative order of values

staticcopy(obj:Any):Null<Any>

Copies the given object. Only guaranteed to work on anonymous structures.

Parameters:

obj

The object to copy.

Returns:

An independent clone of that object.

staticcopyAnonymousFieldsOf(obj:Any):Null<Any>

Copies the anonymous structure to a new object.

Parameters:

obj

The object to copy.

Returns:

An independent clone of the structure.

@SuppressWarnings("checkstyle:FieldDocComment")staticcreateEmptyInstance(cls:Class<Any>):Any

This function is not allowed to be used by scripts.

Throws:

error

When called by a script.

@SuppressWarnings("checkstyle:FieldDocComment")staticcreateInstance(cls:Class<Any>, args:Array<Any>):Any

This function is not allowed to be used by scripts.

Throws:

error

When called by a script.

staticdelete(obj:Any, name:String):Bool

Delete the field of a given name from an object. Only guaranteed to work on anonymous structures.

Parameters:

obj

The object to delete the field from.

name

The name of the field to delete.

Returns:

Whether the operation was successful.

staticdeleteAnonymousField(obj:Any, name:String):Bool

Delete the field of a given name from an anonymous structure. Only guaranteed to work on anonymous structures.

Parameters:

obj

The object to delete the field from.

name

The name of the field to delete.

Returns:

Whether the operation was successful.

staticfield(obj:Any, name:String):Any

Retrive the value of a given field (by name) from an object. Only guaranteed to work on anonymous structures.

Parameters:

obj

The object to delete the field from.

name

The name of the field to delete.

Returns:

Whether the operation was successful.

staticfields(obj:Any):Array<String>

Get a list of fields available on the given object. Only guaranteed to work on anonymous structures.

Parameters:

obj

The object to query.

Returns:

A list of fields on that object.

staticgetAnonymousField(obj:Any, name:String):Any

Retrieve the value of the field of the given name from an anonymous structure.

Parameters:

obj

The object to query.

name

The name of the field to retrieve.

Returns:

The resulting field value.

Throws:

error

If the field is blacklisted.

staticgetAnonymousFieldsOf(obj:Any):Array<String>

Get a list of fields available on the given anonymous structure.

Parameters:

obj

The object to query.

Returns:

A list of fields on that object.

staticgetClassFields(cls:Class<Any>):Array<String>

Get a list of the static class fields on the given class.

Parameters:

cls

The class object to query.

Returns:

A list of class field names.

staticgetClassFieldsOf(obj:Any):Array<String>

Get a list of the static class fields on the class of the given object.

Parameters:

obj

The object whose class should be queried.

Returns:

A list of class field names.

staticgetClassName(cls:Class<Any>):String

Get the string name of the given class.

Parameters:

cls

The class to query.

Returns:

The name of the given class.

staticgetClassNameOf(obj:Any):String

Get the string name of the class of the given object.

Parameters:

obj

The object to query.

Returns:

The name of the given class, or Unknown if the class couldn't be determined.

staticgetField(obj:Any, name:String):Any

Retrive the value of a given field (by name) from an object. Only guaranteed to work on anonymous structures.

Parameters:

obj

The object to delete the field from.

name

The name of the field to delete.

Returns:

Whether the operation was successful.

staticgetFieldsOf(obj:Any):Array<String>

Get a list of fields available on the given object. Only guaranteed to work on anonymous structures.

Parameters:

obj

The object to query.

Returns:

A list of fields on that object.

staticgetInstanceFields(cls:Class<Any>):Array<String>

Get a list of all the fields on instances of the given class.

Parameters:

cls

The class object to query.

Returns:

A list of object field names.

staticgetInstanceFieldsOf(obj:Any):Array<String>

Get a list of all the fields on instances of the class of the given object.

Parameters:

obj

The object whose class should be query.

Returns:

A list of object field names.

staticgetProperty(obj:Any, name:String):Any

Get the value of the given property on a given object. Unlike getField(), this will check if the field is a property with a getter function, and use that if appropriate.

Parameters:

obj

The object to query.

name

The name of the field to query.

Returns:

The value of the field.

Throws:

error

If the field is blacklisted.

statichasAnonymousField(obj:Any, name:String):Bool

Determine whether the given anonymous structure has the given field.

Parameters:

obj

The structure to query.

name

The field name to query.

Returns:

Whether the field exists.

statichasField(obj:Any, name:String):Bool

Determine whether the given object has the given field. Only guaranteed to work for anonymous structures.

Parameters:

obj

The object to query.

name

The field name to query.

Returns:

Whether the field exists.

staticisEnumValue(value:Any):Bool

Determine whether the given input is an enum value.

Parameters:

value

The input to evaluate.

Returns:

Whether value is an enum value.

staticisFunction(value:Any):Bool

Determine whether the given input is a callable function.

Parameters:

value

The input to evaluate.

Returns:

Whether value is a function.

staticisObject(value:Any):Bool

Determine whether the given input is an object.

Parameters:

value

The input to evaluate.

Returns:

Whether value is an object.

@SuppressWarnings("checkstyle:FieldDocComment")staticresolveClass(name:String):Class<Any>

This function is not allowed to be used by scripts.

Throws:

error

When called by a script.

@SuppressWarnings("checkstyle:FieldDocComment")staticresolveEnum(name:String):Enum<Any>

This function is not allowed to be used by scripts.

Throws:

error

When called by a script.

staticsetAnonymousField(obj:Any, name:String, value:Any):Void

Set the value of a specific field on an anonymous structure.

Parameters:

obj

The object to modify.

name

The field to modify.

value

The new value to apply.

staticsetField(obj:Any, name:String, value:Any):Void

Set the value of a specific field on an object. Only guaranteed to work for anonymous structures.

Parameters:

obj

The object to modify.

name

The field to modify.

value

The new value to apply.

staticsetProperty(obj:Any, name:String, value:Any):Void

Set the value of a specific field on an object. Accounts for property fields with getters and setters.

Parameters:

obj

The object to modify.

name

The field to modify.

value

The new value to apply.

@SuppressWarnings("checkstyle:FieldDocComment")statictypeof(value:Any):ValueType

This function is not allowed to be used by scripts.

Throws:

error

When called by a script.