com.sun.xml.stream.writers
Class XMLDOMWriterImpl

java.lang.Object
  extended by com.sun.xml.stream.writers.XMLDOMWriterImpl
All Implemented Interfaces:
javax.xml.stream.XMLStreamWriter

public class XMLDOMWriterImpl
extends java.lang.Object
implements javax.xml.stream.XMLStreamWriter

This class provides support to build a DOM tree using XMLStreamWriter API's.

Author:
K.Venugopal@sun.com

Constructor Summary
XMLDOMWriterImpl(javax.xml.transform.dom.DOMResult result)
          Creates a new instance of XMLDOMwriterImpl
 
Method Summary
 void close()
          This method has no effect when called.
 void flush()
          This method has no effect when called.
 javax.xml.namespace.NamespaceContext getNamespaceContext()
          
 java.lang.String getPrefix(java.lang.String namespaceURI)
          
 java.lang.Object getProperty(java.lang.String str)
          Is not supported in this implementation.
 void setDefaultNamespace(java.lang.String uri)
          Is not supported in this version of the implementation.
 void setNamespaceContext(javax.xml.namespace.NamespaceContext namespaceContext)
          
 void setPrefix(java.lang.String prefix, java.lang.String uri)
          Is not supported in this version of the implementation.
 void writeAttribute(java.lang.String localName, java.lang.String value)
          Creates a DOM Atrribute @see org.w3c.dom.Node and associates it with the current DOM element @see org.w3c.dom.Node.
 void writeAttribute(java.lang.String namespaceURI, java.lang.String localName, java.lang.String value)
          Creates a DOM Atrribute @see org.w3c.dom.Node and associates it with the current DOM element @see org.w3c.dom.Node.
 void writeAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, java.lang.String value)
          Creates a DOM Atrribute @see org.w3c.dom.Node and associates it with the current DOM element @see org.w3c.dom.Node.
 void writeCData(java.lang.String data)
          Creates a CDATA object @see org.w3c.dom.CDATASection.
 void writeCharacters(char[] values, int param, int param2)
          Creates a character object @see org.w3c.dom.Text and appends it to the current element in the DOM tree.
 void writeCharacters(java.lang.String charData)
          Creates a character object @see org.w3c.dom.Text and appends it to the current element in the DOM tree.
 void writeComment(java.lang.String str)
          Creates a Comment object @see org.w3c.dom.Comment and appends it to the current element in the DOM tree.
 void writeDefaultNamespace(java.lang.String namespaceURI)
          Creates a DOM attribute and adds it to the current element in the DOM tree.
 void writeDTD(java.lang.String str)
          This method is not supported in this implementation.
 void writeEmptyElement(java.lang.String localName)
          creates a DOM Element and appends it to the current element in the tree.
 void writeEmptyElement(java.lang.String namespaceURI, java.lang.String localName)
          creates a DOM Element and appends it to the current element in the tree.
 void writeEmptyElement(java.lang.String prefix, java.lang.String localName, java.lang.String namespaceURI)
          creates a DOM Element and appends it to the current element in the tree.
 void writeEndDocument()
          Will reset current Node pointer maintained by the implementation.
 void writeEndElement()
          Internal current Node pointer will point to the parent of the current Node.
 void writeEntityRef(java.lang.String name)
          Is not supported in this implementation.
 void writeNamespace(java.lang.String prefix, java.lang.String namespaceURI)
          creates a namespace attribute and will associate it with the current element in the DOM tree.
 void writeProcessingInstruction(java.lang.String target)
          is not supported in this release.
 void writeProcessingInstruction(java.lang.String target, java.lang.String data)
          is not supported in this release.
 void writeStartDocument()
          will set version on the Document object when the DOM Node passed to this implementation supports DOM Level3 API's.
 void writeStartDocument(java.lang.String version)
          will set version on the Document object when the DOM Node passed to this implementation supports DOM Level3 API's.
 void writeStartDocument(java.lang.String encoding, java.lang.String version)
          will set version on the Document object when the DOM Node passed to this implementation supports DOM Level3 API's.
 void writeStartElement(java.lang.String localName)
          creates a DOM Element and appends it to the current element in the tree.
 void writeStartElement(java.lang.String namespaceURI, java.lang.String localName)
          creates a DOM Element and appends it to the current element in the tree.
 void writeStartElement(java.lang.String prefix, java.lang.String localName, java.lang.String namespaceURI)
          creates a DOM Element and appends it to the current element in the tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLDOMWriterImpl

