Package com.sun.xml.rpc.streaming
Class XmlTreeWriter
- java.lang.Object
-
- com.sun.xml.rpc.streaming.XMLWriterBase
-
- com.sun.xml.rpc.streaming.XmlTreeWriter
-
- All Implemented Interfaces:
XMLWriter
public class XmlTreeWriter extends XMLWriterBase implements XMLWriter
- Author:
- JAX-RPC Development Team
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.xml.soap.SOAPElementcurrentNodeprotected Documentdocumentprotected StackelementStackprotected NamespaceSupportnsprotected javax.xml.soap.SOAPElementparentNodeprotected PrefixFactorypfactory
-
Constructor Summary
Constructors Constructor Description XmlTreeWriter(Document document)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.xml.soap.SOAPElementaddNewNode(String localName, String prefix, String uri)voidclose()Close the writer and its underlying stream.protected StringcreatePrefix(String uri)voidendElement()Write the end tag for the current element.voidflush()Flush the writer and its underlying stream.protected StringgetKnownPrefix(String uri)StringgetPrefix(String uri)Return a prefix for the given URI.PrefixFactorygetPrefixFactory()Return the prefix factory in use by this writer.protected static javax.xml.soap.SOAPFactorygetSoapFactory()StringgetURI(String prefix)Return the URI for a given prefix.protected Stringquote(String value)voidsetPrefixFactory(PrefixFactory factory)Set the prefix factory to be used by this writer.voidstartElement(String localName, String uri)Write the start tag for an element.voidstartElement(String localName, String uri, String prefix)Write the start tag for an element.voidwriteAttribute(String localName, String uri, String value)Write an attribute of the current element.voidwriteAttributeUnquoted(String localName, String uri, String value)Write an attribute (unquoted) of the current element.voidwriteChars(CDATA chars)Write character data within an element.voidwriteChars(String chars)Write character data within an element.voidwriteCharsUnquoted(char[] buf, int offset, int len)unsupportvoidwriteCharsUnquoted(String chars)Write character data within an element, skipping quoting.voidwriteNamespaceDeclaration(String uri)Write a namespace declaration of the current element.voidwriteNamespaceDeclaration(String prefix, String uri)Write a namespace declaration of the current element.-
Methods inherited from class com.sun.xml.rpc.streaming.XMLWriterBase
startElement, startElement, startElement, writeAttribute, writeAttribute, writeAttributeUnquoted, writeAttributeUnquoted, writeComment
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.sun.xml.rpc.streaming.XMLWriter
startElement, startElement, startElement, writeAttribute, writeAttribute, writeAttributeUnquoted, writeAttributeUnquoted, writeComment
-
-
-
-
Field Detail
-
document
protected Document document
-
currentNode
protected javax.xml.soap.SOAPElement currentNode
-
parentNode
protected javax.xml.soap.SOAPElement parentNode
-
pfactory
protected PrefixFactory pfactory
-
ns
protected NamespaceSupport ns
-
elementStack
protected Stack elementStack
-
-
Constructor Detail
-
XmlTreeWriter
public XmlTreeWriter(Document document)
-
-
Method Detail
-
getSoapFactory
protected static javax.xml.soap.SOAPFactory getSoapFactory() throws javax.xml.soap.SOAPException- Throws:
javax.xml.soap.SOAPException
-
startElement
public void startElement(String localName, String uri)
Description copied from interface:XMLWriterWrite the start tag for an element.- Specified by:
startElementin interfaceXMLWriter- See Also:
XMLWriter.startElement(String, String)
-
addNewNode
protected javax.xml.soap.SOAPElement addNewNode(String localName, String prefix, String uri) throws javax.xml.soap.SOAPException
- Throws:
javax.xml.soap.SOAPException
-
startElement
public void startElement(String localName, String uri, String prefix)
Description copied from interface:XMLWriterWrite the start tag for an element.- Specified by:
startElementin interfaceXMLWriter- See Also:
XMLWriter.startElement(String, String, String)
-
writeAttribute
public void writeAttribute(String localName, String uri, String value)
Description copied from interface:XMLWriterWrite an attribute of the current element.- Specified by:
writeAttributein interfaceXMLWriter- See Also:
XMLWriter.writeAttribute(String, String, String)
-
writeAttributeUnquoted
public void writeAttributeUnquoted(String localName, String uri, String value)
Description copied from interface:XMLWriterWrite an attribute (unquoted) of the current element.- Specified by:
writeAttributeUnquotedin interfaceXMLWriter- See Also:
XMLWriter.writeAttributeUnquoted(String, String, String)
-
writeNamespaceDeclaration
public void writeNamespaceDeclaration(String prefix, String uri)
Description copied from interface:XMLWriterWrite a namespace declaration of the current element.- Specified by:
writeNamespaceDeclarationin interfaceXMLWriter- See Also:
XMLWriter.writeNamespaceDeclaration( String, String)
-
writeNamespaceDeclaration
public void writeNamespaceDeclaration(String uri)
Description copied from interface:XMLWriterWrite a namespace declaration of the current element. The prefix name will be generated by the PrefixFactory currently configured for this writer.- Specified by:
writeNamespaceDeclarationin interfaceXMLWriter- See Also:
XMLWriter.writeNamespaceDeclaration(String)
-
writeChars
public void writeChars(String chars)
Description copied from interface:XMLWriterWrite character data within an element.- Specified by:
writeCharsin interfaceXMLWriter- Specified by:
writeCharsin classXMLWriterBase- See Also:
XMLWriter.writeChars(String)
-
writeCharsUnquoted
public void writeCharsUnquoted(String chars)
Description copied from interface:XMLWriterWrite character data within an element, skipping quoting.- Specified by:
writeCharsUnquotedin interfaceXMLWriter- See Also:
XMLWriter.writeCharsUnquoted(String)
-
writeCharsUnquoted
public void writeCharsUnquoted(char[] buf, int offset, int len)unsupport- Specified by:
writeCharsUnquotedin interfaceXMLWriter
-
endElement
public void endElement()
Description copied from interface:XMLWriterWrite the end tag for the current element.- Specified by:
endElementin interfaceXMLWriter- See Also:
XMLWriter.endElement()
-
getPrefixFactory
public PrefixFactory getPrefixFactory()
Description copied from interface:XMLWriterReturn the prefix factory in use by this writer.- Specified by:
getPrefixFactoryin interfaceXMLWriter- See Also:
XMLWriter.getPrefixFactory()
-
setPrefixFactory
public void setPrefixFactory(PrefixFactory factory)
Description copied from interface:XMLWriterSet the prefix factory to be used by this writer.- Specified by:
setPrefixFactoryin interfaceXMLWriter- See Also:
XMLWriter.setPrefixFactory(PrefixFactory)
-
getURI
public String getURI(String prefix)
Description copied from interface:XMLWriterReturn the URI for a given prefix. If the prefix is undeclared, return null.- Specified by:
getURIin interfaceXMLWriter- See Also:
XMLWriter.getURI(String)
-
getPrefix
public String getPrefix(String uri)
Description copied from interface:XMLWriterReturn a prefix for the given URI.If no prefix for the given URI is in scope, return null.
- Specified by:
getPrefixin interfaceXMLWriter- See Also:
XMLWriter.getPrefix(String)
-
flush
public void flush()
Description copied from interface:XMLWriterFlush the writer and its underlying stream.
-
close
public void close()
Description copied from interface:XMLWriterClose the writer and its underlying stream.
-
writeChars
public void writeChars(CDATA chars)
Description copied from interface:XMLWriterWrite character data within an element.- Specified by:
writeCharsin interfaceXMLWriter- Specified by:
writeCharsin classXMLWriterBase
-
-