Class

Represents and grants access to a class's attributes, fields, methods, and constructors.

Members

Functions

getConstructors
const(Constructor)[] getConstructors()

Returns an array of all constructors defined by this class. This does not include any constructors inherited from a base class, nor the default constructor.

getField
const(Field) getField(string name)

Looks up a field by name, searching this class, and each of its super classes in turn.

getFields
const(Field)[] getFields()

Returns an array of all fields defined by this class and classes that it inherits from. This only extends to super classes that also use Witchcraft.

getInterfaces
const(InterfaceType)[] getInterfaces()

Returns an array of all interfaces that are declared directly on this class. Interfaces that appear multiple times on the class are only present once in the array.

getLocalField
const(Field) getLocalField(string name)
Undocumented in source. Be warned that the author may not have intended to support it.
getLocalFieldNames
string[] getLocalFieldNames()
Undocumented in source. Be warned that the author may not have intended to support it.
getLocalFields
const(Field)[] getLocalFields()
Undocumented in source. Be warned that the author may not have intended to support it.
getLocalMethod
const(Method) getLocalMethod(string name, TypeInfo[] parameterTypes)
Undocumented in source. Be warned that the author may not have intended to support it.
getLocalMethod
const(Method) getLocalMethod(string name)
Undocumented in source. Be warned that the author may not have intended to support it.
getLocalMethodNames
string[] getLocalMethodNames()
Undocumented in source. Be warned that the author may not have intended to support it.
getLocalMethods
const(Method)[] getLocalMethods()
Undocumented in source. Be warned that the author may not have intended to support it.
getLocalMethods
const(Method)[] getLocalMethods(string name)
Undocumented in source. Be warned that the author may not have intended to support it.
getMethods
const(Method)[] getMethods()

Returns all methods declared on this class, and non-private methods in classes that it inherits from. This is restricted to classes for which reflective information is present.

getMethods
const(Method)[] getMethods(string name)

Ditto, but returns only methods that match the given name.

getSuperClass
const(Class) getSuperClass()

Returns the parent of this class. If the class doesn't declare a super class, the super class is Object, unless the class itself is Object. For Object, this method always returns null.

getSuperTypeInfo
const(TypeInfo) getSuperTypeInfo()

Ditto, but a TypeInfo object is returned instead.

isSubClassOf
bool isSubClassOf(Class other)
Undocumented in source.
isSuperClassOf
bool isSuperClassOf(Class other)
Undocumented in source.

Properties

create
Object create [@property getter]

Creates a new instance of the class, provided it has a default or zero-argument constructor.

create
T create [@property getter]

Ditto, but also casts the result to a type given by template parameter.

isAbstract
bool isAbstract [@property getter]

Checks if this class is abstract.

isClass
bool isClass [@property getter]

Checks if this type is a class. For children of Class, this always returns true.

isFinal
bool isFinal [@property getter]

Checks if this class is final.

Meta