Class MarshallerImpl
java.lang.Object
jakarta.xml.bind.helpers.AbstractMarshallerImpl
org.glassfish.jaxb.runtime.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(org.glassfish.jaxb.runtime.v2.runtime.Name, org.glassfish.jaxb.runtime.v2.runtime.JaxBeanInfo<T>, T, org.glassfish.jaxb.runtime.v2.runtime.output.XmlOutput, java.lang.Runnable) method.
- Author:
- Kohsuke Kawaguchi, Vivek Pandey
-
Nested Class Summary
Nested classes/interfaces inherited from interface jakarta.xml.bind.Marshaller
Marshaller.Listener -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected final XMLSerializerprotected static final Stringprotected static final StringFields inherited from interface jakarta.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 CharacterEscapeHandlercreateEscapeHandler(String encoding) createWriter(OutputStream os, String encoding) createWriter(Writer w, String encoding) <A extends XmlAdapter<?,?>>
AgetAdapter(Class<A> type) getProperty(String name) booleanhandleEvent(ValidationEvent event) Default error handling behavior fotMarshaller.voidmarshal(Object obj, OutputStream out, NamespaceContext inscopeNamespace) Marshals toOutputStreamwith the given in-scope namespaces taken into account.voidmarshal(Object obj, XMLEventWriter writer) voidmarshal(Object obj, XMLStreamWriter writer) voidvoid<A extends XmlAdapter<?,?>>
voidsetAdapter(Class<A> type, A adapter) voidvoidsetListener(Marshaller.Listener listener) voidsetProperty(String name, Object value) voidprotected <T> voidwrite(Name rootTagName, JaxBeanInfo<T> bi, T obj, XmlOutput out, Runnable postInitAction) Used byBridgeImplto write an arbitrary object as a fragment.Methods inherited from class jakarta.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 toOutputStreamwith the given in-scope namespaces taken into account.- Throws:
JAXBException- Since:
- 2.1.5
-
marshal
- Specified by:
marshalin interfaceMarshaller- Overrides:
marshalin classAbstractMarshallerImpl- Throws:
JAXBException
-
marshal
- Specified by:
marshalin interfaceMarshaller- Overrides:
marshalin classAbstractMarshallerImpl- Throws:
JAXBException
-
marshal
- Throws:
JAXBException
-
marshal
- Specified by:
marshalin interfaceMarshaller- Throws:
JAXBException
-
write
protected <T> void write(Name rootTagName, JaxBeanInfo<T> bi, T obj, XmlOutput out, Runnable postInitAction) throws JAXBException Used byBridgeImplto write an arbitrary object as a fragment.- Throws:
JAXBException
-
createEscapeHandler
-
createWriter
-
createWriter
-
createWriter
- Throws:
JAXBException
-
createWriter
- Throws:
JAXBException
-
getProperty
- Specified by:
getPropertyin interfaceMarshaller- Overrides:
getPropertyin classAbstractMarshallerImpl- Throws:
PropertyException
-
setProperty
- Specified by:
setPropertyin interfaceMarshaller- Overrides:
setPropertyin classAbstractMarshallerImpl- Throws:
PropertyException
-
setAdapter
- Specified by:
setAdapterin interfaceMarshaller- Overrides:
setAdapterin classAbstractMarshallerImpl
-
getAdapter
- Specified by:
getAdapterin interfaceMarshaller- Overrides:
getAdapterin classAbstractMarshallerImpl
-
setAttachmentMarshaller
- Specified by:
setAttachmentMarshallerin interfaceMarshaller- Overrides:
setAttachmentMarshallerin classAbstractMarshallerImpl
-
getAttachmentMarshaller
- Specified by:
getAttachmentMarshallerin interfaceMarshaller- Overrides:
getAttachmentMarshallerin classAbstractMarshallerImpl
-
getSchema
- Specified by:
getSchemain interfaceMarshaller- Overrides:
getSchemain classAbstractMarshallerImpl
-
setSchema
- Specified by:
setSchemain interfaceMarshaller- Overrides:
setSchemain classAbstractMarshallerImpl
-
handleEvent
Default error handling behavior fotMarshaller.- Specified by:
handleEventin interfaceValidationEventHandler
-
getListener
- Specified by:
getListenerin interfaceMarshaller- Overrides:
getListenerin classAbstractMarshallerImpl
-
setListener
- Specified by:
setListenerin interfaceMarshaller- Overrides:
setListenerin classAbstractMarshallerImpl
-