public class CasSerializerSupport.CasDocSerializer extends Object
Modifier and Type | Field and Description |
---|---|
CASImpl |
cas |
TypeSystemImpl |
filterTypeSystem |
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 |
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.
|
IntVector |
modifiedEmbeddedValueFSs |
PositiveIntSet |
multiRefFSs
set of FSs that have multiple references
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
|
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 |
XmlElementName[] |
typeCode2namespaceNames |
PositiveIntSet_impl |
visited_not_yet_written
set of FSs that have been enqueued to be serialized
Computed during "enqueue" phase, prior to encoding
Used to prevent duplicate enqueuing
|
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(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 PositiveIntSet_impl visited_not_yet_written
public final PositiveIntSet multiRefFSs
public IntVector previouslySerializedFSs
public IntVector modifiedEmbeddedValueFSs
public final IntVector[] indexedFSs
public final ListUtils listUtils
public 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
- passthruException
public 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(XmlElementName xe)
public boolean isStaticMultiRef(int featCode)
Copyright © 2016. All rights reserved.