org.apache.ws.commons.serialize

Class XMLWriterImpl

public class XMLWriterImpl extends Object implements XMLWriter

Default implementation of XMLWriter. Works with Java 1.2 and later.
Method Summary
booleancanEncode(char c)
voidcharacters(char[] ch, int start, int length)
Inserts a string of characters into the document.
voidendDocument()

This method finishs the handlers action.

voidendElement(String namespaceURI, String localName, String qName)

Terminates an element.

voidendPrefixMapping(String prefix)

Terminates use of a namespace prefix.

LocatorgetDocumentLocator()
Returns the locator
StringgetEncoding()
StringgetIndentString()
StringgetLineFeed()
WritergetWriter()

Returns the JaxbXMLSerializers Writer.

voidignorableWhitespace(char[] ch, int start, int length)
Calls the character method with the same arguments.
booleanisDeclarating()
booleanisFlushing()
booleanisIndenting()
voidprocessingInstruction(String target, String data)
Inserts a processing instruction.
voidsetDeclarating(boolean pDeclarating)
voidsetDocumentLocator(Locator pLocator)
Sets the locator.
voidsetEncoding(String pEncoding)
voidsetFlushing(boolean pFlushing)
voidsetIndenting(boolean pIndenting)
voidsetIndentString(String pIndentString)
voidsetLineFeed(String pLineFeed)
voidsetWriter(Writer pWriter)

Sets the JaxbXMLSerializers Writer.

voidskippedEntity(String ent)
Not actually implemented, because I don't know how to skip entities.
voidstartDocument()

Starts a document.

voidstartElement(String namespaceURI, String localName, String qName, Attributes attr)
Starts a new element.
voidstartPrefixMapping(String prefix, String namespaceURI)

Starts use of a namespace prefix.

Method Detail

canEncode

public boolean canEncode(char c)

characters

public void characters(char[] ch, int start, int length)
Inserts a string of characters into the document.

Parameters: ch The characters being inserted. A substring, to be precise. start Index of the first character length Number of characters being inserted

Throws: SAXException Thrown in case of an IOException

endDocument

public void endDocument()

This method finishs the handlers action. After calling endDocument you may start a new action by calling startDocument again.

Throws: SAXException Not actually thrown, just for compliance to the interface specification.

endElement

public void endElement(String namespaceURI, String localName, String qName)

Terminates an element.

Parameters: namespaceURI The namespace URI, if any, or null localName The local name, without prefix, or null qName The qualified name, including a prefix, or null

Throws: SAXException Thrown in case of an IOException.

endPrefixMapping

public void endPrefixMapping(String prefix)

Terminates use of a namespace prefix.

Parameters: prefix The prefix being abandoned.

Throws: SAXException Not actually thrown, just for compliance to the interface specification.

getDocumentLocator

public Locator getDocumentLocator()
Returns the locator

Returns: A locator previously set with setDocumentLocator or null.

See Also: XMLWriterImpl

getEncoding

public String getEncoding()

getIndentString

public String getIndentString()

getLineFeed

public String getLineFeed()

getWriter

public Writer getWriter()

Returns the JaxbXMLSerializers Writer.

ignorableWhitespace

public void ignorableWhitespace(char[] ch, int start, int length)
Calls the character method with the same arguments.

Parameters: ch A string of whitespace characters being inserted into the document. start The index of the first character. length The number of characters.

Throws: SAXException Thrown in case of an IOException.

isDeclarating

public boolean isDeclarating()

isFlushing

public boolean isFlushing()

isIndenting

public boolean isIndenting()

processingInstruction

public void processingInstruction(String target, String data)
Inserts a processing instruction.

Parameters: target The PI target data The PI data

Throws: SAXException Thrown in case of an IOException

setDeclarating

public void setDeclarating(boolean pDeclarating)

setDocumentLocator

public void setDocumentLocator(Locator pLocator)
Sets the locator.

Parameters: pLocator A locator for use in case of errors

See Also: XMLWriterImpl

setEncoding

public void setEncoding(String pEncoding)

setFlushing

public void setFlushing(boolean pFlushing)

setIndenting

public void setIndenting(boolean pIndenting)

setIndentString

public void setIndentString(String pIndentString)

setLineFeed

public void setLineFeed(String pLineFeed)

setWriter

public void setWriter(Writer pWriter)

Sets the JaxbXMLSerializers Writer.

skippedEntity

public void skippedEntity(String ent)
Not actually implemented, because I don't know how to skip entities.

Parameters: ent The entity being skipped.

Throws: SAXException Not actually thrown, just for compliance to the interface specification.

startDocument

public void startDocument()

Starts a document.

Throws: SAXException Not actually thrown, just for compliance to the interface specification.

startElement

public void startElement(String namespaceURI, String localName, String qName, Attributes attr)
Starts a new element.

Parameters: namespaceURI The namespace URI, if any, or null localName The local name, without prefix, or null qName The qualified name, including a prefix, or null attr The element attributes

Throws: SAXException Thrown in case of an IOException.

startPrefixMapping

public void startPrefixMapping(String prefix, String namespaceURI)

Starts use of a namespace prefix.

Parameters: namespaceURI The namespace URI prefix The prefix

Throws: SAXException Not actually thrown, just for compliance to the interface specification.

Copyright © 2005-2009 Apache Software Foundation. All Rights Reserved.