public XMLDOMWriterImpl(javax.xml.transform.dom.DOMResult result)
Creates a new instance of XMLDOMwriterImpl

Parameters:
result - DOMResult object @javax.xml.transform.dom.DOMResult
Method Detail

close

public void close()
           throws javax.xml.stream.XMLStreamException
This method has no effect when called.

Specified by:
close in interface javax.xml.stream.XMLStreamWriter
Throws:
javax.xml.stream.XMLStreamException

flush

public void flush()
           throws javax.xml.stream.XMLStreamException
This method has no effect when called.

Specified by:
flush in interface javax.xml.stream.XMLStreamWriter
Throws:
javax.xml.stream.XMLStreamException

getNamespaceContext

public javax.xml.namespace.NamespaceContext getNamespaceContext()

Specified by:
getNamespaceContext in interface javax.xml.stream.XMLStreamWriter
Returns:

getPrefix

public java.lang.String getPrefix(java.lang.String namespaceURI)
                           throws javax.xml.stream.XMLStreamException

Specified by:
getPrefix in interface javax.xml.stream.XMLStreamWriter
Parameters:
namespaceURI -
Returns:
Throws:
javax.xml.stream.XMLStreamException

getProperty

public java.lang.Object getProperty(java.lang.String str)
                             throws java.lang.IllegalArgumentException
Is not supported in this implementation.

Specified by:
getProperty in interface javax.xml.stream.XMLStreamWriter
Parameters:
str -
Returns:
Throws:
java.lang.IllegalArgumentException

setDefaultNamespace

public void setDefaultNamespace(java.lang.String uri)
                         throws javax.xml.stream.XMLStreamException
Is not supported in this version of the implementation.

Specified by:
setDefaultNamespace in interface javax.xml.stream.XMLStreamWriter
Parameters:
uri -
Throws:
javax.xml.stream.XMLStreamException

setNamespaceContext

public void setNamespaceContext(javax.xml.namespace.NamespaceContext namespaceContext)
                         throws javax.xml.stream.XMLStreamException

Specified by:
setNamespaceContext in interface javax.xml.stream.XMLStreamWriter
Parameters:
namespaceContext -
Throws:
javax.xml.stream.XMLStreamException

setPrefix

public void setPrefix(java.lang.String prefix,
                      java.lang.String uri)
               throws javax.xml.stream.XMLStreamException
Is not supported in this version of the implementation.

Specified by:
setPrefix in interface javax.xml.stream.XMLStreamWriter
Parameters:
prefix -
uri -
Throws:
javax.xml.stream.XMLStreamException

writeAttribute

public void writeAttribute(java.lang.String localName,
                           java.lang.String value)
                    throws javax.xml.stream.XMLStreamException
Creates a DOM Atrribute @see org.w3c.dom.Node and associates it with the current DOM element @see org.w3c.dom.Node.

Specified by:
writeAttribute in interface javax.xml.stream.XMLStreamWriter
Parameters:
localName -
value -
Throws:
javax.xml.stream.XMLStreamException

writeAttribute

public void writeAttribute(java.lang.String namespaceURI,
                           java.lang.String localName,
                           java.lang.String value)
                    throws javax.xml.stream.XMLStreamException
Creates a DOM Atrribute @see org.w3c.dom.Node and associates it with the current DOM element @see org.w3c.dom.Node.

Specified by:
writeAttribute in interface javax.xml.stream.XMLStreamWriter
Parameters:
namespaceURI -
localName -
value -
Throws:
javax.xml.stream.XMLStreamException

writeAttribute

public void writeAttribute(java.lang.String prefix,
                           java.lang.String namespaceURI,
                           java.lang.String localName,
                           java.lang.String value)
                    throws javax.xml.stream.XMLStreamException
Creates a DOM Atrribute @see org.w3c.dom.Node and associates it with the current DOM element @see org.w3c.dom.Node.

Specified by:
writeAttribute in interface javax.xml.stream.XMLStreamWriter
Parameters:
prefix -
namespaceURI -
localName -
value -
Throws:
javax.xml.stream.XMLStreamException

writeCData

public void writeCData(java.lang.String data)
                throws javax.xml.stream.XMLStreamException
Creates a CDATA object @see org.w3c.dom.CDATASection.

Specified by:
writeCData in interface javax.xml.stream.XMLStreamWriter
Parameters:
data -
Throws:
javax.xml.stream.XMLStreamException

writeCharacters

public void writeCharacters(java.lang.String charData)
                     throws javax.xml.stream.XMLStreamException
Creates a character object @see org.w3c.dom.Text and appends it to the current element in the DOM tree.

Specified by:
writeCharacters in interface javax.xml.stream.XMLStreamWriter
Parameters:
charData -
Throws:
javax.xml.stream.XMLStreamException

writeCharacters

public void writeCharacters(char[] values,
                            int param,
                            int param2)
                     throws javax.xml.stream.XMLStreamException
Creates a character object @see org.w3c.dom.Text and appends it to the current element in the DOM tree.

Specified by:
writeCharacters in interface javax.xml.stream.XMLStreamWriter
Parameters:
values -
param -
param2 -
Throws:
javax.xml.stream.XMLStreamException

writeComment

public void writeComment(java.lang.String str)
                  throws javax.xml.stream.XMLStreamException
Creates a Comment object @see org.w3c.dom.Comment and appends it to the current element in the DOM tree.

Specified by:
writeComment in interface javax.xml.stream.XMLStreamWriter
Parameters:
str -
Throws:
javax.xml.stream.XMLStreamException

writeDTD

public void writeDTD(java.lang.String str)
              throws javax.xml.stream.XMLStreamException
This method is not supported in this implementation.

Specified by:
writeDTD in interface javax.xml.stream.XMLStreamWriter
Parameters:
str -
Throws:
javax.xml.stream.XMLStreamException

writeDefaultNamespace

public void writeDefaultNamespace(java.lang.String namespaceURI)
                           throws javax.xml.stream.XMLStreamException
Creates a DOM attribute and adds it to the current element in the DOM tree.

Specified by:
writeDefaultNamespace in interface javax.xml.stream.XMLStreamWriter
Parameters:
namespaceURI -
Throws:
javax.xml.stream.XMLStreamException

writeEmptyElement

public void writeEmptyElement(java.lang.String localName)
                       throws javax.xml.stream.XMLStreamException
creates a DOM Element and appends it to the current element in the tree.

Specified by:
writeEmptyElement in interface javax.xml.stream.XMLStreamWriter
Parameters:
localName -
Throws:
javax.xml.stream.XMLStreamException

writeEmptyElement

public void writeEmptyElement(java.lang.String namespaceURI,
                              java.lang.String localName)
                       throws javax.xml.stream.XMLStreamException
creates a DOM Element and appends it to the current element in the tree.

Specified by:
writeEmptyElement in interface javax.xml.stream.XMLStreamWriter
Parameters:
namespaceURI -
localName -
Throws:
javax.xml.stream.XMLStreamException

writeEmptyElement

public void writeEmptyElement(java.lang.String prefix,
                              java.lang.String localName,
                              java.lang.String namespaceURI)
                       throws javax.xml.stream.XMLStreamException
creates a DOM Element and appends it to the current element in the tree.

Specified by:
writeEmptyElement in interface javax.xml.stream.XMLStreamWriter
Parameters:
prefix -
localName -
namespaceURI -
Throws:
javax.xml.stream.XMLStreamException

writeEndDocument

public void writeEndDocument()
                      throws javax.xml.stream.XMLStreamException
Will reset current Node pointer maintained by the implementation.

Specified by:
writeEndDocument in interface javax.xml.stream.XMLStreamWriter
Throws:
javax.xml.stream.XMLStreamException

writeEndElement

public void writeEndElement()
                     throws javax.xml.stream.XMLStreamException
Internal current Node pointer will point to the parent of the current Node.

Specified by:
writeEndElement in interface javax.xml.stream.XMLStreamWriter
Throws:
javax.xml.stream.XMLStreamException

writeEntityRef

public void writeEntityRef(java.lang.String name)
                    throws javax.xml.stream.XMLStreamException
Is not supported in this implementation.

Specified by:
writeEntityRef in interface javax.xml.stream.XMLStreamWriter
Parameters:
name -
Throws:
javax.xml.stream.XMLStreamException

writeNamespace

public void writeNamespace(java.lang.String prefix,
                           java.lang.String namespaceURI)
                    throws javax.xml.stream.XMLStreamException
creates a namespace attribute and will associate it with the current element in the DOM tree.

Specified by:
writeNamespace in interface javax.xml.stream.XMLStreamWriter
Parameters:
prefix -
namespaceURI -
Throws:
javax.xml.stream.XMLStreamException

writeProcessingInstruction

public void writeProcessingInstruction(java.lang.String target)
                                throws javax.xml.stream.XMLStreamException
is not supported in this release.

Specified by:
writeProcessingInstruction in interface javax.xml.stream.XMLStreamWriter
Parameters:
target -
Throws:
javax.xml.stream.XMLStreamException

writeProcessingInstruction

public void writeProcessingInstruction(java.lang.String target,
                                       java.lang.String data)
                                throws javax.xml.stream.XMLStreamException
is not supported in this release.

Specified by:
writeProcessingInstruction in interface javax.xml.stream.XMLStreamWriter
Parameters:
target -
data -
Throws:
javax.xml.stream.XMLStreamException

writeStartDocument

public void writeStartDocument()
                        throws javax.xml.stream.XMLStreamException
will set version on the Document object when the DOM Node passed to this implementation supports DOM Level3 API's.

Specified by:
writeStartDocument in interface javax.xml.stream.XMLStreamWriter
Throws:
javax.xml.stream.XMLStreamException

writeStartDocument

public void writeStartDocument(java.lang.String version)
                        throws javax.xml.stream.XMLStreamException
will set version on the Document object when the DOM Node passed to this implementation supports DOM Level3 API's.

Specified by:
writeStartDocument in interface javax.xml.stream.XMLStreamWriter
Parameters:
version -
Throws:
javax.xml.stream.XMLStreamException

writeStartDocument

public void writeStartDocument(java.lang.String encoding,
                               java.lang.String version)
                        throws javax.xml.stream.XMLStreamException
will set version on the Document object when the DOM Node passed to this implementation supports DOM Level3 API's.

Specified by:
writeStartDocument in interface javax.xml.stream.XMLStreamWriter
Parameters:
encoding -
version -
Throws:
javax.xml.stream.XMLStreamException

writeStartElement

public void writeStartElement(java.lang.String localName)
                       throws javax.xml.stream.XMLStreamException
creates a DOM Element and appends it to the current element in the tree.

Specified by:
writeStartElement in interface javax.xml.stream.XMLStreamWriter
Parameters:
localName -
Throws:
javax.xml.stream.XMLStreamException

writeStartElement

public void writeStartElement(java.lang.String namespaceURI,
                              java.lang.String localName)
                       throws javax.xml.stream.XMLStreamException
creates a DOM Element and appends it to the current element in the tree.

Specified by:
writeStartElement in interface javax.xml.stream.XMLStreamWriter
Parameters:
namespaceURI -
localName -
Throws:
javax.xml.stream.XMLStreamException

writeStartElement

public void writeStartElement(java.lang.String prefix,
                              java.lang.String localName,
                              java.lang.String namespaceURI)
                       throws javax.xml.stream.XMLStreamException
creates a DOM Element and appends it to the current element in the tree.

Specified by:
writeStartElement in interface javax.xml.stream.XMLStreamWriter
Parameters:
prefix -
localName -
namespaceURI -
Throws:
javax.xml.stream.XMLStreamException


Copyright ? 2002-2003 Apache XML Project. All Rights Reserved.