com.bea.xml.stream

Class XMLWriterBase

Implemented Interfaces:
javax.xml.stream.XMLStreamWriter
Known Direct Subclasses:
XMLStreamRecorder

public class XMLWriterBase
extends ReaderToWriter
implements javax.xml.stream.XMLStreamWriter

The base output class.

Field Summary

protected static String
DEFAULTNS
protected NamespaceContextImpl
context

Constructor Summary

XMLWriterBase()
XMLWriterBase(Writer writer)

Method Summary

void
close()
protected void
closeEndTag()
protected void
closeStartElement()
protected void
closeStartTag()
void
flush()
javax.xml.namespace.NamespaceContext
getNamespaceContext()
String
getPrefix(String uri)
Object
getProperty(String name)
protected String
getURIInternal(String prefix)
protected boolean
isOpen()
static void
main(args[] )
protected void
openEndTag()
protected void
openStartTag()
void
setConfigurationContext(ConfigurationContextBase c)
void
setDefaultNamespace(String uri)
void
setNamespaceContext(javax.xml.namespace.NamespaceContext context)
void
setPrefix(String prefix, String uri)
void
setWriter(Writer writer)
protected void
write(String s)
protected void
write(char c)
protected void
write(char[] c)
protected void
write(char[] c, int start, int len)
void
writeAttribute(String localName, String value)
void
writeAttribute(String namespaceURI, String localName, String value)
void
writeAttribute(String prefix, String namespaceURI, String localName, String value)
void
writeCData(String data)
void
writeCharacters(String text)
void
writeCharacters(char[] text, int start, int len)
protected void
writeCharactersInternal(characters[] , int start, int length, boolean isAttributeValue)
void
writeComment(String data)
void
writeDTD(String dtd)
void
writeDefaultNamespace(String namespaceURI)
void
writeEmptyElement(String localName)
void
writeEmptyElement(String namespaceURI, String localName)
void
writeEmptyElement(String prefix, String localName, String namespaceURI)
void
writeEndDocument()
void
writeEndElement()
void
writeEntityRef(String name)
protected String
writeName(String prefix, String namespaceURI, String localName)
void
writeNamespace(String prefix, String namespaceURI)
void
writeProcessingInstruction(String target)
void
writeProcessingInstruction(String target, String text)
void
writeRaw(String data)
void
writeStartDocument()
void
writeStartDocument(String version)
void
writeStartDocument(String encoding, String version)
void
writeStartElement(String localName)
void
writeStartElement(String namespaceURI, String localName)
void
writeStartElement(String prefix, String localName, String namespaceURI)
protected void
writeStartElementInternal(String namespaceURI, String localName)

Methods inherited from class com.bea.xml.stream.ReaderToWriter

main, setStreamWriter, write, writeAll

Field Details

DEFAULTNS

protected static final String DEFAULTNS

context

protected NamespaceContextImpl context

Constructor Details

XMLWriterBase

public XMLWriterBase()

XMLWriterBase

public XMLWriterBase(Writer writer)

Method Details

close

public void close()
            throws javax.xml.stream.XMLStreamException
Specified by:
close in interface javax.xml.stream.XMLStreamWriter

closeEndTag

protected void closeEndTag()
            throws javax.xml.stream.XMLStreamException

closeStartElement

protected void closeStartElement()
            throws javax.xml.stream.XMLStreamException

closeStartTag

protected void closeStartTag()
            throws javax.xml.stream.XMLStreamException

flush

public void flush()
            throws javax.xml.stream.XMLStreamException
Specified by:
flush in interface javax.xml.stream.XMLStreamWriter

getNamespaceContext

public javax.xml.namespace.NamespaceContext getNamespaceContext()
Specified by:
getNamespaceContext in interface javax.xml.stream.XMLStreamWriter

getPrefix

public String getPrefix(String uri)
            throws javax.xml.stream.XMLStreamException
Specified by:
getPrefix in interface javax.xml.stream.XMLStreamWriter

getProperty

public Object getProperty(String name)
            throws IllegalArgumentException

getURIInternal

protected String getURIInternal(String prefix)

isOpen

protected boolean isOpen()

main

public static void main(args[] )
            throws Exception
Overrides:
main in interface ReaderToWriter

openEndTag

protected void openEndTag()
            throws javax.xml.stream.XMLStreamException

openStartTag

protected void openStartTag()
            throws javax.xml.stream.XMLStreamException

setConfigurationContext

public void setConfigurationContext(ConfigurationContextBase c)

setDefaultNamespace

public void setDefaultNamespace(String uri)
            throws javax.xml.stream.XMLStreamException
Specified by:
setDefaultNamespace in interface javax.xml.stream.XMLStreamWriter

setNamespaceContext

public void setNamespaceContext(javax.xml.namespace.NamespaceContext context)
            throws javax.xml.stream.XMLStreamException
Specified by:
setNamespaceContext in interface javax.xml.stream.XMLStreamWriter

setPrefix

public void setPrefix(String prefix,
                      String uri)
            throws javax.xml.stream.XMLStreamException
Specified by:
setPrefix in interface javax.xml.stream.XMLStreamWriter

setWriter

public void setWriter(Writer writer)

write

protected void write(String s)
            throws javax.xml.stream.XMLStreamException

write

protected void write(char c)
            throws javax.xml.stream.XMLStreamException

write

protected void write(char[] c)
            throws javax.xml.stream.XMLStreamException

write

protected void write(char[] c,
                     int start,
                     int len)
            throws javax.xml.stream.XMLStreamException

writeAttribute

