Package org.apache.axiom.om.ds.jaxb
Class JAXBOMDataSource
java.lang.Object
org.apache.axiom.om.ds.AbstractOMDataSource
org.apache.axiom.om.ds.AbstractPushOMDataSource
org.apache.axiom.om.ds.jaxb.JAXBOMDataSource
- All Implemented Interfaces:
org.apache.axiom.om.OMDataSource,org.apache.axiom.om.OMDataSourceExt,org.apache.axiom.om.QNameAwareOMDataSource
public class JAXBOMDataSource
extends org.apache.axiom.om.ds.AbstractPushOMDataSource
implements org.apache.axiom.om.QNameAwareOMDataSource
OMDataSource backed by a JAXB object. This class can be used both for plain JAXB objects
and for JAXBElement instances. It implements QNameAwareOMDataSource so that it
can be used with OMFactory.createOMElement(OMDataSource), i.e. it is not necessary to
supply the QName during construction of the OMSourcedElement. It also has full support
for XOP/MTOM. It is implemented as a push-style OMDataSource so that an OMSourcedElement backed by an instance of this class can be expanded in an efficient way
(including the case where the JAXB object contains base64 binary data represented as DataHandler instances or byte arrays).
The JAXB object encapsulated by an instance of this class can be retrieved using OMDataSourceExt.getObject(). Note that modifying the JAXB object after passing it to the
constructor may result in unexpected behavior and should be avoided.
Instances of this class are non destructive, in the sense defined by OMDataSourceExt.isDestructiveWrite().
-
Constructor Summary
ConstructorsConstructorDescriptionJAXBOMDataSource(jakarta.xml.bind.JAXBContext context, Object object) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.axiom.om.OMDataSourceExtcopy()booleanvoidserialize(XMLStreamWriter writer) Methods inherited from class org.apache.axiom.om.ds.AbstractPushOMDataSource
getReader, isDestructiveReadMethods inherited from class org.apache.axiom.om.ds.AbstractOMDataSource
close, getProperty, getXMLBytes, getXMLInputStream, hasProperty, serialize, serialize, setPropertyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.axiom.om.OMDataSource
getReader, serialize, serialize
-
Constructor Details
-
JAXBOMDataSource
Constructor.- Parameters:
context- the JAXB context to which the object is knownobject- the JAXB object; this may be a plain Java bean or aJAXBElement
-
-
Method Details
-
isDestructiveWrite
public boolean isDestructiveWrite()- Specified by:
isDestructiveWritein interfaceorg.apache.axiom.om.OMDataSourceExt
-
serialize
- Specified by:
serializein interfaceorg.apache.axiom.om.OMDataSource- Throws:
XMLStreamException
-
getLocalName
- Specified by:
getLocalNamein interfaceorg.apache.axiom.om.QNameAwareOMDataSource
-
getNamespaceURI
- Specified by:
getNamespaceURIin interfaceorg.apache.axiom.om.QNameAwareOMDataSource
-
getPrefix
- Specified by:
getPrefixin interfaceorg.apache.axiom.om.QNameAwareOMDataSource
-
getObject
- Specified by:
getObjectin interfaceorg.apache.axiom.om.OMDataSourceExt- Overrides:
getObjectin classorg.apache.axiom.om.ds.AbstractOMDataSource
-
copy
public org.apache.axiom.om.OMDataSourceExt copy()- Specified by:
copyin interfaceorg.apache.axiom.om.OMDataSourceExt- Overrides:
copyin classorg.apache.axiom.om.ds.AbstractOMDataSource
-