Packagecom.yworks.io.graphml.realizer
Interfacepublic interface IWriteResourceHandler

Interface for classes that provide methods to manage shared object resources for the output process



Public Methods
 MethodDefined By
  
Returns the resource descriptor that is registered to the given ID.
IWriteResourceHandler
  
Returns an Iterable over all registered IDs of this handler.
IWriteResourceHandler
  
getResource(id:String):Object
Gets a shared object resource which is registered to the given ID.
IWriteResourceHandler
  
isRegistered(resource:Object):Boolean
Return whether a resource has already been registered at this handler
IWriteResourceHandler
  
Register a shared resource to this handler.
IWriteResourceHandler
Method Detail
getDescriptor()method
public function getDescriptor(id:String):IResourceDescriptor

Returns the resource descriptor that is registered to the given ID.

Parameters

id:String — The ID to get the resource descriptor for.

Returns
IResourceDescriptor — The resource descriptor that is registered to the given ID.
getRegisteredIds()method 
public function getRegisteredIds():Iterable

Returns an Iterable over all registered IDs of this handler.

Returns
Iterable — An Iterable over all registered IDs
getResource()method 
public function getResource(id:String):Object

Gets a shared object resource which is registered to the given ID.

Parameters

id:String — the ID to get the resource for.

Returns
Object — The shared object resource which is registered to the given ID.
isRegistered()method 
public function isRegistered(resource:Object):Boolean

Return whether a resource has already been registered at this handler

Parameters

resource:Object

Returns
Booleantrue iff the resource has already been registered
registerResource()method 
public function registerResource(resource:Object, encoder:IResourceEncoder):IResourceDescriptor

Register a shared resource to this handler. On the first call for a shared object resource, this should create and return a descriptor for the resource. On further calls for the same resource, this should return only the descriptor reference.

The exact semantics which resources are considered as "the same" depends on the actual implementation. The default implementation that is returned by GraphMLWriteContext uses object identity.

Parameters

resource:Object — the shared resource
 
encoder:IResourceEncoder — The encoder instance that is used when the resource is serialized

Returns
IResourceDescriptor — reference that can be used to set further aspects for the resource serialization