org.graphdrawing.graphml.writer
Interface GraphMLWriteContext.ResourceHandler

Enclosing interface:
GraphMLWriteContext

public static interface GraphMLWriteContext.ResourceHandler

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


Method Summary
 boolean isRegistered(Object resource)
          Return whether a resource has already been registered at this handler
 GraphMLWriteContext.ResourceDescriptor registerResource(Object resource, GraphMLWriteContext.ResourceEncoder encoder)
          Register a shared resource to this handler.
 

Method Detail

registerResource

public GraphMLWriteContext.ResourceDescriptor registerResource(Object resource,
                                                               GraphMLWriteContext.ResourceEncoder encoder)
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 - the shared resource
encoder - The encoder instance that is used when the resource is serialized
Returns:
ResourceDescriptor reference that can be used to set further aspects for the resource serialization

isRegistered

public boolean isRegistered(Object resource)
Return whether a resource has already been registered at this handler

Parameters:
resource -
Returns:
true iff the resource has already been registered


Copyright ©2000-2008, yWorks GmbH. All rights reserved.