public class XmiCasSerializer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_NAMESPACE_URI
Namespace URI to use for UIMA types that have no namespace (the "default pacakge" in Java)
|
static java.lang.String |
ID_ATTR_NAME |
static java.lang.String |
INDEXED_ATTR_NAME |
static int |
TYPE_CLASS_FLOATLIST |
static int |
TYPE_CLASS_FSLIST |
static int |
TYPE_CLASS_INTLIST |
static int |
TYPE_CLASS_STRINGLIST |
static java.lang.String |
XMI_NS_PREFIX |
static java.lang.String |
XMI_NS_URI |
static org.apache.uima.internal.util.XmlElementName |
XMI_TAG |
static java.lang.String |
XMI_TAG_LOCAL_NAME |
static java.lang.String |
XMI_TAG_QNAME |
static java.lang.String |
XMI_VERSION_LOCAL_NAME |
static java.lang.String |
XMI_VERSION_QNAME |
static java.lang.String |
XMI_VERSION_VALUE |
static java.lang.String |
XMLNS_NS_URI |
static java.lang.String |
XSI_NS_URI |
Constructor and Description |
---|
XmiCasSerializer(TypeSystem ts)
Creates a new XmiCasSerializer.
|
XmiCasSerializer(TypeSystem ts,
java.util.Map<java.lang.String,java.lang.String> nsUriToSchemaLocationMap)
Creates a new XmiCasSerializer.
|
XmiCasSerializer(TypeSystem ts,
UimaContext uimaContext)
Deprecated.
Use
XmiCasSerializer(TypeSystem) instead. The UimaContext reference is
never used by this implementation. |
XmiCasSerializer(TypeSystem ts,
UimaContext uimaContext,
java.util.Map<java.lang.String,java.lang.String> nsUriToSchemaLocationMap)
Deprecated.
Use
XmiCasSerializer(TypeSystem, Map) instead. The UimaContext reference
is never used by this implementation. |
Modifier and Type | Method and Description |
---|---|
int |
getNumChildren()
Gets the number of children of the current element.
|
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,
org.xml.sax.ErrorHandler errorHandler)
Write the CAS data to a SAX content handler.
|
void |
serialize(CAS cas,
org.xml.sax.ContentHandler contentHandler,
org.xml.sax.ErrorHandler errorHandler,
XmiSerializationSharedData sharedData)
Write the CAS data to a SAX content handler.
|
void |
serialize(CAS cas,
org.xml.sax.ContentHandler contentHandler,
org.xml.sax.ErrorHandler errorHandler,
XmiSerializationSharedData sharedData,
Marker marker)
Write the CAS data to a SAX content handler.
|
static void |
serialize(CAS aCAS,
java.io.OutputStream aStream)
Serializes a CAS to an XMI stream.
|
static void |
serialize(CAS aCAS,
TypeSystem aTargetTypeSystem,
java.io.OutputStream aStream)
Serializes a CAS to an XMI stream.
|
static void |
serialize(CAS aCAS,
TypeSystem aTargetTypeSystem,
java.io.OutputStream aStream,
boolean aPrettyPrint,
XmiSerializationSharedData aSharedData)
Serializes a CAS to an XMI stream.
|
static void |
serialize(CAS aCAS,
TypeSystem aTargetTypeSystem,
java.io.OutputStream aStream,
boolean aPrettyPrint,
XmiSerializationSharedData aSharedData,
Marker aMarker)
Serializes a Delta CAS to an XMI stream.
|
public static final int TYPE_CLASS_INTLIST
public static final int TYPE_CLASS_FLOATLIST
public static final int TYPE_CLASS_STRINGLIST
public static final int TYPE_CLASS_FSLIST
public static final java.lang.String XMLNS_NS_URI
public static final java.lang.String XMI_NS_URI
public static final java.lang.String XSI_NS_URI
public static final java.lang.String XMI_NS_PREFIX
public static final java.lang.String XMI_TAG_LOCAL_NAME
public static final java.lang.String XMI_TAG_QNAME
public static final org.apache.uima.internal.util.XmlElementName XMI_TAG
public static final java.lang.String INDEXED_ATTR_NAME
public static final java.lang.String ID_ATTR_NAME
public static final java.lang.String XMI_VERSION_LOCAL_NAME
public static final java.lang.String XMI_VERSION_QNAME
public static final java.lang.String XMI_VERSION_VALUE
public static final java.lang.String DEFAULT_NAMESPACE_URI
public XmiCasSerializer(TypeSystem ts, java.util.Map<java.lang.String,java.lang.String> nsUriToSchemaLocationMap)
ts
- the TypeSystem of CASes that will be serialized. If any CAS that is later passed to
the serialize
method that contains types and features that are not in
this typesystem, the serialization will not contain instances of those types or values
for those features. So this can be used to filter the results of serialization.nsUriToSchemaLocationMap
- Map if supplied, this map is used to generate a "schemaLocation" attribute in the XMI
output. This argument must be a map from namespace URIs to the schema location for
that namespace URI.public XmiCasSerializer(TypeSystem ts)
ts
- the TypeSystem of CASes that will be serialized. If any CAS that is later passed to
the serialize
method that contains types and features that are not in
this typesystem, the serialization will not contain instances of those types or values
for those features. So this can be used to filter the results of serialization.
A null value indicates that all types and features will be serialized.@Deprecated public XmiCasSerializer(TypeSystem ts, UimaContext uimaContext, java.util.Map<java.lang.String,java.lang.String> nsUriToSchemaLocationMap)
XmiCasSerializer(TypeSystem, Map)
instead. The UimaContext reference
is never used by this implementation.ts
- the TypeSystem of CASes that will be serialized. If any CAS that is later passed to
the serialize
method that contains types and features that are not in
this typesystem, the serialization will not contain instances of those types or values
for those features. So this can be used to filter the results of serialization.uimaContext
- not usednsUriToSchemaLocationMap
- Map if supplied, this map is used to generate a "schemaLocation" attribute in the XMI
output. This argument must be a map from namespace URIs to the schema location for
that namespace URI.@Deprecated public XmiCasSerializer(TypeSystem ts, UimaContext uimaContext)
XmiCasSerializer(TypeSystem)
instead. The UimaContext reference is
never used by this implementation.ts
- the TypeSystem of CASes that will be serialized. If any CAS that is later passed to
the serialize
method that contains types and features that are not in
this typesystem, the serialization will not contain instances of those types or values
for those features. So this can be used to filter the results of serialization.uimaContext
- not usedpublic int getNumChildren()
NOTE: this method will not work if there are simultaneously executing calls to XmiCasSerializer.serialize. Use it only with a dedicated XmiCasSerializer instance that is not shared between threads.
public void serialize(CAS cas, org.xml.sax.ContentHandler contentHandler) throws org.xml.sax.SAXException
cas
- The CAS to be serialized.contentHandler
- The SAX content handler the data is written to. should be inserted into the XCAS
outputorg.xml.sax.SAXException
- if there was a SAX exceptionpublic void serialize(CAS cas, org.xml.sax.ContentHandler contentHandler, org.xml.sax.ErrorHandler errorHandler) throws org.xml.sax.SAXException
cas
- The CAS to be serialized.contentHandler
- The SAX content handler the data is written to. should be inserted into the XCAS
outputerrorHandler
- the SAX Error Handler to useorg.xml.sax.SAXException
- if there was a SAX exceptionpublic void serialize(CAS cas, org.xml.sax.ContentHandler contentHandler, org.xml.sax.ErrorHandler errorHandler, XmiSerializationSharedData sharedData) throws org.xml.sax.SAXException
cas
- The CAS to be serialized.contentHandler
- The SAX content handler the data is written to. should be inserted into the XCAS
outputsharedData
- data structure used to allow the XmiCasSerializer and XmiCasDeserializer to share
information.errorHandler
- the SAX Error Handler to useorg.xml.sax.SAXException
- if there was a SAX exceptionpublic void serialize(CAS cas, org.xml.sax.ContentHandler contentHandler, org.xml.sax.ErrorHandler errorHandler, XmiSerializationSharedData sharedData, Marker marker) throws org.xml.sax.SAXException
cas
- The CAS to be serialized.contentHandler
- The SAX content handler the data is written to. should be inserted into the XCAS
outputerrorHandler
- the SAX Error Handler to usesharedData
- data structure used to allow the XmiCasSerializer and XmiCasDeserializer to share
information.marker
- an object used to filter the FSs and Views to determine if these were created after
the mark was set. Used to serialize a Delta CAS consisting of only new FSs and views and
preexisting FSs and Views that have been modified.org.xml.sax.SAXException
- if there was a SAX exceptionpublic static void serialize(CAS aCAS, java.io.OutputStream aStream) throws org.xml.sax.SAXException
aCAS
- CAS to serialize.aStream
- output stream to which to write the XMI documentorg.xml.sax.SAXException
- if a problem occurs during XMI serializationpublic static void serialize(CAS aCAS, TypeSystem aTargetTypeSystem, java.io.OutputStream aStream) throws org.xml.sax.SAXException
aCAS
- CAS to serialize.aTargetTypeSystem
- type system to which the produced XMI will conform. Any types or features not in the
target type system will not be serialized. A null value indicates that all types and features
will be serialized.aStream
- output stream to which to write the XMI documentorg.xml.sax.SAXException
- if a problem occurs during XMI serializationpublic static void serialize(CAS aCAS, TypeSystem aTargetTypeSystem, java.io.OutputStream aStream, boolean aPrettyPrint, XmiSerializationSharedData aSharedData) throws org.xml.sax.SAXException
aCAS
- CAS to serialize.aTargetTypeSystem
- type system to which the produced XMI will conform. Any types or features not in the
target type system will not be serialized. A null value indicates that all types and features
will be serialized.aStream
- output stream to which to write the XMI documentaPrettyPrint
- if true the XML output will be formatted with newlines and indenting. If false it will be unformatted.aSharedData
- an optional container for data that is shared between the XmiCasSerializer
and the XmiCasDeserializer
.
See the JavaDocs for XmiSerializationSharedData
for details.org.xml.sax.SAXException
- if a problem occurs during XMI serializationpublic static void serialize(CAS aCAS, TypeSystem aTargetTypeSystem, java.io.OutputStream aStream, boolean aPrettyPrint, XmiSerializationSharedData aSharedData, Marker aMarker) throws org.xml.sax.SAXException
aCAS
- CAS to serialize.aTargetTypeSystem
- type system to which the produced XMI will conform. Any types or features not in the
target type system will not be serialized. A null value indicates that all types and features
will be serialized.aStream
- output stream to which to write the XMI documentaPrettyPrint
- if true the XML output will be formatted with newlines and indenting. If false it will be unformatted.aSharedData
- an optional container for data that is shared between the XmiCasSerializer
and the XmiCasDeserializer
.
See the JavaDocs for XmiSerializationSharedData
for details.aMarker
- an optional object that is used to filter and serialize a Delta CAS containing only
those FSs and Views created after Marker was set and preexisting FSs and views that were modified.
See the JavaDocs for Marker
for details.org.xml.sax.SAXException
- if a problem occurs during XMI serializationCopyright © 2006–2014 The Apache Software Foundation. All rights reserved.