public void writeAttribute(String localName,
                           String value)
            throws javax.xml.stream.XMLStreamException
Specified by:
writeAttribute in interface javax.xml.stream.XMLStreamWriter

writeAttribute

public void writeAttribute(String namespaceURI,
                           String localName,
                           String value)
            throws javax.xml.stream.XMLStreamException
Specified by:
writeAttribute in interface javax.xml.stream.XMLStreamWriter

writeAttribute

public void writeAttribute(String prefix,
                           String namespaceURI,
                           String localName,
                           String value)
            throws javax.xml.stream.XMLStreamException
Specified by:
writeAttribute in interface javax.xml.stream.XMLStreamWriter

writeCData

public void writeCData(String data)
            throws javax.xml.stream.XMLStreamException
Specified by:
writeCData in interface javax.xml.stream.XMLStreamWriter

writeCharacters

public void writeCharacters(String text)
            throws javax.xml.stream.XMLStreamException
Specified by:
writeCharacters in interface javax.xml.stream.XMLStreamWriter

writeCharacters

public void writeCharacters(char[] text,
                            int start,
                            int len)
            throws javax.xml.stream.XMLStreamException
Specified by:
writeCharacters in interface javax.xml.stream.XMLStreamWriter

writeCharactersInternal

protected void writeCharactersInternal(characters[] ,
                                       int start,
                                       int length,
                                       boolean isAttributeValue)
            throws javax.xml.stream.XMLStreamException

writeComment

public void writeComment(String data)
            throws javax.xml.stream.XMLStreamException
Specified by:
writeComment in interface javax.xml.stream.XMLStreamWriter

writeDTD

public void writeDTD(String dtd)
            throws javax.xml.stream.XMLStreamException
Specified by:
writeDTD in interface javax.xml.stream.XMLStreamWriter

writeDefaultNamespace

public void writeDefaultNamespace(String namespaceURI)
            throws javax.xml.stream.XMLStreamException
Specified by:
writeDefaultNamespace in interface javax.xml.stream.XMLStreamWriter

writeEmptyElement

public void writeEmptyElement(String localName)
            throws javax.xml.stream.XMLStreamException
Specified by:
writeEmptyElement in interface javax.xml.stream.XMLStreamWriter

writeEmptyElement

public void writeEmptyElement(String namespaceURI,
                              String localName)
            throws javax.xml.stream.XMLStreamException
Specified by:
writeEmptyElement in interface javax.xml.stream.XMLStreamWriter

writeEmptyElement

public void writeEmptyElement(String prefix,
                              String localName,
                              String namespaceURI)
            throws javax.xml.stream.XMLStreamException
Specified by:
writeEmptyElement in interface javax.xml.stream.XMLStreamWriter

writeEndDocument

public void writeEndDocument()
            throws javax.xml.stream.XMLStreamException
Specified by:
writeEndDocument in interface javax.xml.stream.XMLStreamWriter

writeEndElement

public void writeEndElement()
            throws javax.xml.stream.XMLStreamException
Specified by:
writeEndElement in interface javax.xml.stream.XMLStreamWriter

writeEntityRef

public void writeEntityRef(String name)
            throws javax.xml.stream.XMLStreamException
Specified by:
writeEntityRef in interface javax.xml.stream.XMLStreamWriter

writeName

protected String writeName(String prefix,
                           String namespaceURI,
                           String localName)
            throws javax.xml.stream.XMLStreamException

writeNamespace

public void writeNamespace(String prefix,
                           String namespaceURI)
            throws javax.xml.stream.XMLStreamException
Specified by:
writeNamespace in interface javax.xml.stream.XMLStreamWriter

writeProcessingInstruction

public void writeProcessingInstruction(String target)
            throws javax.xml.stream.XMLStreamException
Specified by:
writeProcessingInstruction in interface javax.xml.stream.XMLStreamWriter

writeProcessingInstruction

public void writeProcessingInstruction(String target,
                                       String text)
            throws javax.xml.stream.XMLStreamException
Specified by:
writeProcessingInstruction in interface javax.xml.stream.XMLStreamWriter

writeRaw

public void writeRaw(String data)
            throws javax.xml.stream.XMLStreamException

writeStartDocument

public void writeStartDocument()
            throws javax.xml.stream.XMLStreamException
Specified by:
writeStartDocument in interface javax.xml.stream.XMLStreamWriter

writeStartDocument

public void writeStartDocument(String version)
            throws javax.xml.stream.XMLStreamException
Specified by:
writeStartDocument in interface javax.xml.stream.XMLStreamWriter

writeStartDocument

public void writeStartDocument(String encoding,
                               String version)
            throws javax.xml.stream.XMLStreamException
Specified by:
writeStartDocument in interface javax.xml.stream.XMLStreamWriter

writeStartElement

public void writeStartElement(String localName)
            throws javax.xml.stream.XMLStreamException
Specified by:
writeStartElement in interface javax.xml.stream.XMLStreamWriter

writeStartElement

public void writeStartElement(String namespaceURI,
                              String localName)
            throws javax.xml.stream.XMLStreamException
Specified by:
writeStartElement in interface javax.xml.stream.XMLStreamWriter

writeStartElement

public void writeStartElement(String prefix,
                              String localName,
                              String namespaceURI)
            throws javax.xml.stream.XMLStreamException
Specified by:
writeStartElement in interface javax.xml.stream.XMLStreamWriter

writeStartElementInternal

protected void writeStartElementInternal(String namespaceURI,
                                         String localName)
            throws javax.xml.stream.XMLStreamException