org.apache.ws.jaxme.impl

Class XMLWriterImpl

public class XMLWriterImpl extends Object implements XMLWriter

A simple serializer for XML documents.

Author: Jochen Wiedmann

Constructor Summary
XMLWriterImpl()
Creates a new JaxbXmlSerializer
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
JMMarshallerImplgetMarshaller()

Returns the JaxbXMLSerializers Marshaller.

WritergetWriter()

Returns the JaxbXMLSerializers Writer.

voidignorableWhitespace(char[] ch, int start, int length)
Calls the character method with the same arguments.
voidinit(JMMarshallerImpl pMarshaller)

Sets the JaxbXMLSerializers Marshaller.

voidprocessingInstruction(String target, String data)
Inserts a processing instruction.
voidsetDocumentLocator(Locator pLocator)
Sets the locator.
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.

Constructor Detail

XMLWriterImpl

public XMLWriterImpl()
Creates a new JaxbXmlSerializer

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

getMarshaller

public JMMarshallerImpl getMarshaller()

Returns the JaxbXMLSerializers Marshaller.

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.

init

public void init(JMMarshallerImpl pMarshaller)

Sets the JaxbXMLSerializers Marshaller.

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

setDocumentLocator

public void setDocumentLocator(Locator pLocator)
Sets the locator.

Parameters: pLocator A locator for use in case of errors

See Also: XMLWriterImpl

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.