public abstract class AnnotationSerializer
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
AnnotationSerializer.IntermediateEdge |
static class |
AnnotationSerializer.IntermediateNode |
static class |
AnnotationSerializer.IntermediateSemanticGraph |
Constructor and Description |
---|
AnnotationSerializer() |
Modifier and Type | Method and Description |
---|---|
abstract Pair<Annotation,java.io.InputStream> |
read(java.io.InputStream is)
Read a single object from this stream.
|
Pair<CoreDocument,java.io.InputStream> |
readCoreDocument(java.io.InputStream is)
Read in a CoreDocument from this input stream.
|
abstract java.io.OutputStream |
write(Annotation corpus,
java.io.OutputStream os)
Append a single object to this stream.
|
java.io.OutputStream |
writeCoreDocument(CoreDocument document,
java.io.OutputStream os)
Append a CoreDocument to this output stream.
|
public abstract java.io.OutputStream write(Annotation corpus, java.io.OutputStream os) throws java.io.IOException
corpus
- The document to serialize to the stream.os
- The output stream to serialize to.java.io.IOException
- Thrown if the underlying output stream throws the exception.public abstract Pair<Annotation,java.io.InputStream> read(java.io.InputStream is) throws java.io.IOException, java.lang.ClassNotFoundException, java.lang.ClassCastException
is
- The input stream to read a document from.java.io.IOException
- Thrown if the underlying stream throws the exception.java.lang.ClassNotFoundException
- Thrown if an object was read that does not exist in the classpath.java.lang.ClassCastException
- Thrown if the signature of a class changed in way that was incompatible with the serialized document.public java.io.OutputStream writeCoreDocument(CoreDocument document, java.io.OutputStream os) throws java.io.IOException
document
- The CoreDocument to serialize (its internal annotation is serialized)os
- The output stream to serialize tojava.io.IOException
public Pair<CoreDocument,java.io.InputStream> readCoreDocument(java.io.InputStream is) throws java.io.IOException, java.lang.ClassNotFoundException, java.lang.ClassCastException
is
- The input stream to read a CoreDocument's annotation fromjava.io.IOException
java.lang.ClassNotFoundException
java.lang.ClassCastException