Packagecom.yworks.support
Classpublic class AbstractContextLookupChainLink
InheritanceAbstractContextLookupChainLink Inheritance Object
Implements IContextLookupChainLink

Abstract base class that simplifies the implementation of IContextLookupChainLink.

Subclasses need to override the lookupForItem method in order to be of any use.

See also

IContextLookupChainLink


Public Methods
 MethodDefined By
  
lookupForItem(item:Object, type:Class):Object
Returns the result of a query to the next lookup chain element.
AbstractContextLookupChainLink
  
This method is called by the framework to register the fallback lookup implementation that will be used during a call to super.lookupForItem.
AbstractContextLookupChainLink
Method Detail
lookupForItem()method
public function lookupForItem(item:Object, type:Class):Object

Returns the result of a query to the next lookup chain element.

This implementation returns the result of a query to the next lookup in the chain. A typical override of this method could look like this:

         override public function lookupForItem( item:Object, type:Class ):Object {
           if( type == AType && item is MyType ) {
             var result:Atype = new MyImplementationOfAType();
             return result;
           }
           return super.lookupForItem( item, type );
         }
         

Parameters

item:Object — the item to lookup a type for
 
type:Class — the type to look up

Returns
Object — An implementation or null
setNext()method 
public function setNext(next:IContextLookup):void

This method is called by the framework to register the fallback lookup implementation that will be used during a call to super.lookupForItem.

Parameters

next:IContextLookup