Class JAXBMarshaller

java.lang.Object
org.eclipse.persistence.jaxb.JAXBMarshaller
All Implemented Interfaces:
jakarta.xml.bind.Marshaller

public class JAXBMarshaller extends Object implements jakarta.xml.bind.Marshaller
INTERNAL:

Purpose:To Provide an implementation of the JAXB 2.0 Marshaller Interface

Responsibilities:

  • Provide a JAXB wrapper on the XMLMarshaller API
  • Perform Object to XML Conversions

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.

See Also:
Author:
mmacivor
  • Field Details

  • Constructor Details

    • JAXBMarshaller

      public JAXBMarshaller(XMLMarshaller newXMLMarshaller, JAXBContext jaxbContext)
      This constructor initializes various settings on the XML marshaller.
      Parameters:
      newXMLMarshaller - xml marshaller
      jaxbContext - jaxb context
  • Method Details

    • getAdapter

      public jakarta.xml.bind.annotation.adapters.XmlAdapter getAdapter(Class javaClass)
      Specified by:
      getAdapter in interface jakarta.xml.bind.Marshaller
    • getAttachmentMarshaller

      public jakarta.xml.bind.attachment.AttachmentMarshaller getAttachmentMarshaller()
      Specified by:
      getAttachmentMarshaller in interface jakarta.xml.bind.Marshaller
    • getEventHandler

      public jakarta.xml.bind.ValidationEventHandler getEventHandler() throws jakarta.xml.bind.JAXBException
      Specified by:
      getEventHandler in interface jakarta.xml.bind.Marshaller
      Throws:
      jakarta.xml.bind.JAXBException
    • getListener

      public jakarta.xml.bind.Marshaller.Listener getListener()
      Specified by:
      getListener in interface jakarta.xml.bind.Marshaller
    • getNode

      public Node getNode(Object object) throws jakarta.xml.bind.JAXBException
      Specified by:
      getNode in interface jakarta.xml.bind.Marshaller
      Throws:
      jakarta.xml.bind.JAXBException
    • getProperty

      public Object getProperty(String key) throws jakarta.xml.bind.PropertyException
      Get a property from the JAXBMarshaller. Attempting to get any unsupported property will result in a jakarta.xml.bind.PropertyException
      Specified by:
      getProperty in interface jakarta.xml.bind.Marshaller
      Throws:
      jakarta.xml.bind.PropertyException
      See Also:
    • getSchema

      public Schema getSchema()
      Specified by:
      getSchema in interface jakarta.xml.bind.Marshaller
    • marshal

      public void marshal(Object object, ContentHandler contentHandler) throws jakarta.xml.bind.JAXBException
      Specified by:
      marshal in interface jakarta.xml.bind.Marshaller
      Throws:
      jakarta.xml.bind.JAXBException
    • marshal

      public void marshal(Object object, XMLEventWriter eventWriter) throws jakarta.xml.bind.JAXBException
      Specified by:
      marshal in interface jakarta.xml.bind.Marshaller
      Throws:
      jakarta.xml.bind.JAXBException
    • marshal

      public void marshal(Object object, XMLEventWriter eventWriter, TypeMappingInfo type) throws jakarta.xml.bind.JAXBException
      Throws:
      jakarta.xml.bind.JAXBException
    • marshal

      public void marshal(Object object, Node node) throws jakarta.xml.bind.JAXBException
      Specified by:
      marshal in interface jakarta.xml.bind.Marshaller
      Throws:
      jakarta.xml.bind.JAXBException
    • marshal

      public void marshal(Object object, OutputStream outputStream) throws jakarta.xml.bind.JAXBException
      Specified by:
      marshal in interface jakarta.xml.bind.Marshaller
      Throws:
      jakarta.xml.bind.JAXBException
    • marshal

      public void marshal(Object object, File file) throws jakarta.xml.bind.JAXBException
      Specified by:
      marshal in interface jakarta.xml.bind.Marshaller
      Throws:
      jakarta.xml.bind.JAXBException
    • marshal

      public void marshal(Object object, Result result) throws jakarta.xml.bind.JAXBException
      Specified by:
      marshal in interface jakarta.xml.bind.Marshaller
      Throws:
      jakarta.xml.bind.JAXBException
    • marshal

      public void marshal(Object object, Result result, TypeMappingInfo type) throws jakarta.xml.bind.JAXBException
      Throws:
      jakarta.xml.bind.JAXBException
    • marshal

      public void marshal(Object object, XMLStreamWriter streamWriter) throws jakarta.xml.bind.JAXBException
      Specified by:
      marshal in interface jakarta.xml.bind.Marshaller
      Throws:
      jakarta.xml.bind.JAXBException
    • marshal

      public void marshal(Object object, XMLStreamWriter streamWriter, TypeMappingInfo type) throws jakarta.xml.bind.JAXBException
      Throws:
      jakarta.xml.bind.JAXBException
    • marshal

      public void marshal(Object object, Writer writer) throws jakarta.xml.bind.JAXBException
      Specified by:
      marshal in interface jakarta.xml.bind.Marshaller
      Throws:
      jakarta.xml.bind.JAXBException
    • marshal

      public void marshal(Object object, MarshalRecord record) throws jakarta.xml.bind.JAXBException
      Throws:
      jakarta.xml.bind.JAXBException
    • marshal

      public void marshal(Object object, MarshalRecord record, TypeMappingInfo type) throws jakarta.xml.bind.JAXBException
      Throws:
      jakarta.xml.bind.JAXBException
    • setAdapter

      public void setAdapter(Class javaClass, jakarta.xml.bind.annotation.adapters.XmlAdapter adapter)
      Specified by:
      setAdapter in interface jakarta.xml.bind.Marshaller
    • setAdapter

      public void setAdapter(jakarta.xml.bind.annotation.adapters.XmlAdapter adapter)
      Specified by:
      setAdapter in interface jakarta.xml.bind.Marshaller
    • setAttachmentMarshaller

      public void setAttachmentMarshaller(jakarta.xml.bind.attachment.AttachmentMarshaller attachmentMarshaller)
      Specified by:
      setAttachmentMarshaller in interface jakarta.xml.bind.Marshaller
    • setEventHandler

      public void setEventHandler(jakarta.xml.bind.ValidationEventHandler newValidationEventHandler) throws jakarta.xml.bind.JAXBException
      Specified by:
      setEventHandler in interface jakarta.xml.bind.Marshaller
      Throws:
      jakarta.xml.bind.JAXBException
    • setListener

      public void setListener(jakarta.xml.bind.Marshaller.Listener listener)
      Specified by:
      setListener in interface jakarta.xml.bind.Marshaller
    • setMarshalCallbacks

      public void setMarshalCallbacks(Map callbacks)
    • setProperty

      public void setProperty(String key, Object value) throws jakarta.xml.bind.PropertyException
      Set a property on the JAXBMarshaller. Attempting to set any unsupported property will result in a jakarta.xml.bind.PropertyException
      Specified by:
      setProperty in interface jakarta.xml.bind.Marshaller
      Throws:
      jakarta.xml.bind.PropertyException
      See Also:
    • setSchema

      public void setSchema(Schema schema)
      Specified by:
      setSchema in interface jakarta.xml.bind.Marshaller
    • getJaxbContext

      public JAXBContext getJaxbContext()
    • getXMLMarshaller

      public XMLMarshaller getXMLMarshaller()
    • getConstraintViolations

      public Set<ConstraintViolationWrapper<Object>> getConstraintViolations()
      Returns constraint violations stored in the underlying JAXBBeanValidator instance.
      Returns:
      set of constraint violations from last unmarshal