org.jboss.xb.binding
Class XercesXsMarshaller
java.lang.Object
org.jboss.xb.binding.AbstractMarshaller
org.jboss.xb.binding.XercesXsMarshaller
- All Implemented Interfaces:
- Marshaller
public class XercesXsMarshaller
- extends AbstractMarshaller
- Version:
- $Revision: 1.1.2.6 $
- Author:
- Alexey Loubyansky
Method Summary |
void |
addAttribute(String prefix,
String localName,
String type,
String value)
Adds an attribute to the top most elements. |
void |
declareNamespace(String name,
String uri)
Defines a namespace. |
javax.xml.namespace.QName |
getRootTypeQName()
|
boolean |
isSupportNil()
|
static org.apache.xerces.xs.XSModel |
loadSchema(Reader xsdReader)
|
static org.apache.xerces.xs.XSModel |
loadSchema(String xsdURL)
|
void |
marshal(Reader xsdReader,
ObjectModelProvider provider,
Object root,
Writer writer)
|
void |
marshal(String xsdURL,
ObjectModelProvider provider,
Object root,
Writer writer)
|
void |
setRootTypeQName(javax.xml.namespace.QName rootTypeQName)
|
void |
setSupportNil(boolean supportNil)
|
Methods inherited from class org.jboss.xb.binding.AbstractMarshaller |
addRootElement, 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 |
XercesXsMarshaller
public XercesXsMarshaller()
getRootTypeQName
public javax.xml.namespace.QName getRootTypeQName()
setRootTypeQName
public void setRootTypeQName(javax.xml.namespace.QName rootTypeQName)
isSupportNil
public boolean isSupportNil()
setSupportNil
public void setSupportNil(boolean supportNil)
declareNamespace
public void declareNamespace(String name,
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(String prefix,
String localName,
String type,
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 declaredlocalName
- local name of the attributetype
- the type of the attributevalue
- the value of the attribute
marshal
public void marshal(Reader xsdReader,
ObjectModelProvider provider,
Object root,
Writer writer)
throws IOException,
SAXException,
ParserConfigurationException
- Throws:
IOException
SAXException
ParserConfigurationException
marshal
public void marshal(String xsdURL,
ObjectModelProvider provider,
Object root,
Writer writer)
throws IOException,
SAXException
- Specified by:
marshal
in interface Marshaller
- Overrides:
marshal
in class AbstractMarshaller
- Throws:
IOException
SAXException
loadSchema
public static org.apache.xerces.xs.XSModel loadSchema(String xsdURL)
loadSchema
public static org.apache.xerces.xs.XSModel loadSchema(Reader xsdReader)
Copyright © 2002 JBoss Group, LLC. All Rights Reserved.