Introspectable
Direct Subclass:
Base class to build easily classes.
Example:
Property record format:
{
name:string,
type:string,
value:any,
private:boolean,
getter:boolean,
setter:boolean,
tester:boolean
}
API:
->has_property(arg_name):boolean - test if instance has given named property.
->add_property(arg_record:object):boolean - add given named property.
->set_property_value(arg_name, arg_value)
->set_properties_values(arg_values:object|array):boolean - set properties values with arg_values as { prop_name_1:value1, ... }
->has_method(arg_name):boolean - test if instance has given named method.
->add_method(arg_record:object):boolean - add given named method.
Constructor Summary
Public Constructor | ||
public |
constructor(arg_properties: object, arg_methods: object, arg_values: object | undefined): nothing Create an Introspectable instance. |
Member Summary
Public Members | ||
public |
Property getter. |
|
public |
Property tester. |
|
public |
Property setter. |
|
public |
[_name]: any Property value. |
|
public |
[name]: any Property value. |
|
public |
Class type flag. |
Private Members | ||
private |
Methods map. |
|
private |
_methods_names: array Methods names array. |
|
private |
Properties map. |
|
private |
_properties_names: array Properties names array. |
Method Summary
Public Methods | ||
public |
add_property(arg_record: object): boolean Test if instance has given named property. |
|
public |
Get properties values. |
|
public |
get_property_value(arg_name: string): any Get a property value. |
|
public |
has_method(arg_name: string): boolean Test if instance has given named method. |
|
public |
has_property(arg_name: string): boolean Test if instance has given named property. |
|
public |
set_properties_values(arg_values: object | array): boolean Set properties values. |
|
public |
set_property_value(arg_name: string, arg_value: any, arg_this_name: string): boolean Set a property value. |
Public Constructors
Public Members
Private Members
Public Methods
public add_property(arg_record: object): boolean source
Test if instance has given named property.
Params:
Name | Type | Attribute | Description |
arg_record | object | property record. |
public get_property_value(arg_name: string): any source
Get a property value.
Params:
Name | Type | Attribute | Description |
arg_name | string | property name. |
Return:
any | property value. |
public has_method(arg_name: string): boolean source
Test if instance has given named method.
Params:
Name | Type | Attribute | Description |
arg_name | string | method name. |
public has_property(arg_name: string): boolean source
Test if instance has given named property.
Params:
Name | Type | Attribute | Description |
arg_name | string | property name. |