|
Spring Web Services Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.xml.transform.TransformerObjectSupport org.springframework.ws.server.endpoint.adapter.method.AbstractPayloadMethodProcessor org.springframework.ws.server.endpoint.adapter.method.MarshallingPayloadMethodProcessor
public class MarshallingPayloadMethodProcessor
Implementation of MethodArgumentResolver
and MethodReturnValueHandler
that uses Marshaller
and Unmarshaller
to support marshalled objects.
Field Summary |
---|
Fields inherited from class org.springframework.xml.transform.TransformerObjectSupport |
---|
logger |
Constructor Summary | |
---|---|
MarshallingPayloadMethodProcessor()
Creates a new MarshallingPayloadMethodProcessor . |
|
MarshallingPayloadMethodProcessor(org.springframework.oxm.Marshaller marshaller)
Creates a new MarshallingPayloadMethodProcessor with the given marshaller. |
|
MarshallingPayloadMethodProcessor(org.springframework.oxm.Marshaller marshaller,
org.springframework.oxm.Unmarshaller unmarshaller)
Creates a new MarshallingPayloadMethodProcessor with the given marshaller and unmarshaller. |
Method Summary | |
---|---|
org.springframework.oxm.Marshaller |
getMarshaller()
Returns the marshaller used for transforming objects into XML. |
org.springframework.oxm.Unmarshaller |
getUnmarshaller()
Returns the unmarshaller used for transforming XML into objects. |
void |
handleReturnValue(MessageContext messageContext,
MethodParameter returnType,
Object returnValue)
Handles the given return value. |
Object |
resolveArgument(MessageContext messageContext,
MethodParameter parameter)
Resolves the given parameter into a method argument. |
void |
setMarshaller(org.springframework.oxm.Marshaller marshaller)
Sets the marshaller used for transforming objects into XML. |
void |
setUnmarshaller(org.springframework.oxm.Unmarshaller unmarshaller)
Sets the unmarshaller used for transforming XML into objects. |
protected boolean |
supportsRequestPayloadParameter(MethodParameter parameter)
Indicates whether the given method parameter, annotated with RequestPayload ,
is supported by this resolver. |
protected boolean |
supportsResponsePayloadReturnType(MethodParameter returnType)
Indicates whether the given method return type, annotated with ResponsePayload , is supported. |
Methods inherited from class org.springframework.ws.server.endpoint.adapter.method.AbstractPayloadMethodProcessor |
---|
convertToByteArrayInputStream, supportsParameter, supportsReturnType |
Methods inherited from class org.springframework.xml.transform.TransformerObjectSupport |
---|
createTransformer, getTransformerFactory, newTransformerFactory, setTransformerFactoryClass, transform |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MarshallingPayloadMethodProcessor()
MarshallingPayloadMethodProcessor
. The Marshaller
and Unmarshaller
must be
injected using properties.
setMarshaller(Marshaller)
,
setUnmarshaller(Unmarshaller)
public MarshallingPayloadMethodProcessor(org.springframework.oxm.Marshaller marshaller)
MarshallingPayloadMethodProcessor
with the given marshaller. If the given Marshaller
also implements the Unmarshaller
interface, it is used for both marshalling and
unmarshalling. Otherwise, an exception is thrown.
Note that all Marshaller
implementations in Spring also implement the Unmarshaller
interface, so
that you can safely use this constructor.
marshaller
- object used as marshaller and unmarshaller
IllegalArgumentException
- when marshaller
does not implement the Unmarshaller
interfacepublic MarshallingPayloadMethodProcessor(org.springframework.oxm.Marshaller marshaller, org.springframework.oxm.Unmarshaller unmarshaller)
MarshallingPayloadMethodProcessor
with the given marshaller and unmarshaller.
marshaller
- the marshaller to useunmarshaller
- the unmarshaller to useMethod Detail |
---|
public org.springframework.oxm.Marshaller getMarshaller()
public void setMarshaller(org.springframework.oxm.Marshaller marshaller)
public org.springframework.oxm.Unmarshaller getUnmarshaller()
public void setUnmarshaller(org.springframework.oxm.Unmarshaller unmarshaller)
protected boolean supportsRequestPayloadParameter(MethodParameter parameter)
AbstractPayloadMethodProcessor
RequestPayload
,
is supported by this resolver.
supportsRequestPayloadParameter
in class AbstractPayloadMethodProcessor
parameter
- the method parameter to check
true
if this resolver supports the supplied parameter; false
otherwisepublic Object resolveArgument(MessageContext messageContext, MethodParameter parameter) throws Exception
MethodArgumentResolver
messageContext
- the current message contextparameter
- the parameter to resolve to an argument. This parameter must have previously been passed to
the MethodArgumentResolver.supportsParameter(MethodParameter)
method of this interface, which must
have returned true
.
null
.
Exception
- in case of errorsprotected boolean supportsResponsePayloadReturnType(MethodParameter returnType)
AbstractPayloadMethodProcessor
ResponsePayload
, is supported.
supportsResponsePayloadReturnType
in class AbstractPayloadMethodProcessor
returnType
- the method parameter to check
true
if this resolver supports the supplied return type; false
otherwisepublic void handleReturnValue(MessageContext messageContext, MethodParameter returnType, Object returnValue) throws Exception
MethodReturnValueHandler
messageContext
- the current message contextreturnType
- the return type to handle. This type must have previously been passed to the MethodReturnValueHandler.supportsReturnType(MethodParameter)
method of this interface, which must have returned
true
.returnValue
- the return value to handle
Exception
- in case of errors
|
Spring Web Services Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |