public class XCASSerializer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ARRAY_ELEMENT_TAG |
static java.lang.String |
ARRAY_SIZE_ATTR |
static java.lang.String |
casTagName |
static java.lang.String |
CONTENT_ATTR_NAME |
static java.lang.String |
CURRENT_VERSION |
static java.lang.String |
DEFAULT_DOC_TEXT_FEAT |
static java.lang.String |
DEFAULT_DOC_TYPE_NAME |
static java.lang.String |
ID_ATTR_NAME |
static java.lang.String |
INDEXED_ATTR_NAME |
static java.lang.String |
REF_PREFIX |
static java.lang.String |
TRUE_VALUE |
static java.lang.String |
VERSION_ATTR |
Constructor and Description |
---|
XCASSerializer(TypeSystem ts) |
XCASSerializer(TypeSystem ts,
UimaContext uimaContext) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDocumentTextFeature()
Gets the name of the feature holding the documeng text.
|
java.lang.String |
getDocumentTypeName()
Gets the name of the type representing the document.
|
int |
getNumChildren() |
void |
serialize(CAS cas,
org.xml.sax.ContentHandler contentHandler)
Write the CAS data to a SAX content handler.
|
void |
serialize(CAS cas,
org.xml.sax.ContentHandler contentHandler,
boolean encodeDoc)
Write the CAS data to a SAX content handler.
|
void |
serialize(CAS cas,
org.xml.sax.ContentHandler contentHandler,
boolean encodeDoc,
OutOfTypeSystemData outOfTypeSystemData)
Write the CAS data to a SAX content handler.
|
static void |
serialize(CAS aCAS,
java.io.OutputStream aStream)
Serializes an XCAS to a stream.
|
static void |
serialize(CAS aCAS,
java.io.OutputStream aStream,
boolean isFormattedOutput)
Serializes an XCAS to a stream.
|
void |
setDocumentTextFeature(java.lang.String aDocTextFeature)
Sets the name of the feature holding the documeng text.
|
void |
setDocumentTypeName(java.lang.String aDocTypeName)
Gets the name of the type representing the document.
|
public static final java.lang.String casTagName
public static final java.lang.String VERSION_ATTR
public static final java.lang.String CURRENT_VERSION
public static final java.lang.String DEFAULT_DOC_TYPE_NAME
public static final java.lang.String DEFAULT_DOC_TEXT_FEAT
public static final java.lang.String INDEXED_ATTR_NAME
public static final java.lang.String REF_PREFIX
public static final java.lang.String ID_ATTR_NAME
public static final java.lang.String CONTENT_ATTR_NAME
public static final java.lang.String ARRAY_SIZE_ATTR
public static final java.lang.String ARRAY_ELEMENT_TAG
public static final java.lang.String TRUE_VALUE
public XCASSerializer(TypeSystem ts, UimaContext uimaContext)
public XCASSerializer(TypeSystem ts)
public int getNumChildren()
public void serialize(CAS cas, org.xml.sax.ContentHandler contentHandler) throws java.io.IOException, org.xml.sax.SAXException
cas
- The CAS to be serialized.contentHandler
- The SAX content handler the data is written to.java.io.IOException
org.xml.sax.SAXException
public void serialize(CAS cas, org.xml.sax.ContentHandler contentHandler, boolean encodeDoc) throws java.io.IOException, org.xml.sax.SAXException
cas
- The CAS to be serialized.contentHandler
- The SAX content handler the data is written to.encodeDoc
- If set to false, no uima.tcas.Document structure will be created, and the document
text will not be serialized.java.io.IOException
org.xml.sax.SAXException
public void serialize(CAS cas, org.xml.sax.ContentHandler contentHandler, boolean encodeDoc, OutOfTypeSystemData outOfTypeSystemData) throws java.io.IOException, org.xml.sax.SAXException
cas
- The CAS to be serialized.contentHandler
- The SAX content handler the data is written to.encodeDoc
- If set to false, no uima.tcas.Document structure will be created, and the document
text will not be serialized.outOfTypeSystemData
- data not part of the CAS type system, which should be inserted into the XCAS outputjava.io.IOException
org.xml.sax.SAXException
public java.lang.String getDocumentTypeName()
public void setDocumentTypeName(java.lang.String aDocTypeName)
DEFAULT_DOC_TYPE_NAME
.aDocTypeName
- the document type namepublic java.lang.String getDocumentTextFeature()
public void setDocumentTextFeature(java.lang.String aDocTextFeature)
DEFAULT_DOC_TEXT_FEAT
. If set to null, no _content attribute will be emitted.aDocTextFeature
- the document text featurepublic static void serialize(CAS aCAS, java.io.OutputStream aStream) throws org.xml.sax.SAXException, java.io.IOException
aCAS
- CAS to serialize.aStream
- output stream to which to write the XCAS XML documentorg.xml.sax.SAXException
- if a problem occurs during XCAS serializationjava.io.IOException
- if an I/O failure occurspublic static void serialize(CAS aCAS, java.io.OutputStream aStream, boolean isFormattedOutput) throws org.xml.sax.SAXException, java.io.IOException
aCAS
- CAS to serialize.aStream
- output stream to which to write the XCAS XML documentisFormattedOutput
- if true the XCAS will be serialized formattedorg.xml.sax.SAXException
- if a problem occurs during XCAS serializationjava.io.IOException
- if an I/O failure occursCopyright © 2013. All Rights Reserved.