Package org.apache.uima.cas_data.impl
Class CasDataToXCas
java.lang.Object
org.apache.uima.cas_data.impl.CasDataToXCas
Takes a CasData and generates XCAS SAX events.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
private String
private ContentHandler
private boolean
private String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
_generate
(FeatureStructure aFS, CasDataToXCas.DocTextHolder aDocTextHolder) private void
_generateDocFS
(FeatureStructure aFS, CasDataToXCas.DocTextHolder aDocTextHolder) void
generateXCas
(CasData aCasData) Generates XCAS for a CasData.void
generateXCas
(CasData aCasData, String aUEID) Special form ofgenerateXCas(CasData)
that allows a UEID (Universal Entity ID) element to be added as the first element in the XCAS.void
generateXCas
(CasData aCasData, String aUEID, boolean aSendStartAndEndDocEvents) Special form ofgenerateXCas(CasData)
that allows a UEID (Universal Entity ID) element to be added as the first element in the XCAS and also allows start/end document SAX calls to be supressed.Gets the name of the CASData Feature that stores the document text.Gets the name of the CASData FeatureStructure Type that stores the document text.private String
Gets the XCAS element name for a FS.void
setContentHandler
(ContentHandler aHandler) Sets the ContentHandler to receive the SAX events.void
setDocumentTextFeatureName
(String aDocumentTextFeatureName) Sets the name of the CASData Feature that stores the document text.void
setDocumentTextTypeName
(String aDocumentTextTypeName) Sets the name of the CASData FeatureStructure Type that stores the document text.void
setIncludeAnnotationSpannedText
(boolean aIncludeAnnotationSpannedText) void
setTypesToFilter
(String[] aTypesToFilter) Specifies names of types that will not be included in the XCASvoid
setXCasDocumentTextTagName
(String aXCasDocTextTag) Sets the name of the XCAS tag that will contain the document text.
-
Field Details
-
mDocumentTextTypeName
-
mDocumentTextFeatureName
-
mXCasDocTextTag
-
mIncludeAnnotationSpannedText
private boolean mIncludeAnnotationSpannedText -
mTypesToFilter
-
mHandler
-
-
Constructor Details
-
CasDataToXCas
public CasDataToXCas()
-
-
Method Details
-
getDocumentTextTypeName
Gets the name of the CASData FeatureStructure Type that stores the document text.- Returns:
- the document text type name
-
setDocumentTextTypeName
Sets the name of the CASData FeatureStructure Type that stores the document text.- Parameters:
aDocumentTextTypeName
- the document text type name
-
getDocumentTextFeatureName
Gets the name of the CASData Feature that stores the document text.- Returns:
- the document text feature name
-
setDocumentTextFeatureName
Sets the name of the CASData Feature that stores the document text.- Parameters:
aDocumentTextFeatureName
- the document text feature name
-
setXCasDocumentTextTagName
Sets the name of the XCAS tag that will contain the document text.- Parameters:
aXCasDocTextTag
- the document text tag
-
setIncludeAnnotationSpannedText
public void setIncludeAnnotationSpannedText(boolean aIncludeAnnotationSpannedText) - Parameters:
aIncludeAnnotationSpannedText
- -
-
setTypesToFilter
Specifies names of types that will not be included in the XCAS- Parameters:
aTypesToFilter
- -
-
setContentHandler
Sets the ContentHandler to receive the SAX events.- Parameters:
aHandler
- -
-
generateXCas
Generates XCAS for a CasData. SAX events representing the XCAS will be sent to the ContentHandler registered viasetContentHandler(ContentHandler)
.- Parameters:
aCasData
- the CasData from which XCAS will be generated- Throws:
SAXException
- if the ContentHandler throws a SAX Exception
-
generateXCas
Special form ofgenerateXCas(CasData)
that allows a UEID (Universal Entity ID) element to be added as the first element in the XCAS.- Parameters:
aCasData
- the CasData from which XCAS will be generatedaUEID
- the UEID to add to the XCAS- Throws:
SAXException
- if the ContentHandler throws a SAX Exception
-
generateXCas
public void generateXCas(CasData aCasData, String aUEID, boolean aSendStartAndEndDocEvents) throws SAXException Special form ofgenerateXCas(CasData)
that allows a UEID (Universal Entity ID) element to be added as the first element in the XCAS and also allows start/end document SAX calls to be supressed.- Parameters:
aCasData
- the CasData from which XCAS will be generatedaUEID
- the UEID to add to the XCASaSendStartAndEndDocEvents
- true to send SAX events for start and end of document, false to supress them.- Throws:
SAXException
- if the ContentHandler throws a SAX Exception
-
_generate
private void _generate(FeatureStructure aFS, CasDataToXCas.DocTextHolder aDocTextHolder) throws SAXException - Throws:
SAXException
-
getXCasElementName
Gets the XCAS element name for a FS. This is usually the same as the type name, but the sequences _colon_ and _dash_ are translated to the characters : and -, respectively.- Parameters:
aFS
- feature structures- Returns:
- XCAS element name for this feature structure
-
_generateDocFS
private void _generateDocFS(FeatureStructure aFS, CasDataToXCas.DocTextHolder aDocTextHolder) throws SAXException - Parameters:
aFS
-- Throws:
SAXException
-