|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.query.processor.xml.SAXDocumentInProgress
public class SAXDocumentInProgress
This class is used to build XML document and stream the output as chunks. The class holds one chunk of the document in memory at one time.
Constructor Summary | |
---|---|
SAXDocumentInProgress()
|
Method Summary | |
---|---|
boolean |
addAttribute(NodeDescriptor descriptor,
java.lang.String attributeValue)
Add an attribute with content for the given NodeDescriptor. |
boolean |
addAttribute(NodeDescriptor descriptor,
java.lang.String attributeValue,
com.metamatrix.query.processor.xml.Element element)
|
boolean |
addComment(java.lang.String commentText)
Adds a comment to the current document node |
boolean |
addElement(NodeDescriptor descriptor,
NodeDescriptor nillableDescriptor)
Add an element for the given NodeDescriptor. |
boolean |
addElement(NodeDescriptor descriptor,
java.lang.String content)
Add an element with content for the given NodeDescriptor. |
char[] |
getNextChunk(int sizeInBytes)
Retrieve the next chunk of document. |
boolean |
isFinished()
This flag indicates the document is finished and requires no more processing. |
void |
markAsFinished()
This marks the document as finished, requiring no more processing. |
boolean |
moveToLastChild()
|
boolean |
moveToParent()
Move to the parent of this element. |
static java.lang.String |
normalizeText(java.lang.String content,
java.lang.String textNormalizationMode)
|
void |
setDocumentEncoding(java.lang.String documentEncoding)
Sets the document encoding property of the XML document, typically something like UTF-8 |
void |
setDocumentFormat(boolean isFormatted)
Sets whether the document will be formatted in human-readable form (multi-line, with tabs) or compact form (no line breaks or tabs). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SAXDocumentInProgress() throws MetaMatrixComponentException
MetaMatrixComponentException
Method Detail |
---|
public void setDocumentEncoding(java.lang.String documentEncoding)
DocumentInProgress
UTF-8
setDocumentEncoding
in interface DocumentInProgress
DocumentInProgress.setDocumentEncoding(java.lang.String)
public void setDocumentFormat(boolean isFormatted)
DocumentInProgress
setDocumentFormat
in interface DocumentInProgress
isFormatted
- true for human-readable form, false for
compact formDocumentInProgress.setDocumentFormat(boolean)
public boolean moveToParent() throws org.xml.sax.SAXException
moveToParent
in interface DocumentInProgress
org.xml.sax.SAXException
DocumentInProgress.moveToParent()
public boolean moveToLastChild()
moveToLastChild
in interface DocumentInProgress
DocumentInProgress.moveToLastChild()
public boolean addElement(NodeDescriptor descriptor, NodeDescriptor nillableDescriptor)
DocumentInProgress
addElement
in interface DocumentInProgress
descriptor
- NodeDescriptor of the element
public boolean addElement(NodeDescriptor descriptor, java.lang.String content)
DocumentInProgress
addElement
method.
addElement
in interface DocumentInProgress
descriptor
- NodeDescriptor of the elementcontent
- Content of the element
public boolean addAttribute(NodeDescriptor descriptor, java.lang.String attributeValue, com.metamatrix.query.processor.xml.Element element)
public boolean addAttribute(NodeDescriptor descriptor, java.lang.String attributeValue)
DocumentInProgress
addAttribute
in interface DocumentInProgress
descriptor
- NodeDescriptor of the attributeattributeValue
- String content of the attribute, this must be a
non-null, non-empty String. Otherwise, no attribute will be added.
com.metamatrix.query.processor.xml.DocumentInProgress#addAttribute(java.lang.String, java.lang.String, java.lang.String, boolean)
public boolean addComment(java.lang.String commentText)
DocumentInProgress
addComment
in interface DocumentInProgress
commentText
- text of the comment
MetaMatrixComponentException
DocumentInProgress.addComment(java.lang.String)
public boolean isFinished()
DocumentInProgress
isFinished
in interface DocumentInProgress
DocumentInProgress.isFinished()
public void markAsFinished() throws MetaMatrixComponentException
DocumentInProgress
markAsFinished
in interface DocumentInProgress
MetaMatrixComponentException
- if there is any problem ending the documentDocumentInProgress.markAsFinished()
public char[] getNextChunk(int sizeInBytes)
DocumentInProgress
getNextChunk
in interface DocumentInProgress
sizeInBytes
- size of the chunk in bytes. No limit if it is 0.
DocumentInProgress.getNextChunk(int)
public static java.lang.String normalizeText(java.lang.String content, java.lang.String textNormalizationMode)
content
- textNormalizationMode
- preserve No normalization is done, the value is not changed for element content
replace All occurrences of #x9 (tab), #xA (line feed) and #xD (carriage return) are replaced with #x20 (space)
collapse After the processing implied by replace, contiguous sequences of #x20's are collapsed to a single #x20, and leading and trailing #x20's are removed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |