org.jboss.xml.binding
Class XercesXsMarshaller

java.lang.Object
  extended byorg.jboss.xml.binding.AbstractMarshaller (src) 
      extended byorg.jboss.xml.binding.XercesXsMarshaller
All Implemented Interfaces:
Marshaller (src)

public class XercesXsMarshaller
extends AbstractMarshaller (src)


Nested Class Summary
 
Nested classes inherited from class org.jboss.xml.binding.AbstractMarshaller (src)
AbstractMarshaller.ClassMapping (src) , AbstractMarshaller.Stack (src) , AbstractMarshaller.StackImpl (src)
 
Nested classes inherited from class org.jboss.xml.binding.Marshaller (src)
Marshaller.FACTORY (src)
 
Field Summary
 
Fields inherited from class org.jboss.xml.binding.AbstractMarshaller (src)
encoding, rootQNames, version
 
Fields inherited from interface org.jboss.xml.binding.Marshaller (src)
ENCODING, PROP_MARSHALLER, PROP_OUTPUT_INDENTATION, PROP_OUTPUT_XML_VERSION, VERSION
 
Constructor Summary
XercesXsMarshaller()
           
 
Method Summary
 void addAttribute(java.lang.String prefix, java.lang.String localName, java.lang.String type, java.lang.String value)
          Adds an attribute to the top most elements.
 void declareNamespace(java.lang.String name, java.lang.String uri)
          Defines a namespace.
 void marshal(java.io.Reader xsdReader, ObjectModelProvider (src)  provider, java.lang.Object root, java.io.Writer writer)
           
 void marshal(java.lang.String xsdURL, ObjectModelProvider (src)  provider, java.lang.Object root, java.io.Writer writer)
           
 
Methods inherited from class org.jboss.xml.binding.AbstractMarshaller (src)
addRootElement, getClassMapping, getProperty, mapClassToNamespace, mapClassToNamespace, mapPublicIdToSystemId, propertyIsTrueOrNotSet, setEncoding, setProperty, setVersion, writeXmlVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XercesXsMarshaller

public XercesXsMarshaller()
Method Detail

declareNamespace

public void declareNamespace(java.lang.String name,
                             java.lang.String uri)
Defines a namespace. The namespace declaration will appear in the root element.

If name argument is null or is an empty string then the passed in URI will be used for the default namespace, i.e. xmlns. Otherwise, the declaration will follow the format xmlns:name=uri.

If the namespace with the given name was already declared, its value is overwritten.

Parameters:
name - the name of the namespace to declare (can be null or empty string)
uri - the URI of the namespace.

addAttribute

public void addAttribute(java.lang.String prefix,
                         java.lang.String localName,
                         java.lang.String type,
                         java.lang.String value)
Adds an attribute to the top most elements. First, we check whether there is a namespace associated with the passed in prefix. If the prefix was not declared, an exception is thrown.

Parameters:
prefix - the prefix of the attribute to be declared
localName - local name of the attribute
type - the type of the attribute
value - the value of the attribute

marshal

public void marshal(java.io.Reader xsdReader,
                    ObjectModelProvider (src)  provider,
                    java.lang.Object root,
                    java.io.Writer writer)
             throws java.io.IOException,
                    org.xml.sax.SAXException,
                    javax.xml.parsers.ParserConfigurationException
Throws:
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException

marshal

public void marshal(java.lang.String xsdURL,
                    ObjectModelProvider (src)  provider,
                    java.lang.Object root,
                    java.io.Writer writer)
             throws java.io.IOException,
                    org.xml.sax.SAXException
Specified by:
marshal in interface Marshaller (src)
Overrides:
marshal in class AbstractMarshaller (src)
Throws:
java.io.IOException
org.xml.sax.SAXException