|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.uima.util.CasToInlineXml
public class CasToInlineXml
Generates an *approximate* inline XML representation of a CAS. Annotation types are represented as XML tags, features are represented as attributes. Features whose values are FeatureStructures are not represented. Feature values which are strings longer than 64 characters are truncated. Feature values which are arrays of primitives are represented by strings that look like [ xxx, xxx ] The Subject of analysis is presumed to be a text string. Some characters in the document's Subject-of-analysis are replaced by blanks, because the characters aren't valid in xml documents. It doesn't work for annotations which are overlapping, because these cannot be properly represented as properly - nested XML. To use this, make an instance of this class, and (optionally) set the formattedOutput to true or false. Then call one of the public methods to format or generate the Inline XML.
Constructor Summary | |
---|---|
CasToInlineXml()
|
Method Summary | |
---|---|
void |
destroy()
This destroy method does nothing. |
java.lang.String |
format(CAS aCAS)
Formats a CAS as a String. |
java.lang.String |
format(CAS aCAS,
FSMatchConstraint aFilter)
Formats a CAS as a String. |
java.lang.String |
generateXML(CAS aCAS)
Generates inline XML from a CAS. |
java.lang.String |
generateXML(CAS aCAS,
FSMatchConstraint aFilter)
Generates inline XML from a CAS. |
void |
generateXML(CAS aCAS,
FSMatchConstraint aFilter,
org.xml.sax.ContentHandler aHandler)
Generates inline XML from a CAS using a passed in ContentHandler |
boolean |
isFormattedOutput()
|
void |
setFormattedOutput(boolean formattedOutput)
Set a flag that will be used to control how the ContentHandler will be initialized - to either format or not, the generated Inline XML |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CasToInlineXml()
Method Detail |
---|
public void destroy()
Resource.destroy()
public java.lang.String format(CAS aCAS) throws CASException
aCAS
- the cas to format as an xml string
CASException
public java.lang.String format(CAS aCAS, FSMatchConstraint aFilter) throws CASException
aCAS
- CASaFilter
- a filter to limit the Feature Structures
CASException
- -public java.lang.String generateXML(CAS aCAS) throws CASException
aCAS
- CAS to generate from
CASException
public void generateXML(CAS aCAS, FSMatchConstraint aFilter, org.xml.sax.ContentHandler aHandler) throws CASException
aCAS
- CAS to generate fromaFilter
- constraint that determines which annotations are included in the output. If null (or
omitted), all annotations are included.aHandler
- the content handler to use
CASException
public java.lang.String generateXML(CAS aCAS, FSMatchConstraint aFilter) throws CASException
aCAS
- CAS to generate fromaFilter
- constraint that determines which annotations are included in the output. If null (or
ommitted), all annotations are included.
CASException
public boolean isFormattedOutput()
public void setFormattedOutput(boolean formattedOutput)
formattedOutput
- true means to format the output, and is the default
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |