Class: ReflectionObject

ReflectionObject

Base class of all reflection objects.

abstractnew ReflectionObject(name, options)

Constructs a new reflection object instance.

Name Type Description
name string

Object name

options Object.<string, *> optional

Declared options

Members

comment { string | null }

Comment text, if any.

filename { string | null }

Defining file name.

fullName readonly{ string }

Full name including leading dot.

name { string }

Unique name within its namespace.

options { Object<string, *> | undefined }

Options.

parent { Namespace | null }

Parent namespace.

resolved { boolean }

Whether already resolved or not.

root readonly{ Root }

Reference to the root namespace.

Methods

getOption(name){ * }

Gets an option value.

Name Type Description
name string

Option name

Returns:
Type Description
* Option value or undefined if not set

onAdd(parent){ undefined }

Called when this object is added to a parent.

Name Type Description
parent ReflectionObject

Parent added to

Returns:
Type Description
undefined

onRemove(parent){ undefined }

Called when this object is removed from a parent.

Name Type Description
parent ReflectionObject

Parent removed from

Returns:
Type Description
undefined

Resolves this objects type references.

Returns:
Type Description
ReflectionObject this

setOption(name, value, ifNotSet){ ReflectionObject }

Sets an option.

Name Type Description
name string

Option name

value *

Option value

ifNotSet boolean optional

Sets the option only if it isn't currently set

Returns:
Type Description
ReflectionObject this

setOptions(options, ifNotSet){ ReflectionObject }

Sets multiple options.

Name Type Description
options Object.<string, *>

Options to set

ifNotSet boolean optional

Sets an option only if it isn't currently set

Returns:
Type Description
ReflectionObject this

abstracttoJSON(){ Object<string, *> }

Converts this reflection object to its descriptor representation.

Returns:
Type Description
Object.<string, *> Descriptor

toString(){ string }

Converts this instance to its string representation.

Returns:
Type Description
string Class name[, space, full name]