org.apache.ws.jaxme
Interface JMXmlSerializer

All Known Implementing Classes:
JMXmlSerializerImpl

public interface JMXmlSerializer

An XML Serializer is used to marshal a fixed subclass of JMElement. It is unable to marshal generic JMElements. The XML Serializer is typically created by the Manager.

Version:
$Id: JMXmlSerializer.java 231559 2003-09-23 12:37:47Z jochen $
Author:
Jochen Wiedmann

Nested Class Summary
static interface JMXmlSerializer.Data
           
 
Method Summary
 JMXmlSerializer.Data getData(JMMarshaller pMarshaller, org.xml.sax.ContentHandler pHandler)
          Initializes the marshalling stage by creating an instance of JMXmlSerializerData.
 java.lang.String getPreferredPrefix(java.lang.String pURI)
          Returns a suggested prefix for the given URI.
 void init(JAXBContextImpl pFactory)
          Initializes the JMXmlSerializer; called by the JAXBContextImpl before the serializer is returned to the Marshaller.
 void marshal(JMXmlSerializer.Data pData, QName pName, java.lang.Object pElement)
          Marshals the given JMElement.
 

Method Detail

init

void init(JAXBContextImpl pFactory)
          throws JAXBException

Initializes the JMXmlSerializer; called by the JAXBContextImpl before the serializer is returned to the Marshaller. This method must be called only once.

Throws:
JAXBException

getPreferredPrefix

java.lang.String getPreferredPrefix(java.lang.String pURI)

Returns a suggested prefix for the given URI.

Returns:
Prefix suggestion or null, in which case a default selection will happen.

getData

JMXmlSerializer.Data getData(JMMarshaller pMarshaller,
                             org.xml.sax.ContentHandler pHandler)

Initializes the marshalling stage by creating an instance of JMXmlSerializerData.

Parameters:
pMarshaller - The Marshaller controlling the marshalling process. In particular it will be used as an object factory (via its getContext() method) and for reading settings like indentation and the like.
pHandler - The ContentHandler that

marshal

void marshal(JMXmlSerializer.Data pData,
             QName pName,
             java.lang.Object pElement)
             throws org.xml.sax.SAXException

Marshals the given JMElement.

Parameters:
pData - An instance of JMXmlSerializerData that was obtained by calling getData(JMMarshaller, ContentHandler).
pElement - The element being marshalled. It must be an instance of the class associated to this specific JMXmlSerializer.
Throws:
org.xml.sax.SAXException