|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.uima.cas.impl.XCASSerializer
public class XCASSerializer
XCAS serializer. Create a serializer from a type system, then encode individual CASes by writing to a SAX content handler. This class is thread safe.
Field Summary | |
---|---|
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 Summary | |
---|---|
XCASSerializer(TypeSystem ts)
|
|
XCASSerializer(TypeSystem ts,
UimaContext uimaContext)
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
public XCASSerializer(TypeSystem ts, UimaContext uimaContext)
public XCASSerializer(TypeSystem ts)
Method Detail |
---|
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 output
java.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 document
org.xml.sax.SAXException
- if a problem occurs during XCAS serialization
java.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 formatted
org.xml.sax.SAXException
- if a problem occurs during XCAS serialization
java.io.IOException
- if an I/O failure occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |