public class JAXBMarshaller extends Object implements Marshaller
Purpose:To Provide an implementation of the JAXB 2.0 Marshaller Interface
Responsibilities:
This implementation of the JAXB 2.1/2.2 Marshaller interface provides the required functionality by acting as a thin wrapper on the existing XMLMarshaller API.
Marshaller
,
MarshallerProperties
,
XMLMarshaller
Marshaller.Listener
Modifier and Type | Field and Description |
---|---|
static String |
XML_JAVATYPE_ADAPTERS |
JAXB_ENCODING, JAXB_FORMATTED_OUTPUT, JAXB_FRAGMENT, JAXB_NO_NAMESPACE_SCHEMA_LOCATION, JAXB_SCHEMA_LOCATION
Constructor and Description |
---|
JAXBMarshaller(XMLMarshaller newXMLMarshaller,
JAXBContext jaxbContext)
This constructor initializes various settings on the XML marshaller.
|
public static final String XML_JAVATYPE_ADAPTERS
public JAXBMarshaller(XMLMarshaller newXMLMarshaller, JAXBContext jaxbContext)
newXMLMarshaller
- xml marshallerjaxbContext
- jaxb contextpublic XmlAdapter getAdapter(Class javaClass)
getAdapter
in interface Marshaller
public AttachmentMarshaller getAttachmentMarshaller()
getAttachmentMarshaller
in interface Marshaller
public ValidationEventHandler getEventHandler() throws JAXBException
getEventHandler
in interface Marshaller
JAXBException
public Marshaller.Listener getListener()
getListener
in interface Marshaller
public Node getNode(Object object) throws JAXBException
getNode
in interface Marshaller
JAXBException
public Object getProperty(String key) throws PropertyException
getProperty
in interface Marshaller
PropertyException
MarshallerProperties
public Schema getSchema()
getSchema
in interface Marshaller
public void marshal(Object object, ContentHandler contentHandler) throws JAXBException
marshal
in interface Marshaller
JAXBException
public void marshal(Object object, XMLEventWriter eventWriter) throws JAXBException
marshal
in interface Marshaller
JAXBException
public void marshal(Object object, XMLEventWriter eventWriter, TypeMappingInfo type) throws JAXBException
JAXBException
public void marshal(Object object, Node node) throws JAXBException
marshal
in interface Marshaller
JAXBException
public void marshal(Object object, OutputStream outputStream) throws JAXBException
marshal
in interface Marshaller
JAXBException
public void marshal(Object object, File file) throws JAXBException
marshal
in interface Marshaller
JAXBException
public void marshal(Object object, Result result) throws JAXBException
marshal
in interface Marshaller
JAXBException
public void marshal(Object object, Result result, TypeMappingInfo type) throws JAXBException
JAXBException
public void marshal(Object object, XMLStreamWriter streamWriter) throws JAXBException
marshal
in interface Marshaller
JAXBException
public void marshal(Object object, XMLStreamWriter streamWriter, TypeMappingInfo type) throws JAXBException
JAXBException
public void marshal(Object object, Writer writer) throws JAXBException
marshal
in interface Marshaller
JAXBException
public void marshal(Object object, MarshalRecord record) throws JAXBException
JAXBException
public void marshal(Object object, MarshalRecord record, TypeMappingInfo type) throws JAXBException
JAXBException
public void setAdapter(Class javaClass, XmlAdapter adapter)
setAdapter
in interface Marshaller
public void setAdapter(XmlAdapter adapter)
setAdapter
in interface Marshaller
public void setAttachmentMarshaller(AttachmentMarshaller attachmentMarshaller)
setAttachmentMarshaller
in interface Marshaller
public void setEventHandler(ValidationEventHandler newValidationEventHandler) throws JAXBException
setEventHandler
in interface Marshaller
JAXBException
public void setListener(Marshaller.Listener listener)
setListener
in interface Marshaller
public void setMarshalCallbacks(Map callbacks)
public void setProperty(String key, Object value) throws PropertyException
setProperty
in interface Marshaller
PropertyException
MarshallerProperties
public void setSchema(Schema schema)
setSchema
in interface Marshaller
public JAXBContext getJaxbContext()
public XMLMarshaller getXMLMarshaller()
public Set<ConstraintViolationWrapper<Object>> getConstraintViolations()
JAXBBeanValidator
instance.