Packageorg.granite.reflect.visitor
Classpublic class Visitable

A Visitable instance encapsulates a bean, a property of a bean or an item of a collection (at arbitrary depth).



Public Properties
 PropertyDefined by
  data : *
An arbitrary user data attached to this Visitable.
Visitable
  element : IVisitableElement
[read-only] The type of this Visitable.
Visitable
  parent : Visitable
[read-only] The parent of this Visitable (null if this Visitable is a root bean).
Visitable
  path : String
[read-only] The string representation of the path from the root visitable to this Visitable (this representation is dot-separated, even for a collection index or a map key, and is only meant to be used for tracing).
Visitable
  property : String
[read-only] The name of the property represented by this Visitable (may be null if this Visitable doesn't represent a property).
Visitable
  root : Visitable
[read-only] The root parent of this Visitable.
Visitable
  value : *
[read-only] The value of this Visitable.
Visitable
Public Methods
 MethodDefined by
  
Visitable(parent:Visitable, element:IVisitableElement, value:*)
Constructs a new Visitable object.
Visitable
  
isRoot():Boolean
Tells if this Visitable is a root visitable (no parent).
Visitable
  
toString():String
Returns a string representation this Visitable with its full path and its value.
Visitable
Property detail
dataproperty
data:*  [read-write]

An arbitrary user data attached to this Visitable.

Implementation
    public function get data():*
    public function set data(value:*):void
elementproperty 
element:IVisitableElement  [read-only]

The type of this Visitable.

Implementation
    public function get element():IVisitableElement

See also

parentproperty 
parent:Visitable  [read-only]

The parent of this Visitable (null if this Visitable is a root bean).

Implementation
    public function get parent():Visitable
pathproperty 
path:String  [read-only]

The string representation of the path from the root visitable to this Visitable (this representation is dot-separated, even for a collection index or a map key, and is only meant to be used for tracing).

Implementation
    public function get path():String
propertyproperty 
property:String  [read-only]

The name of the property represented by this Visitable (may be null if this Visitable doesn't represent a property).

Implementation
    public function get property():String
rootproperty 
root:Visitable  [read-only]

The root parent of this Visitable.

Implementation
    public function get root():Visitable
valueproperty 
value:*  [read-only]

The value of this Visitable.

Implementation
    public function get value():*
Constructor detail
Visitable()constructor
public function Visitable(parent:Visitable, element:IVisitableElement, value:*)

Constructs a new Visitable object.

Parameters
parent:Visitable — the parent of this Visitable element (may be null if this element is a root).
 
element:IVisitableElement — the type of this Visitable element.
 
value:* — the element to be visited.

Throws
— if the element parameter is null.
Method detail
isRoot()method
public function isRoot():Boolean

Tells if this Visitable is a root visitable (no parent).

Returns
Booleantrue if this Visitable is a root, false otherwise.
toString()method 
public function toString():String

Returns a string representation this Visitable with its full path and its value.

Returns
String — a string representation this Visitable.