public class CasSerializerSupport.CasDocSerializer extends Object
| Modifier and Type | Field and Description |
|---|---|
CASImpl |
cas |
TypeSystemImpl |
filterTypeSystem |
org.apache.uima.internal.util.IntVector[] |
indexedFSs |
boolean |
isDelta
Whether the serializer needs to serialize only the deltas, that is, new FSs created after
mark represented by Marker object and preexisting FSs and Views that have been
modified.
|
boolean |
isDynamicMultiRef
Set to true for JSON configuration of using dynamic multi-ref detection for arrays and lists
|
boolean |
isFiltering
Whether the serializer needs to check for filtered-out types/features.
|
boolean |
isFormattedOutput |
ListUtils |
listUtils |
MarkerImpl |
marker
Used to tell if a FS was created before or after mark.
|
org.apache.uima.internal.util.IntVector |
modifiedEmbeddedValueFSs |
org.apache.uima.internal.util.PositiveIntSet |
multiRefFSs
Set of FSs that have multiple references
Has an entry for each FS (not just array or list FSs) which is (from some point on) being serialized as a multi-ref,
that is, is **not** being serialized (any more) using the special notation for arrays and lists
or, for JSON, **not** being serialized using the embedded notation
This is for JSON which is computing the multi-refs, not depending on the setting in a feature.
|
boolean |
needNameSpaces |
Set<String> |
nsPrefixesUsed
the set of all namespace prefixes used, to disallow some if they are
in use already in set-aside data (xmi serialization) being merged back in
|
Map<String,String> |
nsUriToPrefixMap
map from a namespace expanded form to the namespace prefix, to identify potential collisions when
generating a namespace string
|
org.apache.uima.internal.util.IntVector |
previouslySerializedFSs |
XmiSerializationSharedData |
sharedData
for Delta serialization, holds the info gathered from deserialization needed for delta serialization
and for handling out-of-type-system data for both plain and delta serialization
|
Comparator<Integer> |
sortFssByType
sort a view, by type and then by begin/end asc/des for subtypes of Annotation,
then by id
|
TypeSystemImpl |
tsi |
org.apache.uima.internal.util.XmlElementName[] |
typeCode2namespaceNames |
org.apache.uima.internal.util.PositiveIntSet_impl |
visited_not_yet_written
set of FSs that have been visited and enqueued to be serialized
- exception: arrays and lists which are "inline" are put into this set,
but are not enqueued to be serialized.
|
| Constructor and Description |
|---|
CasDocSerializer(ContentHandler ch,
CASImpl cas,
XmiSerializationSharedData sharedData,
MarkerImpl marker,
CasSerializerSupport.CasSerializerSupportSerialize csss) |
CasDocSerializer(ContentHandler ch,
CASImpl cas,
XmiSerializationSharedData sharedData,
MarkerImpl marker,
CasSerializerSupport.CasSerializerSupportSerialize csss,
boolean trackMultiRefs) |
| Modifier and Type | Method and Description |
|---|---|
int |
classifyType(int type)
Classifies a type.
|
void |
encodeFS(int addr)
Encode an individual FS.
|
void |
encodeIndexed() |
void |
encodeQueued() |
String |
getNameSpacePrefix(String uimaTypeName,
String nsUri,
int lastDotIndex) |
int |
getSofaAddr(int sofaNum) |
TypeImpl[] |
getSortedUsedTypes() |
String |
getTypeNameFromXmlElementName(org.apache.uima.internal.util.XmlElementName xe) |
String |
getUniqueString(String s) |
String |
getXmiId(int addr)
Get the XMI ID to use for an FS.
|
int |
getXmiIdAsInt(int addr) |
boolean |
isStaticMultiRef(int featCode) |
void |
serialize()
Starts serialization
|
void |
writeViewsCommons() |
public final CASImpl cas
public final TypeSystemImpl tsi
public final org.apache.uima.internal.util.PositiveIntSet_impl visited_not_yet_written
public final org.apache.uima.internal.util.PositiveIntSet multiRefFSs
public final boolean isDynamicMultiRef
public org.apache.uima.internal.util.IntVector previouslySerializedFSs
public org.apache.uima.internal.util.IntVector modifiedEmbeddedValueFSs
public final org.apache.uima.internal.util.IntVector[] indexedFSs
public final ListUtils listUtils
public org.apache.uima.internal.util.XmlElementName[] typeCode2namespaceNames
public boolean needNameSpaces
public final Map<String,String> nsUriToPrefixMap
public final Set<String> nsPrefixesUsed
public final MarkerImpl marker
public final XmiSerializationSharedData sharedData
public final boolean isDelta
public final boolean isFiltering
public TypeSystemImpl filterTypeSystem
public final boolean isFormattedOutput
public final Comparator<Integer> sortFssByType
public CasDocSerializer(ContentHandler ch, CASImpl cas, XmiSerializationSharedData sharedData, MarkerImpl marker, CasSerializerSupport.CasSerializerSupportSerialize csss)
ch - -cas - -sharedData - -marker - -csss - -public CasDocSerializer(ContentHandler ch, CASImpl cas, XmiSerializationSharedData sharedData, MarkerImpl marker, CasSerializerSupport.CasSerializerSupportSerialize csss, boolean trackMultiRefs)
public int getSofaAddr(int sofaNum)
sofaNum - - starts at 1public TypeImpl[] getSortedUsedTypes()
public void encodeFS(int addr)
throws Exception
addr - The address to be encoded.SAXException - passthruExceptionpublic final int classifyType(int type)
The LowLevelCAS.ll_getTypeClass(int) method classifies primitives and array types,
but does not have a special classification for list types, which we need for XMI
serialization. Therefore, in addition to the type codes defined on LowLevelCAS, this
method can return one of the type codes TYPE_CLASS_INTLIST, TYPE_CLASS_FLOATLIST,
TYPE_CLASS_STRINGLIST, or TYPE_CLASS_FSLIST.
type - the type to classifyLowLevelCAS or on this interface.public String getXmiId(int addr)
addr - address of FSpublic int getXmiIdAsInt(int addr)
public String getNameSpacePrefix(String uimaTypeName, String nsUri, int lastDotIndex)
public String getTypeNameFromXmlElementName(org.apache.uima.internal.util.XmlElementName xe)
public boolean isStaticMultiRef(int featCode)
Copyright © 2006–2021 The Apache Software Foundation. All rights reserved.