Package | com.yworks.support |
Class | public class CallbackLookup |
Inheritance | CallbackLookup Object |
Implements | ILookup |
ILookup
interface
by delegating to a callback function.
To serve as a lookup callback, the function has to take a subject and type parameter,
and return an Object (or null
):
function lookupCallback( subject:Object, type:Class ):Object { // .. }
Property | Defined By | ||
---|---|---|---|
handler : Function
Gets or sets the actual callback implementation. | CallbackLookup | ||
subject : Object
Gets or sets the subject to use for calls to the lookup callback. | CallbackLookup |
Method | Defined By | ||
---|---|---|---|
CallbackLookup(callback:Function, subject:Object = null)
Creates this instance using the specified callback and subject. | CallbackLookup | ||
lookup(type:Class):Object
Performs the actual lookup operation. | CallbackLookup |
handler | property |
handler:Function
Gets or sets the actual callback implementation.
public function get handler():Function
public function set handler(value:Function):void
subject | property |
subject:Object
Gets or sets the subject to use for calls to the lookup callback.
public function get subject():Object
public function set subject(value:Object):void
CallbackLookup | () | Constructor |
public function CallbackLookup(callback:Function, subject:Object = null)
Creates this instance using the specified callback
and subject
.
callback:Function — The callback to use for lookup calls.
| |
subject:Object (default = null ) — The subject to use for calls to the lookup callback. May be null .
|
lookup | () | method |
public function lookup(type:Class):Object
Performs the actual lookup
operation.
If a handler
is specified, that handler is used to perform the query.
Parameters
type:Class — The type to query
|
Object — The result of the query or null if the handler is null .
|