Packages:
default
System
System.Caching
System.Collections
System.Data
System.Data.ActiveRecord
System.Data.ActiveRecord.Relations
System.Data.ActiveRecord.Scaffold
System.Data.ActiveReecord.Scaffold.InputBuilder
System.Data.Commom.Sqlite
System.Data.Common
System.Data.Common.Mssql
System.Data.Common.Mysql
System.Data.Common.Oracle
System.Data.Common.Pgsql
System.Data.Common.Sqlite
System.Data.DataGateway
System.Data.SqlMap
System.Data.SqlMap.Configuration
System.Data.SqlMap.Statements
System.Exceptions
System.I18N
System.IO
System.Security
System.Util
System.Web
System.Web.Services
System.Web.UI
System.Web.UI.ActiveControls
System.Web.UI.WebControls
System.Web.UI.WebControls.assets
System.Xml


Classes:
Keyword

Class TComponentReflection

TComponent
   |
   --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,

  1. $reflection=new TComponentReflection('TDataGrid');
  2. Prado::varDump($reflection->getProperties());
  3. Prado::varDump($reflection->getEvents());

Since: 3.0
Author: Qiang Xue <qiang.xue@gmail.com>

Constructor Summary
public
__construct Array
Constructor.

Method Summary
protected  string
determinePropertyType ( ReflectionMethod $method)
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

public __construct Array

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