y.io.graphml.output
Class TypeBasedSerializer
java.lang.Object
y.io.graphml.output.AbstractSerializer
y.io.graphml.output.TypeBasedSerializer
- All Implemented Interfaces:
- EventListener, SerializationHandler
public abstract class TypeBasedSerializer
- extends AbstractSerializer
Convenience base class for implementations of AbstractSerializer
that uses type information
for the predicate.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TypeBasedSerializer
public TypeBasedSerializer()
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 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.