Search this API

y.io.graphml.output
Class TypeBasedSerializer

java.lang.Object
  extended by y.io.graphml.output.AbstractSerializer
      extended by y.io.graphml.output.TypeBasedSerializer
All Implemented Interfaces:
java.util.EventListener, SerializationHandler

public abstract class TypeBasedSerializer
extends AbstractSerializer

Convenience base class for implementations of AbstractSerializer that uses type information for the predicate.

 
Your browser does not support SVG content.

Constructor Summary
TypeBasedSerializer()
           
 
Method Summary
 boolean canHandle(SerializationEvent e)
          Checks whether the current item has the correct type.
protected abstract  java.lang.Class getSerializationType(GraphMLWriteContext context)
          Gets the type for which this instance should handle serialization.
 
Methods inherited from class y.io.graphml.output.AbstractSerializer
onHandleSerialization, serializeItem
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeBasedSerializer

public TypeBasedSerializer()
Method Detail

canHandle

public boolean canHandle(SerializationEvent e)
Checks whether the current item has the correct type. This implementation returns true iff item != null && item.getClass() == getSerializationType(context).
Note: This means that this instance does not handle subclasses of getSerializationType(GraphMLWriteContext)

Specified by:
canHandle in class AbstractSerializer
Parameters:
e - The current event argument
Returns:
true iff item != null && item.getClass() == getSerializationType(context).

getSerializationType

protected abstract java.lang.Class getSerializationType(GraphMLWriteContext context)
Gets the type for which this instance should handle serialization.

Parameters:
context - The current write context.
Returns:
The type for which this instance should handle serialization.

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