com.metamatrix.query.processor.xml
Interface DocumentInProgress

All Known Implementing Classes:
SAXDocumentInProgress

public interface DocumentInProgress

This represents a document in construction. It maintains a reference to the current XML element being worked on, although the nature of that reference is completely hidden from the user. This allows the nastiness of creating the document using some document model to be hidden from the user.


Method Summary
 boolean addAttribute(NodeDescriptor descriptor, java.lang.String attributeValue)
          Add an attribute with content for the given NodeDescriptor.
 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()
           
 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).
 

Method Detail

setDocumentEncoding

void setDocumentEncoding(java.lang.String documentEncoding)
Sets the document encoding property of the XML document, typically something like UTF-8

Parameters:
document - encoding value

setDocumentFormat

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).

Parameters:
isFormatted - true for human-readable form, false for compact form

moveToParent

boolean moveToParent()
                     throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

moveToLastChild

boolean moveToLastChild()

addElement

boolean addElement(NodeDescriptor descriptor,
                   NodeDescriptor nillableDescriptor)
Add an element for the given NodeDescriptor.

Parameters:
descriptor - NodeDescriptor of the element
Returns:
whether operation was a success or not

addElement

boolean addElement(NodeDescriptor descriptor,
                   java.lang.String content)
Add an element with content for the given NodeDescriptor. If the content is either a null or an empty String, use the other addElement method.

Parameters:
descriptor - NodeDescriptor of the element
content - Content of the element
Returns:
whether operation was a success or not

addAttribute

boolean addAttribute(NodeDescriptor descriptor,
                     java.lang.String attributeValue)
Add an attribute with content for the given NodeDescriptor.

Parameters:
descriptor - NodeDescriptor of the attribute
attributeValue - String content of the attribute, this must be a non-null, non-empty String. Otherwise, no attribute will be added.
Returns:
whether operation was a success or not

addComment

boolean addComment(java.lang.String commentText)
Adds a comment to the current document node

Parameters:
commentText - text of the comment
Returns:
whether operation was a success or not

isFinished

boolean isFinished()
This flag indicates the document is finished and requires no more processing.

See Also:
markAsFinished()

markAsFinished

void markAsFinished()
                    throws MetaMatrixComponentException
This marks the document as finished, requiring no more processing. (It will not, however, prevent any more processing from being done.)

Throws:
MetaMatrixComponentException - if there is any problem ending the document
See Also:
isFinished()

getNextChunk

char[] getNextChunk(int sizeInBytes)
Retrieve the next chunk of document.

Parameters:
sizeInBytes - size of the chunk in bytes. No limit if it is 0.
Returns:
character array containing the specfied number of characters, or less if it has reached the end of the document. Return null if there is not enough characters and it has not reached the end of the document.


Copyright © 2009. All Rights Reserved.