Package com.sun.xml.bind.v2.runtime
Class MarshallerImpl
java.lang.Object
javax.xml.bind.helpers.AbstractMarshallerImpl
com.sun.xml.bind.v2.runtime.MarshallerImpl
- All Implemented Interfaces:
Marshaller
,ValidationEventHandler
Implementation of
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.
- Author:
- Kohsuke Kawaguchi, Vivek Pandey
-
Nested Class Summary
Nested classes/interfaces inherited from interface javax.xml.bind.Marshaller
Marshaller.Listener
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected final XMLSerializer
protected static final String
protected static final String
Fields inherited from interface javax.xml.bind.Marshaller
JAXB_ENCODING, JAXB_FORMATTED_OUTPUT, JAXB_FRAGMENT, JAXB_NO_NAMESPACE_SCHEMA_LOCATION, JAXB_SCHEMA_LOCATION
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CharacterEscapeHandler
createEscapeHandler
(String encoding) createWriter
(OutputStream os, String encoding) createWriter
(Writer w, String encoding) <A extends XmlAdapter>
AgetAdapter
(Class<A> type) getProperty
(String name) boolean
handleEvent
(ValidationEvent event) Default error handling behavior fotMarshaller
.void
void
marshal
(Object obj, OutputStream out, NamespaceContext inscopeNamespace) Marshals toOutputStream
with the given in-scope namespaces taken into account.void
marshal
(Object obj, XMLEventWriter writer) void
marshal
(Object obj, XMLStreamWriter writer) void
<A extends XmlAdapter>
voidsetAdapter
(Class<A> type, A adapter) void
void
setListener
(Marshaller.Listener listener) void
setProperty
(String name, Object value) void
protected final <T> void
write
(Name rootTagName, JaxBeanInfo<T> bi, T obj, XmlOutput out, Runnable postInitAction) Used byBridgeImpl
to write an arbitrary object as a fragment.Methods inherited from class javax.xml.bind.helpers.AbstractMarshallerImpl
getEncoding, getEventHandler, getJavaEncoding, getNode, getNoNSSchemaLocation, getSchemaLocation, isFormattedOutput, isFragment, marshal, marshal, marshal, marshal, marshal, setAdapter, setEncoding, setEventHandler, setFormattedOutput, setFragment, setNoNSSchemaLocation, setSchemaLocation
-
Field Details
-
serializer
-
INDENT_STRING
- See Also:
-
PREFIX_MAPPER
- See Also:
-
ENCODING_HANDLER
- See Also:
-
ENCODING_HANDLER2
- See Also:
-
XMLDECLARATION
- See Also:
-
XML_HEADERS
- See Also:
-
C14N
- See Also:
-
OBJECT_IDENTITY_CYCLE_DETECTION
- See Also:
-
-
Constructor Details
-
MarshallerImpl
- Parameters:
assoc
- non-null if the marshaller is working insideBinderImpl
.
-
-
Method Details
-
getContext
-
marshal
public void marshal(Object obj, OutputStream out, NamespaceContext inscopeNamespace) throws JAXBException Marshals toOutputStream
with the given in-scope namespaces taken into account.- Throws:
JAXBException
- Since:
- 2.1.5
-
marshal
- Specified by:
marshal
in interfaceMarshaller
- Overrides:
marshal
in classAbstractMarshallerImpl
- Throws:
JAXBException
-
marshal
- Specified by:
marshal
in interfaceMarshaller
- Overrides:
marshal
in classAbstractMarshallerImpl
- Throws:
JAXBException
-
marshal
- Throws:
JAXBException
-
marshal
- Specified by:
marshal
in interfaceMarshaller
- Throws:
JAXBException
-
write
protected final <T> void write(Name rootTagName, JaxBeanInfo<T> bi, T obj, XmlOutput out, Runnable postInitAction) throws JAXBException Used byBridgeImpl
to write an arbitrary object as a fragment.- Throws:
JAXBException
-
createEscapeHandler
-
createWriter
-
createWriter
-
createWriter
- Throws:
JAXBException
-
createWriter
- Throws:
JAXBException
-
getProperty
- Specified by:
getProperty
in interfaceMarshaller
- Overrides:
getProperty
in classAbstractMarshallerImpl
- Throws:
PropertyException
-
setProperty
- Specified by:
setProperty
in interfaceMarshaller
- Overrides:
setProperty
in classAbstractMarshallerImpl
- Throws:
PropertyException
-
setAdapter
- Specified by:
setAdapter
in interfaceMarshaller
- Overrides:
setAdapter
in classAbstractMarshallerImpl
-
getAdapter
- Specified by:
getAdapter
in interfaceMarshaller
- Overrides:
getAdapter
in classAbstractMarshallerImpl
-
setAttachmentMarshaller
- Specified by:
setAttachmentMarshaller
in interfaceMarshaller
- Overrides:
setAttachmentMarshaller
in classAbstractMarshallerImpl
-
getAttachmentMarshaller
- Specified by:
getAttachmentMarshaller
in interfaceMarshaller
- Overrides:
getAttachmentMarshaller
in classAbstractMarshallerImpl
-
getSchema
- Specified by:
getSchema
in interfaceMarshaller
- Overrides:
getSchema
in classAbstractMarshallerImpl
-
setSchema
- Specified by:
setSchema
in interfaceMarshaller
- Overrides:
setSchema
in classAbstractMarshallerImpl
-
handleEvent
Default error handling behavior fotMarshaller
.- Specified by:
handleEvent
in interfaceValidationEventHandler
-
getListener
- Specified by:
getListener
in interfaceMarshaller
- Overrides:
getListener
in classAbstractMarshallerImpl
-
setListener
- Specified by:
setListener
in interfaceMarshaller
- Overrides:
setListener
in classAbstractMarshallerImpl
-