Class TComponentReflection
TComponentReflection class.
TComponentReflection provides functionalities to inspect the public/protected properties, events and methods defined in a class. The following code displays the properties and events defined in TDataGrid,
Constructor Summary |
public |
Constructor.
|
Method Summary |
protected
string
|
Determines the property type.
|
string
|
|
array
|
|
array
|
|
array
|
|
Methods Inherited From TComponent |
TComponent::addParsedObject(), TComponent::attachEventHandler(), TComponent::canGetProperty(), TComponent::canSetProperty(), TComponent::createdOnTemplate(), TComponent::detachEventHandler(), TComponent::evaluateExpression(), TComponent::evaluateStatements(), TComponent::getEventHandlers(), TComponent::getSubProperty(), TComponent::hasEvent(), TComponent::hasEventHandler(), TComponent::hasProperty(), TComponent::raiseEvent(), TComponent::setSubProperty(), TComponent::__get(), TComponent::__set()
|
Constructor Details |
__construct
Constructor.
Throws:
TInvalidDataTypeException if the object is not a component
|
Method Details |
determinePropertyType
protected string determinePropertyType |
(ReflectionMethod $method ) |
Determines the property type.
This method uses the doc comment to determine the property type.
Input |
ReflectionMethod | $method | |
Output |
string
| the property type, '{unknown}' if type cannot be determined from comment |
Exception |
|
getClassName
public string getClassName |
() |
Output |
string
| class name of the component |
Exception |
|
getEvents
public array getEvents |
() |
Output |
array
| list of component events. Array keys are event names. Each array element is of the following structure: [protected]=>whether the event is protected or not [class]=>the class where the event is inherited from. [comments]=>comments associated with the event. |
Exception |
|
getMethods
public array getMethods |
() |
Output |
array
| list of public/protected methods. Array keys are method names. Each array element is of the following structure: [protected]=>whether the method is protected or not [static]=>whether the method is static or not [class]=>the class where the property is inherited from, [comments]=>comments associated with the event. |
Exception |
|
getProperties
public array getProperties |
() |
Output |
array
| list of component properties. Array keys are property names. Each array element is of the following structure: [type]=>property type, [readonly]=>whether the property is read-only, [protected]=>whether the method is protected or not [class]=>the class where the property is inherited from, [comments]=>comments associated with the property. |
Exception |
|
|