Packageweavejs.core
Classpublic class LinkableWatcher
InheritanceLinkableWatcher Inheritance Object
Implements ILinkableObject, IDisposableObject
Subclasses LinkableDynamicObject

This is used to dynamically attach a set of callbacks to different targets. The callbacks of the LinkableWatcher will be triggered automatically when the target triggers callbacks, changes, becomes null or is disposed.



Public Properties
 PropertyDefined By
  foundPlaceholder : Boolean
[read-only] Checks if the target is currently a placeholder for an instance of an async class.
LinkableWatcher
  root : ILinkableObject
This is the root object to which targetPath is relative.
LinkableWatcher
  target : ILinkableObject
This is the linkable object currently being watched.
LinkableWatcher
  targetPath : Array
This is the path that is currently being watched for linkable object targets.
LinkableWatcher
Protected Properties
 PropertyDefined By
  _targetPath : Array
LinkableWatcher
  _typeRestriction : Class
LinkableWatcher
Public Methods
 MethodDefined By
  
LinkableWatcher(typeRestriction:Class = null, immediateCallback:Function = null, groupedCallback:Function = null)
Instead of calling this constructor directly, consider using one of the global functions newLinkableChild() or newDisposableChild() to make sure the watcher will get disposed automatically.
LinkableWatcher
  
dispose():void
LinkableWatcher
Protected Methods
 MethodDefined By
  
This sets the new target to be watched without resetting targetPath.
LinkableWatcher
Property Detail
_targetPathproperty
protected var _targetPath:Array

_typeRestrictionproperty 
protected var _typeRestriction:Class

foundPlaceholderproperty 
foundPlaceholder:Boolean  [read-only]

Checks if the target is currently a placeholder for an instance of an async class.


Implementation
    public function get foundPlaceholder():Boolean

See also

rootproperty 
root:ILinkableObject

This is the root object to which targetPath is relative.


Implementation
    public function get root():ILinkableObject
    public function set root(value:ILinkableObject):void
targetproperty 
target:ILinkableObject

This is the linkable object currently being watched. Setting this will unset the targetPath.


Implementation
    public function get target():ILinkableObject
    public function set target(value:ILinkableObject):void
targetPathproperty 
targetPath:Array

This is the path that is currently being watched for linkable object targets.


Implementation
    public function get targetPath():Array
    public function set targetPath(value:Array):void
Constructor Detail
LinkableWatcher()Constructor
public function LinkableWatcher(typeRestriction:Class = null, immediateCallback:Function = null, groupedCallback:Function = null)

Instead of calling this constructor directly, consider using one of the global functions newLinkableChild() or newDisposableChild() to make sure the watcher will get disposed automatically.

Parameters
typeRestriction:Class (default = null) — Optionally restricts which type of targets this watcher accepts.
 
immediateCallback:Function (default = null) — A function to add as an immediate callback.
 
groupedCallback:Function (default = null) — A function to add as a grouped callback.

See also

weave.api.core.newLinkableChild()
weave.api.core.newDisposableChild()
Method Detail
dispose()method
public function dispose():void

internalSetTarget()method 
protected function internalSetTarget(newTarget:ILinkableObject):void

This sets the new target to be watched without resetting targetPath. Callbacks will be triggered immediately if the new target is different from the old one.

Parameters

newTarget:ILinkableObject