Interface Io<R extends GraphReader.ReaderBuilder,W extends GraphWriter.WriterBuilder,M extends Mapper.Builder>
public interface Io<R extends GraphReader.ReaderBuilder,W extends GraphWriter.WriterBuilder,M extends Mapper.Builder>
Ties together the core interfaces of an IO format:
GraphReader, GraphWriter and Mapper.
The Io.Builder of an Io instance is supplied to Graph.io(Io.Builder) and the Graph
implementation can then chose to supply an IoRegistry to it before returning it. An Io
implementation should use that IoRegistry to lookup custom serializers to use and register them to the
internal Mapper (if the format has such capability).- Author:
- Stephen Mallette (http://stephen.genoprime.com)
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceIo.Builder<I extends Io>Helps to construct anIoimplementation and should be implemented by every such implementation as that class will be passed toGraph.io(Io.Builder)by the user.static class -
Method Summary
Modifier and TypeMethodDescriptionmapper()Constructs aMapper.Builderwhich is responsible for constructing the abstraction over different serialization methods.reader()Creates aGraphReader.ReaderBuilderimplementation .voidvoidwriteGraph(String file) writer()Creates aGraphWriter.WriterBuilderimplementation .
-
Method Details
-
reader
R reader()Creates aGraphReader.ReaderBuilderimplementation . Implementers should call themapper()function to feed its result to the builder. In this way, custom class serializers registered to theMapper.BuilderbyGraphimplementations will end up being used for the serialization process. -
writer
W writer()Creates aGraphWriter.WriterBuilderimplementation . Implementers should call themapper()function to feed its result to the builder. In this way, custom class serializers registered to theMapper.BuilderbyGraphimplementations will end up being used for the serialization process. -
mapper
M mapper()Constructs aMapper.Builderwhich is responsible for constructing the abstraction over different serialization methods. Implementations should set defaults as required, but most importantly need to make the appropriate call toMapper.Builder.addRegistry(IoRegistry)which will provide the builder with any required custom serializers of theGraph. -
writeGraph
- Throws:
IOException
-
readGraph
- Throws:
IOException
-