Package org.apache.uima.cas.impl
Class XCASSerializer.XCASDocSerializer
java.lang.Object
org.apache.uima.cas.impl.XCASSerializer.XCASDocSerializer
- Enclosing class:
XCASSerializer
Use an inner class to hold the data for serializing a CAS. Each call to serialize() creates its
own instance.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CASImpl
private static final String
private ContentHandler
private IntRedBlackTree
private final AttributesImpl
private int
private IntVector
private IntVector
private static final int
private static final int
Bad name; check if we've seen this (address, value) before.private static final int
private static final int
private OutOfTypeSystemData
private static final int
private static final int
(package private) int
private IntStack
private IntRedBlackTree
private int
private AttributesImpl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addAttribute
(AttributesImpl attrs, String attrName, String attrValue) private void
private final int
classifyType
(int type) private final int
containsKeyValuePair
(IntRedBlackTree rbt, int key, int value) private void
encodeFeatures
(int addr, AttributesImpl attrs) private void
Encode an individual FS.private void
encodeFSArray
(int addr, AttributesImpl attrs) private void
private void
encodeOutOfTypeSystemFeatures
(int addr, AttributesImpl attrs) private void
encodePrimitiveTypeArrayFS
(String[] data, String typeName, AttributesImpl attrs) private void
private void
endElement
(String tag) private boolean
enqueue
(int addr) Add an address to the queue.private void
enqueueFeatures
(int addr, int heapValue) private void
private void
enqueueFSArray
(int addr) private void
Push the indexed FSs onto the queue.private void
enqueueIndexed
(int addr, int indexRep) Same as enqueue, but for indexed FSs.private void
private void
enqueueOutOfTypeSystemFeatures
(int addr) private final String
getTypeName
(int addr) private int
isQueued
(int addr, int value) private boolean
isValidXmlChar
(char c) private String
replaceInvalidXmlChars
(String aString) private void
serialize
(boolean encodeDoc, OutOfTypeSystemData outOfTypeSystemData) private void
private void
startElement
(String tag, Attributes attrs, int num)
-
Field Details
-
ch
-
cas
-
queued
-
NOT_INDEXED
private static final int NOT_INDEXED- See Also:
-
MULTIPLY_INDEXED
private static final int MULTIPLY_INDEXED- See Also:
-
INVALID_INDEX
private static final int INVALID_INDEX- See Also:
-
duplicates
-
numDuplicates
int numDuplicates -
dupVectors
-
indexedFSs
-
indexReps
-
queue
-
sofaTypeCode
private int sofaTypeCode -
emptyAttrs
-
workAttrs
-
cdataType
- See Also:
-
fsCount
private int fsCount -
mOutOfTypeSystemData
-
KEY_AND_VALUE_MATCH
private static final int KEY_AND_VALUE_MATCHBad name; check if we've seen this (address, value) before.- See Also:
-
KEY_ONLY_MATCH
private static final int KEY_ONLY_MATCH- See Also:
-
KEY_NOT_FOUND
private static final int KEY_NOT_FOUND- See Also:
-
-
Constructor Details
-
XCASDocSerializer
-
-
Method Details
-
enqueue
private boolean enqueue(int addr) Add an address to the queue.- Parameters:
addr
- The address.- Returns:
false
iff we've seen this address before.
-
enqueueIndexed
private void enqueueIndexed(int addr, int indexRep) Same as enqueue, but for indexed FSs.- Parameters:
addr
- The address to enqueue.
-
isQueued
private int isQueued(int addr, int value) -
containsKeyValuePair
-
serialize
private void serialize(boolean encodeDoc, OutOfTypeSystemData outOfTypeSystemData) throws IOException, SAXException - Throws:
IOException
SAXException
-
addText
- Throws:
SAXException
-
replaceInvalidXmlChars
-
isValidXmlChar
private boolean isValidXmlChar(char c) -
addAttribute
-
startElement
- Throws:
SAXException
-
endElement
- Throws:
SAXException
-
encodeIndexed
- Throws:
IOException
SAXException
-
enqueueIndexed
private void enqueueIndexed()Push the indexed FSs onto the queue. -
enqueueFeaturesOfIndexed
private void enqueueFeaturesOfIndexed() -
encodeQueued
- Throws:
IOException
SAXException
-
encodeFS
Encode an individual FS.- Parameters:
addr
- The address to be encoded.isIndexed
- If the FS is indexed or not.- Throws:
IOException
- passthruSAXException
- passthru
-
encodePrimitiveTypeArrayFS
private void encodePrimitiveTypeArrayFS(String[] data, String typeName, AttributesImpl attrs) throws SAXException - Throws:
SAXException
-
encodeFSArray
- Throws:
SAXException
-
enqueueFSArray
private void enqueueFSArray(int addr) -
encodeFeatures
-
enqueueFeatures
private void enqueueFeatures(int addr, int heapValue) -
encodeOutOfTypeSystemFeatures
-
enqueueOutOfTypeSystemFeatures
private void enqueueOutOfTypeSystemFeatures(int addr) -
getTypeName
-
classifyType
private final int classifyType(int type) -
enqueueOutOfTypeSystemData
-
serializeOutOfTypeSystemData
- Throws:
SAXException
-