Search this API

y.io.graphml.output
Class ComplexDataProviderOutputHandler

java.lang.Object
  extended by y.io.graphml.output.AbstractOutputHandler
      extended by y.io.graphml.output.AbstractDataProviderOutputHandler
          extended by y.io.graphml.output.ComplexDataProviderOutputHandler
All Implemented Interfaces:
java.util.EventListener, OutputHandler, OutputHandlerProvider

public class ComplexDataProviderOutputHandler
extends AbstractDataProviderOutputHandler

An implementation of the AbstractOutputHandler class, that can use a getSerializer() callback for the serialization or delegate to one of GraphMLWriteContext's serialize callbacks.

See Also:
GraphMLWriteContext.serialize(Object), GraphMLWriteContext.serialize(GraphMLWriteContext, Object, Class)
 

Constructor Summary
ComplexDataProviderOutputHandler(java.lang.String name, KeyScope scope, KeyType type)
          Initializes a new instance of the ComplexDataProviderOutputHandler class.
 
Method Summary
 SerializationHandler getSerializer()
          Gets the serialization callback to use for serializing the value in writeValueCore(GraphMLWriteContext, Object).
 java.lang.Class getSourceType()
          Gets the source type of the serialization.
 void setSerializer(SerializationHandler value)
          Sets the serialization callback to use for serializing the value in writeValueCore(GraphMLWriteContext, Object).
 void setSourceType(java.lang.Class value)
          Sets the source type of the serialization.
protected  void writeValueCore(GraphMLWriteContext context, java.lang.Object data)
          Callback method that performs the actual writing of the data using either the getSerializer() or one of GraphMLWriteContext's serialize callbacks.
 
Methods inherited from class y.io.graphml.output.AbstractDataProviderOutputHandler
getDataProvider, getValue, setDataProvider
 
Methods inherited from class y.io.graphml.output.AbstractOutputHandler
addNameToKeyDefinition, addScopeToKeyDefinition, addTypeToKeyDefinition, addUriToKeyDefinition, getDataTagAttributes, getDefaultValue, getKeyDefinitionAttributes, getPrecedence, getScope, getValidScopes, hasDefaultValueAssigned, isDefaultValue, isValidScope, isWriteKeyDefault, onQueryOutputHandler, setDefaultValue, setDefaultValueAssigned, setPrecedence, setScope, setValidScopes, setWriteKeyDefault, writeKeyDefinitionContent, writeValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComplexDataProviderOutputHandler

public ComplexDataProviderOutputHandler(java.lang.String name,
                                        KeyScope scope,
                                        KeyType type)
Initializes a new instance of the ComplexDataProviderOutputHandler class.

Parameters:
name - The name to use for the definition.
scope - The scope of the handler.
type - The type of the data.
Method Detail

setSerializer

public void setSerializer(SerializationHandler value)
Sets the serialization callback to use for serializing the value in writeValueCore(GraphMLWriteContext, Object).

Parameters:
value - The serialization callback or null to indicate that the context should be used instead.
See Also:
setSourceType(Class), getSerializer()

getSerializer

public SerializationHandler getSerializer()
Gets the serialization callback to use for serializing the value in writeValueCore(GraphMLWriteContext, Object).

Returns:
The serialization callback or null to indicate that the context should be used instead.
See Also:
setSourceType(Class), setSerializer(SerializationHandler)

setSourceType

public void setSourceType(java.lang.Class value)
Sets the source type of the serialization.

This type will be used as the SerializationEvent.SourceType().

Parameters:
value - The desired type of the Object that is serialized.
See Also:
SerializationEvent, getSourceType()

getSourceType

public java.lang.Class getSourceType()
Gets the source type of the serialization.

This type will be used as the SerializationEvent.SourceType().

Returns:
The desired type of the Object that is serialized.
See Also:
setSourceType(Class), SerializationEvent

writeValueCore

protected void writeValueCore(GraphMLWriteContext context,
                              java.lang.Object data)
                       throws GraphMLWriteException
Callback method that performs the actual writing of the data using either the getSerializer() or one of GraphMLWriteContext's serialize callbacks.

Specified by:
writeValueCore in class AbstractOutputHandler
Parameters:
context - The context to use for writing.
data - The data to write.
Throws:
GraphMLWriteException
See Also:
GraphMLWriteContext.serialize(Object), GraphMLWriteContext.serialize(GraphMLWriteContext, Object, Class)

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