org.apache.ws.jaxme.impl

Class JMSAXDriverController


public class JMSAXDriverController
extends java.lang.Object

The controller is created by the JMMarshaller for marshalling a given element.

Constructor Summary

JMSAXDriverController(JMMarshallerImpl pMarshaller, ContentHandler pTarget)
Creates a new instance with the given marshaller and target.

Method Summary

protected void
addSchemaLocationAttributes(JMSAXDriver pDriver, AttributesImpl pAttrs)
String
getAttrQName(JMSAXDriver pDriver, String pNamespaceURI, String pLocalName)
Returns the qualified name of the attribute pLocalName.
DatatypeConverterInterface
getDatatypeConverter()
Returns the DatatypeConverterInterface being used for conversion of atomic values.
String
getElementQName(JMSAXDriver pDriver, String pNamespaceURI, String pLocalName)
Returns the qualified name of the element pLocalName in namespace pNamespaceURI.
protected String
getElementQName(JMSAXDriver pDriver, String pPrefix, String pNamespaceURI, String pLocalName)
JMMarshallerImpl
getJMMarshaller()
Returns the Marshaller, which created the controller.
NamespaceSupport
getNamespaceContext()
Returns an instance of NamespaceSupport.
protected String
getNewPrefix(String pURI, String pSuggestedPrefix)
protected String
getPreferredPrefix(JMSAXDriver pDriver, String pURI)
ContentHandler
getTarget()
Returns the target handler, to which SAX events are being fired.
void
marshal(JMSAXDriver pDriver, String pNamespaceURI, String pLocalName, Object pElement)
Marshals the given object, creating an element with the given namespace URI and local name.
void
marshal(JMSAXDriver pDriver, String pPrefix, String pNamespaceURI, String pLocalName, Object pElement)
Marshals the given object, creating a root element with the given namespace URI and local name.
void
marshalSimpleChild(JMSAXDriver pDriver, String pNamespaceURI, String pLocalName, String pValue)
Called by the driver for creating a simple child.
void
printConversionEvent(Object pObject, String pMsg, Exception pException)

Constructor Details

JMSAXDriverController

public JMSAXDriverController(JMMarshallerImpl pMarshaller,
                             ContentHandler pTarget)
            throws SAXException
Creates a new instance with the given marshaller and target.

Method Details

addSchemaLocationAttributes

protected void addSchemaLocationAttributes(JMSAXDriver pDriver,
                                           AttributesImpl pAttrs)
            throws SAXException

getAttrQName

public String getAttrQName(JMSAXDriver pDriver,
                           String pNamespaceURI,
                           String pLocalName)
            throws SAXException
Returns the qualified name of the attribute pLocalName. In other words, attachs a prefix, if required.

getDatatypeConverter

public DatatypeConverterInterface getDatatypeConverter()
Returns the DatatypeConverterInterface being used for conversion of atomic values.

getElementQName

public String getElementQName(JMSAXDriver pDriver,
                              String pNamespaceURI,
                              String pLocalName)
            throws SAXException
Returns the qualified name of the element pLocalName in namespace pNamespaceURI. In other words, it attachs a prefix, if required.

getElementQName

protected String getElementQName(JMSAXDriver pDriver,
                                 String pPrefix,
                                 String pNamespaceURI,
                                 String pLocalName)
            throws SAXException

getJMMarshaller

public JMMarshallerImpl getJMMarshaller()
Returns the Marshaller, which created the controller.

getNamespaceContext

public NamespaceSupport getNamespaceContext()
Returns an instance of NamespaceSupport.

getNewPrefix

protected String getNewPrefix(String pURI,
                              String pSuggestedPrefix)

getPreferredPrefix

protected String getPreferredPrefix(JMSAXDriver pDriver,
                                    String pURI)

getTarget

public ContentHandler getTarget()
Returns the target handler, to which SAX events are being fired.

marshal

public void marshal(JMSAXDriver pDriver,
                    String pNamespaceURI,
                    String pLocalName,
                    Object pElement)
            throws SAXException
Marshals the given object, creating an element with the given namespace URI and local name.
Parameters:
pElement - The element being marshalled. It must be an instance of the class associated to this specific JMXmlSerializer.

marshal

public void marshal(JMSAXDriver pDriver,
                    String pPrefix,
                    String pNamespaceURI,
                    String pLocalName,
                    Object pElement)
            throws SAXException
Marshals the given object, creating a root element with the given namespace URI and local name.
Parameters:
pElement - The element being marshalled. It must be an instance of the class associated to this specific JMXmlSerializer.

marshalSimpleChild

public void marshalSimpleChild(JMSAXDriver pDriver,
                               String pNamespaceURI,
                               String pLocalName,
                               String pValue)
            throws SAXException
Called by the driver for creating a simple child.

printConversionEvent

public void printConversionEvent(Object pObject,
                                 String pMsg,
                                 Exception pException)
            throws SAXException