java.lang.Object | |
↳ | org.springframework.oxm.jaxb.Jaxb2Marshaller |
Implementation of the Marshaller
interface for JAXB 2.0.
The typical usage will be to set either the contextPath
or the classesToBeBound
property
on this bean, possibly customize the marshaller and unmarshaller by setting properties, schemas, adapters, and
listeners, and to refer to it.
setContextPath(String)
setClassesToBeBound(Class[])
setJaxbContextProperties(Map)
setMarshallerProperties(Map)
setUnmarshallerProperties(Map)
setSchema(Resource)
setSchemas(Resource[])
setMarshallerListener(javax.xml.bind.Marshaller.Listener)
setUnmarshallerListener(javax.xml.bind.Unmarshaller.Listener)
setAdapters(XmlAdapter[])
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
logger | Logger available to subclasses. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Invoked by a BeanFactory after it has set all bean properties supplied
(and satisfied BeanFactoryAware and ApplicationContextAware).
| |||||||||||
Return the list of Java classes to be recognized by a newly created JAXBContext.
| |||||||||||
Return the JAXB context path.
| |||||||||||
Marshals the object graph with the given root into the provided
Result . | |||||||||||
Marshals the object graph with the given root into the provided
Result ,
writing binary data to a MimeContainer . | |||||||||||
Specify the
XmlAdapter s to be registered with the JAXB Marshaller
and Unmarshaller
| |||||||||||
Callback that supplies the bean
class loader to
a bean instance. | |||||||||||
Set the list of Java classes to be recognized by a newly created JAXBContext.
| |||||||||||
Set a JAXB context path.
| |||||||||||
Set multiple JAXB context paths.
| |||||||||||
Set the
JAXBContext properties. | |||||||||||
Set whether to lazily initialize the JAXBContext for this marshaller.
| |||||||||||
Specify the
Marshaller.Listener to be registered with the JAXB Marshaller . | |||||||||||
Set the JAXB
Marshaller properties. | |||||||||||
Specify whether MTOM support should be enabled or not.
| |||||||||||
Set the schema resource to use for validation.
| |||||||||||
Set the schema language.
| |||||||||||
Set the schema resources to use for validation.
| |||||||||||
Set the
Unmarshaller.Listener to be registered with the JAXB Unmarshaller . | |||||||||||
Set the JAXB
Unmarshaller properties. | |||||||||||
Set the JAXB validation event handler.
| |||||||||||
Indicates whether this marshaller can marshal instances of the supplied type.
| |||||||||||
Indicates whether this marshaller can marshal instances of the supplied generic type.
| |||||||||||
Unmarshals the given
Source into an object graph. | |||||||||||
Unmarshals the given provided
Source into an object graph,
reading binary attachments from a MimeContainer . |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Convert the given
JAXBException to an appropriate exception from the
org.springframework.oxm hierarchy. | |||||||||||
Return a newly created JAXB marshaller.
| |||||||||||
Return a newly created JAXB unmarshaller.
| |||||||||||
Template method that can be overridden by concrete JAXB marshallers for custom initialization behavior.
| |||||||||||
Template method that can be overridden by concrete JAXB marshallers for custom initialization behavior.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Logger available to subclasses.
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.
Exception |
---|
Return the list of Java classes to be recognized by a newly created JAXBContext.
Marshals the object graph with the given root into the provided Result
.
graph | the root of the object graph to marshal |
---|---|
result | the result to marshal to |
XmlMappingException |
---|
Marshals the object graph with the given root into the provided Result
,
writing binary data to a MimeContainer
.
graph | the root of the object graph to marshal |
---|---|
result | the result to marshal to |
mimeContainer | the MIME container to write extracted binary content to |
XmlMappingException |
---|
Specify the XmlAdapter
s to be registered with the JAXB Marshaller
and Unmarshaller
Callback that supplies the bean class loader
to
a bean instance.
Invoked after the population of normal bean properties but
before an initialization callback such as
InitializingBean's
afterPropertiesSet()
method or a custom init-method.
classLoader | the owning class loader; may be null in
which case a default ClassLoader must be used, for example
the ClassLoader obtained via
getDefaultClassLoader()
|
---|
Set the list of Java classes to be recognized by a newly created JAXBContext.
Setting this property or "contextPath"
is required.
Set multiple JAXB context paths. The given array of context paths is converted to a colon-delimited string, as supported by JAXB.
Set the JAXBContext
properties. These implementation-specific
properties will be set on the underlying JAXBContext
.
Set whether to lazily initialize the JAXBContext for this marshaller.
Default is false
to initialize on startup; can be switched to true
.
Early initialization just applies if afterPropertiesSet()
is called.
Specify the Marshaller.Listener
to be registered with the JAXB Marshaller
.
Set the JAXB Marshaller
properties. These properties will be set on the
underlying JAXB Marshaller
, and allow for features such as indentation.
properties | the properties |
---|
Specify whether MTOM support should be enabled or not.
Default is false
: marshalling using XOP/MTOM not being enabled.
Set the schema language. Default is the W3C XML Schema: http://www.w3.org/2001/XMLSchema"
.
Set the Unmarshaller.Listener
to be registered with the JAXB Unmarshaller
.
Set the JAXB Unmarshaller
properties. These properties will be set on the
underlying JAXB Unmarshaller
.
properties | the properties |
---|
Set the JAXB validation event handler. This event handler will be called by JAXB if any validation errors are encountered during calls to any of the marshal APIs.
Indicates whether this marshaller can marshal instances of the supplied type.
clazz | the class that this marshaller is being asked if it can marshal |
---|
true
if this marshaller can indeed marshal instances of the supplied class;
false
otherwise
Indicates whether this marshaller can marshal instances of the supplied generic type.
genericType | the type that this marshaller is being asked if it can marshal |
---|
true
if this marshaller can indeed marshal instances of the supplied type;
false
otherwise
Unmarshals the given Source
into an object graph.
source | the source to marshal from |
---|
XmlMappingException |
---|
Unmarshals the given provided Source
into an object graph,
reading binary attachments from a MimeContainer
.
source | the source to marshal from |
---|---|
mimeContainer | the MIME container to read extracted binary content from |
XmlMappingException |
---|
Convert the given JAXBException
to an appropriate exception from the
org.springframework.oxm
hierarchy.
ex | JAXBException that occured |
---|
XmlMappingException
Return a newly created JAXB marshaller. JAXB marshallers are not necessarily thread safe.
Return a newly created JAXB unmarshaller. JAXB unmarshallers are not necessarily thread safe.
Template method that can be overridden by concrete JAXB marshallers for custom initialization behavior.
Gets called after creation of JAXB Marshaller
, and after the respective properties have been set.
The default implementation sets the defined properties
, the validation event handler
, the schemas
, listener
, and
adapters
.
JAXBException |
---|
Template method that can be overridden by concrete JAXB marshallers for custom initialization behavior.
Gets called after creation of JAXB Marshaller
, and after the respective properties have been set.
The default implementation sets the defined properties
, the validation event handler
, the schemas
, listener
, and
adapters
.
JAXBException |
---|