Spring Web Services Framework

org.springframework.ws.server.endpoint.adapter.method.dom
Class XomPayloadMethodProcessor

java.lang.Object
  extended by org.springframework.xml.transform.TransformerObjectSupport
      extended by org.springframework.ws.server.endpoint.adapter.method.AbstractPayloadMethodProcessor
          extended by org.springframework.ws.server.endpoint.adapter.method.AbstractPayloadSourceMethodProcessor
              extended by org.springframework.ws.server.endpoint.adapter.method.dom.XomPayloadMethodProcessor
All Implemented Interfaces:
MethodArgumentResolver, MethodReturnValueHandler

public class XomPayloadMethodProcessor
extends AbstractPayloadSourceMethodProcessor

Implementation of MethodArgumentResolver and MethodReturnValueHandler that supports XOM elements.

Since:
2.0
Author:
Arjen Poutsma

Field Summary
 
Fields inherited from class org.springframework.xml.transform.TransformerObjectSupport
logger
 
Constructor Summary
XomPayloadMethodProcessor()
           
 
Method Summary
protected  DocumentBuilderFactory createDocumentBuilderFactory()
          Create a DocumentBuilderFactory that this resolver will use to create response payloads.
protected  Source createResponsePayload(MethodParameter returnType, Object returnValue)
          Creates a response payload for the given return value.
protected  Element resolveRequestPayloadArgument(MethodParameter parameter, Source requestPayload)
          Resolves the given parameter, annotated with RequestPayload, into a method argument.
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.AbstractPayloadSourceMethodProcessor
handleReturnValue, resolveArgument
 
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

XomPayloadMethodProcessor

public XomPayloadMethodProcessor()
Method Detail

supportsRequestPayloadParameter

protected boolean supportsRequestPayloadParameter(MethodParameter parameter)
Description copied from class: AbstractPayloadMethodProcessor
Indicates whether the given method parameter, annotated with RequestPayload, is supported by this resolver.

Specified by:
supportsRequestPayloadParameter in class AbstractPayloadMethodProcessor
Parameters:
parameter - the method parameter to check
Returns:
true if this resolver supports the supplied parameter; false otherwise

resolveRequestPayloadArgument

protected Element resolveRequestPayloadArgument(MethodParameter parameter,
                                                Source requestPayload)
                                         throws TransformerException,
                                                IOException,
                                                ParsingException
Description copied from class: AbstractPayloadSourceMethodProcessor
Resolves the given parameter, annotated with RequestPayload, into a method argument.

Specified by:
resolveRequestPayloadArgument in class AbstractPayloadSourceMethodProcessor
Parameters:
parameter - the parameter to resolve to an argument
requestPayload - the request payload
Returns:
the resolved argument. May be null.
Throws:
TransformerException
IOException
ParsingException

supportsResponsePayloadReturnType

protected boolean supportsResponsePayloadReturnType(MethodParameter returnType)
Description copied from class: AbstractPayloadMethodProcessor
Indicates whether the given method return type, annotated with ResponsePayload, is supported.

Specified by:
supportsResponsePayloadReturnType in class AbstractPayloadMethodProcessor
Parameters:
returnType - the method parameter to check
Returns:
true if this resolver supports the supplied return type; false otherwise

createResponsePayload

protected Source createResponsePayload(MethodParameter returnType,
                                       Object returnValue)
                                throws ParserConfigurationException
Description copied from class: AbstractPayloadSourceMethodProcessor
Creates a response payload for the given return value.

Specified by:
createResponsePayload in class AbstractPayloadSourceMethodProcessor
Parameters:
returnType - the return type to handle
returnValue - the return value to handle
Returns:
the response payload
Throws:
ParserConfigurationException

createDocumentBuilderFactory

protected DocumentBuilderFactory createDocumentBuilderFactory()
Create a DocumentBuilderFactory that this resolver will use to create response payloads.

Can be overridden in subclasses, adding further initialization of the factory. The resulting factory is cached, so this method will only be called once.

Returns:
the created factory

Spring Web Services Framework

Copyright © 2005-2013 The Spring Web Services Framework. All Rights Reserved.