|
Spring Web Services Framework | |||||||||
| 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 Log |
logger
Logger available to subclasses. |
| Constructor Summary | |
|---|---|
AbstractJaxbMarshaller()
|
|
| Method Summary | |
|---|---|
void |
afterPropertiesSet()
|
protected XmlMappingException |
convertJaxbException(JAXBException ex)
Convert the given JAXBException to an appropriate exception from the
org.springframework.oxm hierarchy. |
protected abstract JAXBContext |
createJaxbContext()
Template method that returns a newly created JAXB context. |
protected Marshaller |
createMarshaller()
Returns a newly created JAXB marshaller. |
protected Unmarshaller |
createUnmarshaller()
Returns a newly created JAXB unmarshaller. |
protected String |
getContextPath()
Returns the JAXB Context path. |
JAXBContext |
getJaxbContext()
Returns the JAXBContext created in afterPropertiesSet(). |
protected void |
initJaxbMarshaller(Marshaller marshaller)
Template method that can be overridden by concrete JAXB marshallers for custom initialization behavior. |
protected void |
initJaxbUnmarshaller(Unmarshaller unmarshaller)
Template method that can overridden by concrete JAXB marshallers for custom initialization behavior. |
void |
setContextPath(String contextPath)
Sets the JAXB Context path. |
void |
setContextPaths(String[] contextPaths)
Sets multiple JAXB Context paths. |
void |
setMarshallerProperties(Map properties)
Sets the JAXB Marshaller properties. |
void |
setUnmarshallerProperties(Map properties)
Sets the JAXB Unmarshaller properties. |
void |
setValidationEventHandler(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 Log logger
| Constructor Detail |
|---|
public AbstractJaxbMarshaller()
| Method Detail |
|---|
protected String getContextPath()
public void setContextPath(String contextPath)
public void setContextPaths(String[] contextPaths)
public void setMarshallerProperties(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(Map properties)
Unmarshaller properties. These properties will be set on the underlying JAXB
Unmarshaller.
properties - the propertiesUnmarshaller.setProperty(String,Object)public void setValidationEventHandler(ValidationEventHandler validationEventHandler)
validationEventHandler - the event handlerpublic JAXBContext getJaxbContext()
JAXBContext created in afterPropertiesSet().
public final void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface InitializingBeanExceptionprotected XmlMappingException convertJaxbException(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 Marshaller createMarshaller()
protected Unmarshaller createUnmarshaller()
protected void initJaxbMarshaller(Marshaller marshaller)
throws JAXBException
Marshaller, and after the respective properties have been set.
Default implementation does nothing.
JAXBException
protected void initJaxbUnmarshaller(Unmarshaller unmarshaller)
throws JAXBException
Unmarshaller, and after the respective properties have been set.
Default implementation does nothing.
JAXBException
protected abstract JAXBContext createJaxbContext()
throws Exception
afterPropertiesSet().
Exception
|
Spring Web Services Framework | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||