A generic mutable implementation of the IContextLookup interface that helps in building IContextLookup and ILookup implementations.
Remarks
Use this class to build an ILookup or IContextLookup implementation.
This class can be used in the context where an ILookupDecorator interface implementation is needed. It serves as a store for a chain of IContextLookupChainLinks for a single given type, which is represented by TDecoratedType
.
Use the getDecoratorFor method to get access to a convenient set of functionality to modify the behavior of this instance.
Type Parameters
- TDecoratedType
- The type of the context objects this instance will be used for.
Type Details
- yFiles module
- view
Constructors
Methods
addGenericLookup
(genericLink: function(TDecoratedType, Constructor, IContextLookup):any) : IContextLookupChainLinkAdds a generic callback as a chain link to the lookup.
Remarks
Parameters
A map of options to pass to the method.
- genericLink - function(TDecoratedType, Constructor, IContextLookup):any
- The generic callback to add to the lookup chain.
Signature Details
function(arg1: TDecoratedType, arg2: Constructor, arg3: IContextLookup) : any
Encapsulates a method that has three parameters and returns a value of the type specified by theTResult
parameter.Parameters
- arg1 - TDecoratedType
- The first parameter of the method that this delegate encapsulates.
- arg2 - Constructor
- The second parameter of the method that this delegate encapsulates.
- arg3 - IContextLookup
- The third parameter of the method that this delegate encapsulates.
Returns
- any
- The return value of the method that this delegate encapsulates.
Returns
- ↪IContextLookupChainLink
- An IContextLookupChainLink that has been added to the lookup.
Adds an IContextLookupChainLink to this instance's managed chain of links.
Parameters
A map of options to pass to the method.
- link - IContextLookupChainLink
- The link to add.
Tries to create or retrieve an implementation of the given type for a given item.
Parameters
A map of options to pass to the method.
- item - any
- the item to look up a type for
- type - Constructor
- the type to look up
Returns
- ↪Object?
- an implementation or
null
See Also
Implements
getDecoratorFor
<TInterface>(interfaceType: Constructor<TInterface>) : LookupDecorator<TDecoratedType,TInterface>Gets a LookupDecorator<TDecoratedType,TInterface> for the given interface type that uses this instance as the backing store.
Remarks
Type Parameters
- TInterface
Returns
- ↪LookupDecorator<TDecoratedType,TInterface>
- A readily configured instance for decorating the
TInterface
type that uses this instance as the backing store.
Typesafe-variant of the contextLookup implementation.
Remarks
Parameters
A map of options to pass to the method.
- item - TDecoratedType
- The item to look up the implementation for.
- type - Constructor
- The type of the implementation to look up.
Returns
- ↪any?
- The implementation or
null
Removes an IContextLookupChainLink from this instance's managed chain of links.
Parameters
A map of options to pass to the method.
- link - IContextLookupChainLink
- The link to remove.