Reference Source
public class | source

Introspectable

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.

private

Properties map.

private

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

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 constructor(arg_properties: object, arg_methods: object, arg_values: object | undefined): nothing source

Create an Introspectable instance.

Params:

NameTypeAttributeDescription
arg_properties object

properties records as { name:'...', type:'', getter:true, setter: true, tester:true }.

arg_methods object

methods records as { name:'...', type:'', functor:(...)=>{} }

arg_values object | undefined

properties values (optional).

Return:

nothing

Public Members

public ['get_' + name]: function source

Property getter.

public ['has_' + name]: function source

Property tester.

public ['set_' + name]: function source

Property setter.

public [_name]: any source

Property value.

public [name]: any source

Property value.

public is_introspectable: boolean source

Class type flag.

Private Members

private _methods: object source

Methods map.

private _methods_names: array source

Methods names array.

private _properties: object source

Properties map.

private _properties_names: array source

Properties names array.

Public Methods

public add_property(arg_record: object): boolean source

Test if instance has given named property.

Params:

NameTypeAttributeDescription
arg_record object

property record.

Return:

boolean

public get_properties_values(): object source

Get properties values.

Return:

object

properties values.

public get_property_value(arg_name: string): any source

Get a property value.

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
arg_name string

method name.

Return:

boolean

public has_property(arg_name: string): boolean source

Test if instance has given named property.

Params:

NameTypeAttributeDescription
arg_name string

property name.

Return:

boolean

public set_properties_values(arg_values: object | array): boolean source

Set properties values.

Params:

NameTypeAttributeDescription
arg_values object | array

properties values.

Return:

boolean

public set_property_value(arg_name: string, arg_value: any, arg_this_name: string): boolean source

Set a property value.

Params:

NameTypeAttributeDescription
arg_name string

property name.

arg_value any

property value.

arg_this_name string

property attribute name.

Return:

boolean