Spring Web Services Framework

org.springframework.ws.server.endpoint.adapter
Class XPathParamAnnotationMethodEndpointAdapter

java.lang.Object
  extended by org.springframework.xml.transform.TransformerObjectSupport
      extended by org.springframework.ws.server.endpoint.adapter.AbstractMethodEndpointAdapter
          extended by org.springframework.ws.server.endpoint.adapter.XPathParamAnnotationMethodEndpointAdapter
All Implemented Interfaces:
InitializingBean, EndpointAdapter

public class XPathParamAnnotationMethodEndpointAdapter
extends AbstractMethodEndpointAdapter
implements InitializingBean

Adapter that supports endpoint methods that use marshalling. Supports methods with the following signature:

 void handleMyMessage(@XPathParam("/root/child/text")String param);
 
or
 Source handleMyMessage(@XPathParam("/root/child/text")String param1, @XPathParam("/root/child/number")double
 param2);
 
I.e. methods that return either void or a Source, and have parameters annotated with XPathParam that specify the XPath expression that should be bound to that parameter. The parameter can be of the following types:

Since:
1.0.0
Author:
Arjen Poutsma

Field Summary
 
Fields inherited from class org.springframework.ws.server.endpoint.adapter.AbstractMethodEndpointAdapter
logger
 
Constructor Summary
XPathParamAnnotationMethodEndpointAdapter()
           
 
Method Summary
 void afterPropertiesSet()
           
protected  void invokeInternal(MessageContext messageContext, MethodEndpoint methodEndpoint)
          Use the given method endpoint to handle the request.
 void setNamespaces(Properties namespaces)
          Sets namespaces used in the XPath expression.
protected  boolean supportsInternal(MethodEndpoint methodEndpoint)
          Supports methods with @XPathParam parameters, and return either Source or nothing.
 
Methods inherited from class org.springframework.ws.server.endpoint.adapter.AbstractMethodEndpointAdapter
invoke, supports
 
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

XPathParamAnnotationMethodEndpointAdapter

public XPathParamAnnotationMethodEndpointAdapter()
Method Detail

setNamespaces

public void setNamespaces(Properties namespaces)
Sets namespaces used in the XPath expression. Maps prefixes to namespaces.


afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

supportsInternal

protected boolean supportsInternal(MethodEndpoint methodEndpoint)
Supports methods with @XPathParam parameters, and return either Source or nothing.

Specified by:
supportsInternal in class AbstractMethodEndpointAdapter
Parameters:
methodEndpoint - method endpoint to check
Returns:
whether or not this adapter can adapt the given method

invokeInternal

protected void invokeInternal(MessageContext messageContext,
                              MethodEndpoint methodEndpoint)
                       throws Exception
Description copied from class: AbstractMethodEndpointAdapter
Use the given method endpoint to handle the request.

Specified by:
invokeInternal in class AbstractMethodEndpointAdapter
Parameters:
messageContext - the current message context
methodEndpoint - the method endpoint to use
Throws:
Exception - in case of errors

Spring Web Services Framework

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