public final class MarshallerImpl
extends javax.xml.bind.helpers.AbstractMarshallerImpl
implements javax.xml.bind.ValidationEventHandler
Marshaller
interface for the JAXB RI.
Eventually all the marshal(java.lang.Object, java.io.OutputStream, javax.xml.namespace.NamespaceContext)
methods call into
the write(com.sun.xml.bind.v2.runtime.Name, com.sun.xml.bind.v2.runtime.JaxBeanInfo<T>, T, com.sun.xml.bind.v2.runtime.output.XmlOutput, java.lang.Runnable)
method.
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
C14N |
protected static java.lang.String |
ENCODING_HANDLER |
protected static java.lang.String |
ENCODING_HANDLER2 |
protected static java.lang.String |
INDENT_STRING |
protected static java.lang.String |
OBJECT_IDENTITY_CYCLE_DETECTION |
protected static java.lang.String |
PREFIX_MAPPER |
protected XMLSerializer |
serializer |
protected static java.lang.String |
XML_HEADERS |
protected static java.lang.String |
XMLDECLARATION |
Constructor and Description |
---|
MarshallerImpl(JAXBContextImpl c,
AssociationMap assoc) |
Modifier and Type | Method and Description |
---|---|
protected CharacterEscapeHandler |
createEscapeHandler(java.lang.String encoding) |
XmlOutput |
createWriter(java.io.OutputStream os) |
XmlOutput |
createWriter(java.io.OutputStream os,
java.lang.String encoding) |
XmlOutput |
createWriter(java.io.Writer w) |
XmlOutput |
createWriter(java.io.Writer w,
java.lang.String encoding) |
<A extends javax.xml.bind.annotation.adapters.XmlAdapter> |
getAdapter(java.lang.Class<A> type) |
javax.xml.bind.attachment.AttachmentMarshaller |
getAttachmentMarshaller() |
JAXBContextImpl |
getContext() |
javax.xml.bind.Marshaller.Listener |
getListener() |
java.lang.Object |
getProperty(java.lang.String name) |
javax.xml.validation.Schema |
getSchema() |
boolean |
handleEvent(javax.xml.bind.ValidationEvent event)
Default error handling behavior fot
Marshaller . |
void |
marshal(java.lang.Object obj,
java.io.OutputStream out,
javax.xml.namespace.NamespaceContext inscopeNamespace)
Marshals to
OutputStream with the given in-scope namespaces
taken into account. |
void |
marshal(java.lang.Object target,
javax.xml.transform.Result result) |
void |
marshal(java.lang.Object obj,
javax.xml.stream.XMLEventWriter writer) |
void |
marshal(java.lang.Object obj,
XmlOutput output) |
void |
marshal(java.lang.Object obj,
javax.xml.stream.XMLStreamWriter writer) |
<A extends javax.xml.bind.annotation.adapters.XmlAdapter> |
setAdapter(java.lang.Class<A> type,
A adapter) |
void |
setAttachmentMarshaller(javax.xml.bind.attachment.AttachmentMarshaller am) |
void |
setListener(javax.xml.bind.Marshaller.Listener listener) |
void |
setProperty(java.lang.String name,
java.lang.Object value) |
void |
setSchema(javax.xml.validation.Schema s) |
protected <T> void |
write(Name rootTagName,
JaxBeanInfo<T> bi,
T obj,
XmlOutput out,
java.lang.Runnable postInitAction)
Used by
BridgeImpl to write an arbitrary object as a fragment. |
getEncoding, getEventHandler, getJavaEncoding, getNode, getNoNSSchemaLocation, getSchemaLocation, isFormattedOutput, isFragment, marshal, marshal, marshal, marshal, marshal, setAdapter, setEncoding, setEventHandler, setFormattedOutput, setFragment, setNoNSSchemaLocation, setSchemaLocation
protected final XMLSerializer serializer
protected static final java.lang.String INDENT_STRING
protected static final java.lang.String PREFIX_MAPPER
protected static final java.lang.String ENCODING_HANDLER
protected static final java.lang.String ENCODING_HANDLER2
protected static final java.lang.String XMLDECLARATION
protected static final java.lang.String XML_HEADERS
protected static final java.lang.String C14N
protected static final java.lang.String OBJECT_IDENTITY_CYCLE_DETECTION
public MarshallerImpl(JAXBContextImpl c, AssociationMap assoc)
assoc
- non-null if the marshaller is working inside BinderImpl
.public JAXBContextImpl getContext()
public void marshal(java.lang.Object obj, java.io.OutputStream out, javax.xml.namespace.NamespaceContext inscopeNamespace) throws javax.xml.bind.JAXBException
OutputStream
with the given in-scope namespaces
taken into account.javax.xml.bind.JAXBException
public void marshal(java.lang.Object obj, javax.xml.stream.XMLStreamWriter writer) throws javax.xml.bind.JAXBException
marshal
in interface javax.xml.bind.Marshaller
marshal
in class javax.xml.bind.helpers.AbstractMarshallerImpl
javax.xml.bind.JAXBException
public void marshal(java.lang.Object obj, javax.xml.stream.XMLEventWriter writer) throws javax.xml.bind.JAXBException
marshal
in interface javax.xml.bind.Marshaller
marshal
in class javax.xml.bind.helpers.AbstractMarshallerImpl
javax.xml.bind.JAXBException
public void marshal(java.lang.Object obj, XmlOutput output) throws javax.xml.bind.JAXBException
javax.xml.bind.JAXBException
public void marshal(java.lang.Object target, javax.xml.transform.Result result) throws javax.xml.bind.JAXBException
marshal
in interface javax.xml.bind.Marshaller
javax.xml.bind.JAXBException
protected final <T> void write(Name rootTagName, JaxBeanInfo<T> bi, T obj, XmlOutput out, java.lang.Runnable postInitAction) throws javax.xml.bind.JAXBException
BridgeImpl
to write an arbitrary object as a fragment.javax.xml.bind.JAXBException
protected CharacterEscapeHandler createEscapeHandler(java.lang.String encoding)
public XmlOutput createWriter(java.io.Writer w, java.lang.String encoding)
public XmlOutput createWriter(java.io.Writer w)
public XmlOutput createWriter(java.io.OutputStream os) throws javax.xml.bind.JAXBException
javax.xml.bind.JAXBException
public XmlOutput createWriter(java.io.OutputStream os, java.lang.String encoding) throws javax.xml.bind.JAXBException
javax.xml.bind.JAXBException
public java.lang.Object getProperty(java.lang.String name) throws javax.xml.bind.PropertyException
getProperty
in interface javax.xml.bind.Marshaller
getProperty
in class javax.xml.bind.helpers.AbstractMarshallerImpl
javax.xml.bind.PropertyException
public void setProperty(java.lang.String name, java.lang.Object value) throws javax.xml.bind.PropertyException
setProperty
in interface javax.xml.bind.Marshaller
setProperty
in class javax.xml.bind.helpers.AbstractMarshallerImpl
javax.xml.bind.PropertyException
public <A extends javax.xml.bind.annotation.adapters.XmlAdapter> void setAdapter(java.lang.Class<A> type, A adapter)
setAdapter
in interface javax.xml.bind.Marshaller
setAdapter
in class javax.xml.bind.helpers.AbstractMarshallerImpl
public <A extends javax.xml.bind.annotation.adapters.XmlAdapter> A getAdapter(java.lang.Class<A> type)
getAdapter
in interface javax.xml.bind.Marshaller
getAdapter
in class javax.xml.bind.helpers.AbstractMarshallerImpl
public void setAttachmentMarshaller(javax.xml.bind.attachment.AttachmentMarshaller am)
setAttachmentMarshaller
in interface javax.xml.bind.Marshaller
setAttachmentMarshaller
in class javax.xml.bind.helpers.AbstractMarshallerImpl
public javax.xml.bind.attachment.AttachmentMarshaller getAttachmentMarshaller()
getAttachmentMarshaller
in interface javax.xml.bind.Marshaller
getAttachmentMarshaller
in class javax.xml.bind.helpers.AbstractMarshallerImpl
public javax.xml.validation.Schema getSchema()
getSchema
in interface javax.xml.bind.Marshaller
getSchema
in class javax.xml.bind.helpers.AbstractMarshallerImpl
public void setSchema(javax.xml.validation.Schema s)
setSchema
in interface javax.xml.bind.Marshaller
setSchema
in class javax.xml.bind.helpers.AbstractMarshallerImpl
public boolean handleEvent(javax.xml.bind.ValidationEvent event)
Marshaller
.handleEvent
in interface javax.xml.bind.ValidationEventHandler
public javax.xml.bind.Marshaller.Listener getListener()
getListener
in interface javax.xml.bind.Marshaller
getListener
in class javax.xml.bind.helpers.AbstractMarshallerImpl
public void setListener(javax.xml.bind.Marshaller.Listener listener)
setListener
in interface javax.xml.bind.Marshaller
setListener
in class javax.xml.bind.helpers.AbstractMarshallerImpl