| Package | com.yworks.io.graphml |
| Class | public class GraphMLContext |
| Implements | IContextLookup, ILookup, ILookupDecorator |
| Subclasses | GraphMLParseContext, GraphMLWriteContext |
| Property | Defined by | ||
|---|---|---|---|
| containers : List
[read-only]
Returns the list of container objects stored in this context.
| GraphMLContext | ||
| lastContainer : Object [read-only]
Return the last container object stored in this context.
| GraphMLContext | ||
| Property | Defined by | ||
|---|---|---|---|
| _containers : ArrayList
A list of container objects.
| GraphMLContext | ||
| _myLookupChain : LookupChain
The lookup chain
| GraphMLContext | ||
| _properties : IMapper
The properties stored in this context.
| GraphMLContext | ||
| Method | Defined by | ||
|---|---|---|---|
|
Creates a new instance.
| GraphMLContext | ||
|
addLookup(type:Class, lookup:IContextLookupChainLink):void
Adds a lookup chain element to the chain of lookups for a given type.
| GraphMLContext | ||
|
canDecorate(type:Class):Boolean
Determines whether this instance can be used to decorate the lookup for a certain type.
| GraphMLContext | ||
|
getContainer(clazz:Class):Object
Get the last container stored in the context that can be casted to the given class.
| GraphMLContext | ||
|
getProperty(name:String):Object
Retrieve a context property.
| GraphMLContext | ||
|
lookup(type:Class):Object
Returns an instance that implements the given type or
null. | GraphMLContext | ||
|
lookupForItem(item:Object, type:Class):Object
Tries to create or retrieve an implementation of the given type
for a given item.
| GraphMLContext | ||
|
popGraphMLElement():void
Remove the last container that was added to the container list.
| GraphMLContext | ||
|
pushGraphMLElement(element:Object):void
Append the given container object to the list of container objects.
| GraphMLContext | ||
|
removeLookup(type:Class, lookup:IContextLookupChainLink):void
Removes a previously registered lookup chain element from the chain of lookups for a given type.
| GraphMLContext | ||
|
setLookup(c:Class, o:Object):void
Map the given class to the given object.
| GraphMLContext | ||
|
setProperty(name:String, value:Object):void
Set a context property.
| GraphMLContext | ||
| _containers | property |
protected var _containers:ArrayListA list of container objects.
| containers | property |
containers:List [read-only]Returns the list of container objects stored in this context.
Implementation public function get containers():List
| lastContainer | property |
lastContainer:Object [read-only]Return the last container object stored in this context.
Implementation public function get lastContainer():Object
| _myLookupChain | property |
protected var _myLookupChain:LookupChainThe lookup chain
| _properties | property |
protected var _properties:IMapperThe properties stored in this context.
| GraphMLContext | () | constructor |
public function GraphMLContext()Creates a new instance.
| addLookup | () | method |
public function addLookup(type:Class, lookup:IContextLookupChainLink):voidAdds a lookup chain element to the chain of lookups for a given type.
The lookup chain is context specific. This method will not generally decorate the
lookup of all instances of type type, but only those that
stand in context of this instance.
This method will only succeed if canDecorate
yields true for type.
type:Class — The type to decorate the lookup.
|
|
lookup:IContextLookupChainLink — The chain element to add to the lookup of the given type.
|
| canDecorate | () | method |
public function canDecorate(type:Class):BooleanDetermines whether this instance can be used to decorate the lookup for a certain type.
Parameterstype:Class — The type to decorate the lookup for.
|
Boolean — true if this instance can be used to decorate the lookup for the given type.
|
| getContainer | () | method |
public function getContainer(clazz:Class):Object
Get the last container stored in the context that can be casted to the given class.
If no such container is found, this method return null.
clazz:Class — The class for whose instance the context will be searched.
|
Object — the last container stored in the context which is an instance of clazz. null if none is found.
|
| getProperty | () | method |
public function getProperty(name:String):ObjectRetrieve a context property.
Parametersname:String — The key to which the property is mapped.
|
Object — The context which is mapped to the name.
|
| lookup | () | method |
public function lookup(type:Class):Object
Returns an instance that implements the given type or null.
Typically, this method will be called in order to obtain a different view or
aspect of the current instance. This is quite similar to casting or using
a super type or interface of this instance, but is not limited to inheritance or
compile time constraints. An instance implementing this method is not
required to return non-null implementations for the types, nor does it
have to return the same instance any time. Also it depends on the
type and context whether the instance returned stays up to date or needs to
be reobtained for subsequent use.
type:Class — the type for which an instance shall be returned
|
Object — an instance that is assignable to type or null
|
| lookupForItem | () | method |
public function lookupForItem(item:Object, type:Class):ObjectTries to create or retrieve an implementation of the given type for a given item.
Parametersitem:Object — the item to lookup a type for
|
|
type:Class — the type to look up
|
Object — an implementation or null
|
| popGraphMLElement | () | method |
public function popGraphMLElement():voidRemove the last container that was added to the container list.
| pushGraphMLElement | () | method |
public function pushGraphMLElement(element:Object):voidAppend the given container object to the list of container objects.
Parameterselement:Object — container object to add.
|
| removeLookup | () | method |
public function removeLookup(type:Class, lookup:IContextLookupChainLink):voidRemoves a previously registered lookup chain element from the chain of lookups for a given type.
Parameterstype:Class — The type to remove the decorator from.
|
|
lookup:IContextLookupChainLink — The chain element to remove from the lookup of the given type.
|
| setLookup | () | method |
public function setLookup(c:Class, o:Object):void
Map the given class to the given object. The object can be retrieved using lookup( c ).
c:Class — The class to be mapped.
|
|
o:Object — The object to be mapped.
|
| setProperty | () | method |
public function setProperty(name:String, value:Object):voidSet a context property.
Parametersname:String — The property's name.
|
|
value:Object — The property.
|