public final class MarshallerImpl extends AbstractMarshallerImpl implements 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.
Marshaller.Listener
Modifier and Type | Field and Description |
---|---|
protected static String |
C14N |
protected static String |
ENCODING_HANDLER |
protected static String |
ENCODING_HANDLER2 |
protected static String |
INDENT_STRING |
protected static String |
OBJECT_IDENTITY_CYCLE_DETECTION |
protected static String |
PREFIX_MAPPER |
protected XMLSerializer |
serializer |
protected static String |
XML_HEADERS |
protected static String |
XMLDECLARATION |
JAXB_ENCODING, JAXB_FORMATTED_OUTPUT, JAXB_FRAGMENT, JAXB_NO_NAMESPACE_SCHEMA_LOCATION, JAXB_SCHEMA_LOCATION
Constructor and Description |
---|
MarshallerImpl(JAXBContextImpl c,
AssociationMap assoc) |
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 String INDENT_STRING
protected static final String PREFIX_MAPPER
protected static final String ENCODING_HANDLER
protected static final String ENCODING_HANDLER2
protected static final String XMLDECLARATION
protected static final String XML_HEADERS
protected static final String C14N
protected static final 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(Object obj, OutputStream out, NamespaceContext inscopeNamespace) throws JAXBException
OutputStream
with the given in-scope namespaces
taken into account.JAXBException
public void marshal(Object obj, XMLStreamWriter writer) throws JAXBException
marshal
in interface Marshaller
marshal
in class AbstractMarshallerImpl
JAXBException
public void marshal(Object obj, XMLEventWriter writer) throws JAXBException
marshal
in interface Marshaller
marshal
in class AbstractMarshallerImpl
JAXBException
public void marshal(Object obj, XmlOutput output) throws JAXBException
JAXBException
public void marshal(Object target, Result result) throws JAXBException
marshal
in interface Marshaller
JAXBException
protected final <T> void write(Name rootTagName, JaxBeanInfo<T> bi, T obj, XmlOutput out, Runnable postInitAction) throws JAXBException
BridgeImpl
to write an arbitrary object as a fragment.JAXBException
protected CharacterEscapeHandler createEscapeHandler(String encoding)
public XmlOutput createWriter(OutputStream os) throws JAXBException
JAXBException
public XmlOutput createWriter(OutputStream os, String encoding) throws JAXBException
JAXBException
public Object getProperty(String name) throws PropertyException
getProperty
in interface Marshaller
getProperty
in class AbstractMarshallerImpl
PropertyException
public void setProperty(String name, Object value) throws PropertyException
setProperty
in interface Marshaller
setProperty
in class AbstractMarshallerImpl
PropertyException
public <A extends XmlAdapter> void setAdapter(Class<A> type, A adapter)
setAdapter
in interface Marshaller
setAdapter
in class AbstractMarshallerImpl
public <A extends XmlAdapter> A getAdapter(Class<A> type)
getAdapter
in interface Marshaller
getAdapter
in class AbstractMarshallerImpl
public void setAttachmentMarshaller(AttachmentMarshaller am)
setAttachmentMarshaller
in interface Marshaller
setAttachmentMarshaller
in class AbstractMarshallerImpl
public AttachmentMarshaller getAttachmentMarshaller()
getAttachmentMarshaller
in interface Marshaller
getAttachmentMarshaller
in class AbstractMarshallerImpl
public Schema getSchema()
getSchema
in interface Marshaller
getSchema
in class AbstractMarshallerImpl
public void setSchema(Schema s)
setSchema
in interface Marshaller
setSchema
in class AbstractMarshallerImpl
public boolean handleEvent(ValidationEvent event)
Marshaller
.handleEvent
in interface ValidationEventHandler
public Marshaller.Listener getListener()
getListener
in interface Marshaller
getListener
in class AbstractMarshallerImpl
public void setListener(Marshaller.Listener listener)
setListener
in interface Marshaller
setListener
in class AbstractMarshallerImpl
Copyright © 2019 Oracle Corporation. All rights reserved.