|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.oxm.jaxb.AbstractJaxbMarshaller
public abstract class AbstractJaxbMarshaller
Abstract base class for implementations of the Marshaller and Unmarshaller interfaces that
use JAXB. This base class is responsible for creating JAXB marshallers from a JAXBContext.
Jaxb1Marshaller and Jaxb2Marshaller respectivaly).
Jaxb1Marshaller,
Jaxb2Marshaller| Field Summary | |
|---|---|
protected org.apache.commons.logging.Log |
logger
Logger available to subclasses. |
| Constructor Summary | |
|---|---|
AbstractJaxbMarshaller()
|
|
| Method Summary | |
|---|---|
void |
afterPropertiesSet()
|
protected XmlMappingException |
convertJaxbException(javax.xml.bind.JAXBException ex)
Convert the given JAXBException to an appropriate exception from the
org.springframework.oxm hierarchy. |
protected abstract javax.xml.bind.JAXBContext |
createJaxbContext()
Template method that returns a newly created JAXB context. |
protected javax.xml.bind.Marshaller |
createMarshaller()
Returns a newly created JAXB marshaller. |
protected javax.xml.bind.Unmarshaller |
createUnmarshaller()
Returns a newly created JAXB unmarshaller. |
protected java.lang.String |
getContextPath()
Returns the JAXB Context path. |
javax.xml.bind.JAXBContext |
getJaxbContext()
Returns the JAXBContext created in afterPropertiesSet(). |
protected void |
initJaxbMarshaller(javax.xml.bind.Marshaller marshaller)
Template method that can be overridden by concrete JAXB marshallers for custom initialization behavior. |
protected void |
initJaxbUnmarshaller(javax.xml.bind.Unmarshaller unmarshaller)
Template method that can overridden by concrete JAXB marshallers for custom initialization behavior. |
void |
setContextPath(java.lang.String contextPath)
Sets the JAXB Context path. |
void |
setContextPaths(java.lang.String[] contextPaths)
Sets multiple JAXB Context paths. |
void |
setMarshallerProperties(java.util.Map properties)
Sets the JAXB Marshaller properties. |
void |
setUnmarshallerProperties(java.util.Map properties)
Sets the JAXB Unmarshaller properties. |
void |
setValidationEventHandler(javax.xml.bind.ValidationEventHandler validationEventHandler)
Sets the JAXB validation event handler. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.springframework.oxm.Marshaller |
|---|
marshal, supports |
| Methods inherited from interface org.springframework.oxm.Unmarshaller |
|---|
supports, unmarshal |
| Field Detail |
|---|
protected final org.apache.commons.logging.Log logger
| Constructor Detail |
|---|
public AbstractJaxbMarshaller()
| Method Detail |
|---|
protected java.lang.String getContextPath()
public void setContextPath(java.lang.String contextPath)
public void setContextPaths(java.lang.String[] contextPaths)
public void setMarshallerProperties(java.util.Map properties)
Marshaller properties. These properties will be set on the underlying JAXB
Marshaller, and allow for features such as indentation.
properties - the propertiesMarshaller.setProperty(String,Object),
Marshaller.JAXB_ENCODING,
Marshaller.JAXB_FORMATTED_OUTPUT,
Marshaller.JAXB_NO_NAMESPACE_SCHEMA_LOCATION,
Marshaller.JAXB_SCHEMA_LOCATIONpublic void setUnmarshallerProperties(java.util.Map properties)
Unmarshaller properties. These properties will be set on the underlying JAXB
Unmarshaller.
properties - the propertiesUnmarshaller.setProperty(String,Object)public void setValidationEventHandler(javax.xml.bind.ValidationEventHandler validationEventHandler)
validationEventHandler - the event handlerpublic javax.xml.bind.JAXBContext getJaxbContext()
JAXBContext created in afterPropertiesSet().
public final void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exceptionprotected XmlMappingException convertJaxbException(javax.xml.bind.JAXBException ex)
JAXBException to an appropriate exception from the
org.springframework.oxm hierarchy.
The default implementation delegates to JaxbUtils. Can be overridden in subclasses.
ex - JAXBException that occured
XmlMappingException instanceJaxbUtils.convertJaxbException(javax.xml.bind.JAXBException)protected javax.xml.bind.Marshaller createMarshaller()
protected javax.xml.bind.Unmarshaller createUnmarshaller()
protected void initJaxbMarshaller(javax.xml.bind.Marshaller marshaller)
throws javax.xml.bind.JAXBException
Marshaller, and after the respective properties have been set.
Default implementation does nothing.
javax.xml.bind.JAXBException
protected void initJaxbUnmarshaller(javax.xml.bind.Unmarshaller unmarshaller)
throws javax.xml.bind.JAXBException
Unmarshaller, and after the respective properties have been set.
Default implementation does nothing.
javax.xml.bind.JAXBException
protected abstract javax.xml.bind.JAXBContext createJaxbContext()
throws java.lang.Exception
afterPropertiesSet().
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||