Qore reflection Module
0.9.3
|
This class provides information about Qore classes. More...
Public Member Methods | |
constructor (string path) | |
Creates the object from the class name or namespace-justified path as a string. More... | |
hash< MethodAccessInfo > | findMethod (string name) |
Returns information about the given method if it's accessible in the class hierarchy or throws an exception if the method does not exist. More... | |
hash< MethodAccessInfo > | findNormalMethod (string name) |
Returns information about the given normal (non-static) method if it's accessible in the class hierarchy or throws an exception if the method does not exist. More... | |
hash< MethodAccessInfo > | findStaticMethod (string name) |
Returns information about the given static method if it's accessible in the class hierarchy or throws an exception if the method does not exist. More... | |
list< Class > | getClassHierarchy () |
Returns a list of all unique classes in the class hierarchy (including classes inherited with private:internal access protection) in constructor execution order; the current class is always returned in the last position of the list. More... | |
ClassConstant | getConstant (string name) |
Returns the given class constant or throws an exception if the constant is not defined. More... | |
list< ClassConstant > | getConstants () |
Returns a list of all declared class constants. More... | |
ConstructorMethod | getConstructorMethod () |
returns the given constructor method or throws an exception if the class does not implement a constructor method More... | |
ConstructorMethodVariant | getConstructorVariant (...) |
Returns the given constructor method variant, otherwise throws an exception if no constructor method variant can be matched. More... | |
ConstructorMethodVariant | getConstructorVariantArgs (*softlist< Type > argv) |
Returns the given constructor method variant, otherwise throws an exception if no constructor method variant can be matched. More... | |
list< ConstructorMethodVariant > | getConstructorVariants () |
returns a list of all constructor method variants More... | |
CopyMethod | getCopyMethod () |
returns the given copy method or throws an exception if the class does not implement a copy method More... | |
CopyMethodVariant | getCopyVariant () |
Returns the copy method variant, otherwise throws an exception if no copy method variant has been defined. More... | |
DestructorMethod | getDestructorMethod () |
returns the given destructor method or throws an exception if the class does not implement a destructor method More... | |
DestructorMethodVariant | getDestructorVariant () |
Returns the destructor method variant, otherwise throws an exception if no destructor method variant has been defined. More... | |
*CopyMethodVariant | getIfCopyVariant () |
returns the copy method variant or NOTHING if no copy method has been defined More... | |
*DestructorMethodVariant | getIfDestructorVariant () |
returns the destructor variant or NOTHING if no destructor has been defined More... | |
int | getInheritanceAccess (Class base_class) |
Returns the accessibility of the class passed as an argument in the hierarchy of the current class as an access value or 0 if the argument class is not present in the current class's hierarchy at all. More... | |
AbstractClassMember | getMember (string name) |
returns the requested member or throws an exception if the member is not defined in the class More... | |
list< AbstractClassMember > | getMembers () |
returns a list of all declared class members, non-static (first) and static (second) in declaration order More... | |
*string | getModuleName () |
Returns the module name providing the class or NOTHING if the class was not provided by a module. More... | |
Namespace | getNamespace () |
Returns the namespace for the class. More... | |
NormalMember | getNormalMember (string name) |
returns the requested normal (non-static) member or throws an exception if the normal member is not defined in the class More... | |
NormalMethod | getNormalMethod (string name) |
returns the given normal (non-special, non-static) method or throws an exception if the method does not exist More... | |
list< NormalMethod > | getNormalMethods () |
returns a list of all normal (non-static, non-special) class methods More... | |
NormalMethodVariant | getNormalVariant (string name,...) |
returns the given normal (non-static, non-special) method variant, otherwise throws an exception if no method variant can be matched More... | |
NormalMethodVariant | getNormalVariantArgs (string name, *softlist< Type > argv) |
Returns the given normal (non-static, non-special) method variant, otherwise throws an exception if no method variant can be matched. More... | |
list< NormalMethodVariant > | getNormalVariants () |
returns a list of all normal (non-static, non-special) method variants More... | |
Type | getOrNothingType () |
Returns the "or nothing" type object for this class. More... | |
string | getPathName () |
returns the class's full namespace-justified path name More... | |
StaticMember | getStaticMember (string name) |
returns the requested static member or throws an exception if the static member is not defined in the class More... | |
StaticMethod | getStaticMethod (string name) |
returns the given static method or throws an exception if the method does not exist More... | |
StaticMethodVariant | getStaticVariant (string name,...) |
Returns the given static method variant, otherwise throws an exception if no static method variant can be matched. More... | |
StaticMethodVariant | getStaticVariantArgs (string name, *softlist< Type > argv) |
Returns the given static method variant, otherwise throws an exception if no static method variant can be matched. More... | |
list< StaticMethodVariant > | getStaticVariants () |
returns a list of all static method variants More... | |
Type | getType () |
Returns the type object for this class. More... | |
bool | hasConstructorMethod () |
returns True if the class has at least one constructor method variant More... | |
bool | hasCopyMethod () |
returns True if the class has a copy method More... | |
bool | hasDestructorMethod () |
returns True if the class has a destructor method More... | |
int | instanceOf (object obj) |
Returns the accessibility of the current class in the given object as an access value or 0 if the object does not inherit the class at all. More... | |
object | newObject (...) |
creates an object if the current class with the given arguments More... | |
object | newObjectArgs (*softlist argv) |
creates an object if the current class with the arguments for the constructor given as a list More... | |
Public Member Methods inherited from Qore::Reflection::AbstractClass | |
constructor () | |
Throws an exception if called directly; this class can only be instantiated by builtin subclasses. More... | |
int | getDomain () |
returns the functional domain of the class (for builtin classes only) as a bitfield of Functional Domain Constants More... | |
list< string > | getDomainStringList () |
returns a list of functional domain strings for the class (for builtin classes only); an empty list is returned for user classes More... | |
binary | getHash () |
returns a unique binary hash for the class More... | |
int | getId () |
returns the internal ID of the class which is only valid for the current execution session More... | |
AbstractMethod | getMethod (string name) |
returns the given method or throws an exception if the method does not exist in the local class More... | |
list< AbstractMethod > | getMethods () |
returns a list of all class methods including special and static methods More... | |
list< string > | getModifierList () |
returns a list of strings of modifiers describing the class More... | |
int | getModifiers () |
returns a bitfield of modifiers describing the class More... | |
string | getName () |
returns the class's name More... | |
list< hash< ClassAccessInfo > > | getParentClasses () |
Returns a list of immediate parent classes and access information; if the Class has no parent classes, then an empty list is returned. More... | |
AbstractMethodVariant | getVariant (string name,...) |
returns the given method variant, otherwise throws an exception if no method variant can be matched More... | |
AbstractMethodVariant | getVariantArgs (string name, *softlist< Type > argv) |
returns the given method variant, otherwise throws an exception if no method variant can be matched More... | |
list< AbstractMethodVariant > | getVariants () |
returns a list of all class method variants including variants for special and static methods More... | |
bool | hasMemberGate () |
returns True if the class implements a "memberGate" method More... | |
bool | hasMemberNotification () |
returns True if the class implements a "memberNotification" method More... | |
bool | hasMethodGate () |
returns True if the class implements a "methodGate" method More... | |
bool | isAbstract () |
returns True if the class has at least one abstract method More... | |
bool | isBuiltin () |
returns True if the class is a builtin class More... | |
bool | isEqual (AbstractClass cls) |
Returns True if the Class object passed as an argument is equal to the current object; False if not. More... | |
bool | isInjected () |
returns True if the class was injected as a dependency injection More... | |
bool | isModulePublic () |
returns True if the class has the module public flag set More... | |
bool | isPseudoClass () |
returns True if the class is a pseudo-class More... | |
bool | isUser () |
returns True if the class is a user class More... | |
Static Public Member Methods | |
static list< Class > | findAllRegex (string pattern, *int re_opts) |
Returns a list of classes matching the regular expression pattern argument or an empty list if no classes match. More... | |
static list< Class > | findAllRegex (Program pgm, string pattern, *int re_opts) |
Returns a list of classes matching the regular expression pattern argument or an empty list if no classes match. More... | |
static Class | forName (string path) |
Returns a Class object from the class name or namespace-justified path as a string. More... | |
static Class | forName (Program pgm, string path) |
Returns a Class object from the class name or namespace-justified path as a string. More... | |
static Class | getClass (object obj) |
Returns the class for the object. More... | |
This class provides information about Qore classes.
Qore::Reflection::Class::constructor | ( | string | path | ) |
Creates the object from the class name or namespace-justified path as a string.
path | the class name or namespace-justified path as a string |
UNKNOWN-CLASS | cannot find a class with the given name or path |
ENCODING-CONVERSION-ERROR | this exception could be thrown if the string argument is not in the default character encoding and an error occurs during encoding conversion |
Returns a list of classes matching the regular expression pattern argument or an empty list if no classes match.
pattern | the regular expression pattern to match |
re_opts | see Regular Expression Constants for possible values |
|
static |
Returns a list of classes matching the regular expression pattern argument or an empty list if no classes match.
pgm | the Program object to search |
pattern | the regular expression pattern to match |
re_opts | see Regular Expression Constants for possible values |
hash<MethodAccessInfo> Qore::Reflection::Class::findMethod | ( | string | name | ) |
Returns information about the given method if it's accessible in the class hierarchy or throws an exception if the method does not exist.
Searches the class hierarchy for normal methods (including special methods) and then static methods for the given method name
name | the name of the method |
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
METHOD-ERROR | unknown method |
ENCODING-CONVERSION-ERROR | this exception could be thrown if the string argument is not in the default character encoding and an error occurs during encoding conversion |
hash<MethodAccessInfo> Qore::Reflection::Class::findNormalMethod | ( | string | name | ) |
Returns information about the given normal (non-static) method if it's accessible in the class hierarchy or throws an exception if the method does not exist.
Searches the class hierarchy for normal methods for the given method name
name | the name of the method |
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
METHOD-ERROR | unknown method |
ENCODING-CONVERSION-ERROR | this exception could be thrown if the string argument is not in the default character encoding and an error occurs during encoding conversion |
hash<MethodAccessInfo> Qore::Reflection::Class::findStaticMethod | ( | string | name | ) |
Returns information about the given static method if it's accessible in the class hierarchy or throws an exception if the method does not exist.
Searches the class hierarchy for static methods for the given method name
name | the name of the method |
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
METHOD-ERROR | unknown method |
ENCODING-CONVERSION-ERROR | this exception could be thrown if the string argument is not in the default character encoding and an error occurs during encoding conversion |
Returns a Class object from the class name or namespace-justified path as a string.
path | the class name or namespace-justified path as a string |
UNKNOWN-CLASS | cannot find a class with the given name or path |
ENCODING-CONVERSION-ERROR | this exception could be thrown if the string argument is not in the default character encoding and an error occurs during encoding conversion |
Returns a Class object from the class name or namespace-justified path as a string.
pgm | the Program object to search |
path | the class name or namespace-justified path as a string |
UNKNOWN-CLASS | cannot find a class with the given name or path |
ENCODING-CONVERSION-ERROR | this exception could be thrown if the string argument is not in the default character encoding and an error occurs during encoding conversion |
|
static |
Returns the class for the object.
obj | the object to return the class for |
Returns a list of all unique classes in the class hierarchy (including classes inherited with private:internal access protection) in constructor execution order; the current class is always returned in the last position of the list.
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
ClassConstant Qore::Reflection::Class::getConstant | ( | string | name | ) |
Returns the given class constant or throws an exception if the constant is not defined.
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
UNKNOWN-CONSTANT | thrown if the constant cannot be found |
ENCODING-CONVERSION-ERROR | this exception could be thrown if the string argument is not in the default character encoding and an error occurs during encoding conversion |
list<ClassConstant> Qore::Reflection::Class::getConstants | ( | ) |
Returns a list of all declared class constants.
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
ConstructorMethod Qore::Reflection::Class::getConstructorMethod | ( | ) |
returns the given constructor method or throws an exception if the class does not implement a constructor method
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
METHOD-ERROR | the class does not implement a constructor method |
ConstructorMethodVariant Qore::Reflection::Class::getConstructorVariant | ( | ... | ) |
Returns the given constructor method variant, otherwise throws an exception if no constructor method variant can be matched.
Searches constructor methods only and then matches the arguments by type to return the variant
... | Type arguments giving parameter types |
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
GETVARIANT-ERROR | invalid argument to method |
METHOD-ERROR | no constructor method defined |
VARIANT-MATCH-ERROR | no constructor method variant van be found matching the given argument types |
ConstructorMethodVariant Qore::Reflection::Class::getConstructorVariantArgs | ( | *softlist< Type > | argv | ) |
Returns the given constructor method variant, otherwise throws an exception if no constructor method variant can be matched.
Searches static methods only for the given method name and and then matches the arguments by type
argv | Type arguments giving parameter types |
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
GETVARIANT-ERROR | invalid argument to method |
METHOD-ERROR | no constructor method defined |
VARIANT-MATCH-ERROR | no method constructor variant van be found matching the given argument types |
list<ConstructorMethodVariant> Qore::Reflection::Class::getConstructorVariants | ( | ) |
returns a list of all constructor method variants
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
CopyMethod Qore::Reflection::Class::getCopyMethod | ( | ) |
returns the given copy method or throws an exception if the class does not implement a copy method
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
METHOD-ERROR | the class does not implement a copy method |
CopyMethodVariant Qore::Reflection::Class::getCopyVariant | ( | ) |
Returns the copy method variant, otherwise throws an exception if no copy method variant has been defined.
Searches copy methods only
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
GETVARIANT-ERROR | invalid argument to method |
METHOD-ERROR | no copy method defined |
DestructorMethod Qore::Reflection::Class::getDestructorMethod | ( | ) |
returns the given destructor method or throws an exception if the class does not implement a destructor method
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
METHOD-ERROR | the class does not implement a destructor method |
DestructorMethodVariant Qore::Reflection::Class::getDestructorVariant | ( | ) |
Returns the destructor method variant, otherwise throws an exception if no destructor method variant has been defined.
Searches destructor methods only
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
GETVARIANT-ERROR | invalid argument to method |
METHOD-ERROR | no destructor method defined |
*CopyMethodVariant Qore::Reflection::Class::getIfCopyVariant | ( | ) |
returns the copy method variant or NOTHING if no copy method has been defined
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
*DestructorMethodVariant Qore::Reflection::Class::getIfDestructorVariant | ( | ) |
returns the destructor variant or NOTHING if no destructor has been defined
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
Returns the accessibility of the class passed as an argument in the hierarchy of the current class as an access value or 0
if the argument class is not present in the current class's hierarchy at all.
base_class | the class to try to find in the current class's hieerarchy |
0
if the argument class is not present in the current class's hierarchy at all; see Access Constants for possible return values (plus 0
meaning no inheritance) AbstractClassMember Qore::Reflection::Class::getMember | ( | string | name | ) |
returns the requested member or throws an exception if the member is not defined in the class
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
UNKNOWN-MEMBER | if the requested member is not defined in the class |
ENCODING-CONVERSION-ERROR | this exception could be thrown if the string argument is not in the default character encoding and an error occurs during encoding conversion |
list<AbstractClassMember> Qore::Reflection::Class::getMembers | ( | ) |
returns a list of all declared class members, non-static (first) and static (second) in declaration order
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
*string Qore::Reflection::Class::getModuleName | ( | ) |
Returns the module name providing the class or NOTHING if the class was not provided by a module.
Namespace Qore::Reflection::Class::getNamespace | ( | ) |
NormalMember Qore::Reflection::Class::getNormalMember | ( | string | name | ) |
returns the requested normal (non-static) member or throws an exception if the normal member is not defined in the class
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
UNKNOWN-NORMAL-MEMBER | if the requested normal (non-static) member is not defined in the class |
ENCODING-CONVERSION-ERROR | this exception could be thrown if the string argument is not in the default character encoding and an error occurs during encoding conversion |
NormalMethod Qore::Reflection::Class::getNormalMethod | ( | string | name | ) |
returns the given normal (non-special, non-static) method or throws an exception if the method does not exist
name | the name of the normal (non-special, non-static) method |
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
UNKNOWN-METHOD | unknown method or method is not normal |
ENCODING-CONVERSION-ERROR | this exception could be thrown if the string argument is not in the default character encoding and an error occurs during encoding conversion |
list<NormalMethod> Qore::Reflection::Class::getNormalMethods | ( | ) |
returns a list of all normal (non-static, non-special) class methods
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
NormalMethodVariant Qore::Reflection::Class::getNormalVariant | ( | string | name, |
... | |||
) |
returns the given normal (non-static, non-special) method variant, otherwise throws an exception if no method variant can be matched
Searches normal (non-static, non-special) methods only for the given method name and and then matches the arguments by type to return the variant.
name | the name of the normal (non-static, non-special) method |
... | Type arguments giving parameter types |
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
GETVARIANT-ERROR | invalid argument to method |
METHOD-ERROR | unknown normal (non-static, non-special) method |
VARIANT-MATCH-ERROR | no normal (non-static, non-special) method variant van be found matching the given argument types |
ENCODING-CONVERSION-ERROR | this exception could be thrown if the string argument is not in the default character encoding and an error occurs during encoding conversion |
NormalMethodVariant Qore::Reflection::Class::getNormalVariantArgs | ( | string | name, |
*softlist< Type > | argv | ||
) |
Returns the given normal (non-static, non-special) method variant, otherwise throws an exception if no method variant can be matched.
Searches normal (non-static, non-special) methods only for the given method name and and then matches the arguments by type
name | the name of the normal (non-static, non-special) method |
argv | Type arguments giving parameter types |
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
GETVARIANT-ERROR | invalid argument to method |
METHOD-ERROR | unknown normal (non-static, non-special) method |
VARIANT-MATCH-ERROR | no normal (non-static, non-special) method variant van be found matching the given argument types |
ENCODING-CONVERSION-ERROR | this exception could be thrown if the string argument is not in the default character encoding and an error occurs during encoding conversion |
list<NormalMethodVariant> Qore::Reflection::Class::getNormalVariants | ( | ) |
returns a list of all normal (non-static, non-special) method variants
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
Type Qore::Reflection::Class::getOrNothingType | ( | ) |
Returns the "or nothing" type object for this class.
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
string Qore::Reflection::Class::getPathName | ( | ) |
returns the class's full namespace-justified path name
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
StaticMember Qore::Reflection::Class::getStaticMember | ( | string | name | ) |
returns the requested static member or throws an exception if the static member is not defined in the class
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
UNKNOWN-STATIC-MEMBER | if the requested static member is not defined in the class |
ENCODING-CONVERSION-ERROR | this exception could be thrown if the string argument is not in the default character encoding and an error occurs during encoding conversion |
StaticMethod Qore::Reflection::Class::getStaticMethod | ( | string | name | ) |
returns the given static method or throws an exception if the method does not exist
name | the name of the static method |
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
UNKNOWN-METHOD | unknown method or method is not static |
ENCODING-CONVERSION-ERROR | this exception could be thrown if the string argument is not in the default character encoding and an error occurs during encoding conversion |
StaticMethodVariant Qore::Reflection::Class::getStaticVariant | ( | string | name, |
... | |||
) |
Returns the given static method variant, otherwise throws an exception if no static method variant can be matched.
Searches static methods only for the given method name and and then matches the arguments by type to return the variant
name | the name of the static method |
... | Type arguments giving parameter types |
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
GETVARIANT-ERROR | invalid argument to method |
METHOD-ERROR | unknown static method |
VARIANT-MATCH-ERROR | no static method variant van be found matching the given argument types |
ENCODING-CONVERSION-ERROR | this exception could be thrown if the string argument is not in the default character encoding and an error occurs during encoding conversion |
StaticMethodVariant Qore::Reflection::Class::getStaticVariantArgs | ( | string | name, |
*softlist< Type > | argv | ||
) |
Returns the given static method variant, otherwise throws an exception if no static method variant can be matched.
Searches static methods only for the given method name and and then matches the arguments by type
name | the name of the static method |
argv | Type arguments giving parameter types |
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
GETVARIANT-ERROR | invalid argument to method |
METHOD-ERROR | unknown static method |
VARIANT-MATCH-ERROR | no method static variant van be found matching the given argument types |
ENCODING-CONVERSION-ERROR | this exception could be thrown if the string argument is not in the default character encoding and an error occurs during encoding conversion |
list<StaticMethodVariant> Qore::Reflection::Class::getStaticVariants | ( | ) |
returns a list of all static method variants
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
Type Qore::Reflection::Class::getType | ( | ) |
Returns the type object for this class.
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
bool Qore::Reflection::Class::hasConstructorMethod | ( | ) |
returns True if the class has at least one constructor method variant
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
bool Qore::Reflection::Class::hasCopyMethod | ( | ) |
returns True if the class has a copy method
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
bool Qore::Reflection::Class::hasDestructorMethod | ( | ) |
returns True if the class has a destructor method
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
int Qore::Reflection::Class::instanceOf | ( | object | obj | ) |
Returns the accessibility of the current class in the given object as an access value or 0
if the object does not inherit the class at all.
obj | the object to test |
0
if the object does not inherit the class at all; see Access Constants for possible return values (plus 0
meaning no inheritance) object Qore::Reflection::Class::newObject | ( | ... | ) |
creates an object if the current class with the given arguments
... | the arguments for the cosntructor, if any |
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
CREATE-OBJECT-ERROR | class implements features restricted by current parse options / sandboxing restrictions |
CONSTRUCTOR-IS-PRIVATE | attempt to instantiate an object with a private constructor from outside the class |
ABSTRACT-CLASS-ERROR | thrown if the class has abstract methods |
object Qore::Reflection::Class::newObjectArgs | ( | *softlist | argv | ) |
creates an object if the current class with the arguments for the constructor given as a list
argv | the arguments for the constructor |
PROGRAM-ERROR | thrown if the Program object holding the class has been destroyed |
CREATE-OBJECT-ERROR | class implements features restricted by current parse options / sandboxing restrictions |
CONSTRUCTOR-IS-PRIVATE | attempt to instantiate an object with a private constructor from outside the class |
ABSTRACT-CLASS-ERROR | thrown if the class has abstract methods |