org.springframework.ws.server.endpoint.adapter
Class GenericMarshallingMethodEndpointAdapter
java.lang.Object
org.springframework.xml.transform.TransformerObjectSupport
org.springframework.ws.server.endpoint.adapter.AbstractMethodEndpointAdapter
org.springframework.ws.server.endpoint.adapter.MarshallingMethodEndpointAdapter
org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter
- All Implemented Interfaces:
- InitializingBean, EndpointAdapter
public class GenericMarshallingMethodEndpointAdapter
- extends MarshallingMethodEndpointAdapter
Subclass of MarshallingMethodEndpointAdapter
that supports GenericMarshaller
and GenericUnmarshaller
. More specifically, this adapter is aware of the Method.getGenericParameterTypes()
and
Method.getGenericReturnType()
.
Prefer to use this adapter rather than the plain MarshallingMethodEndpointAdapter
in combination with Java 5
marshallers, such as the Jaxb2Marshaller
.
- Since:
- 1.0.2
- Author:
- Arjen Poutsma
Method Summary |
protected boolean |
supportsInternal(MethodEndpoint methodEndpoint)
Supports a method with a single, unmarshallable parameter, and that return void or a marshallable
type. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GenericMarshallingMethodEndpointAdapter
public GenericMarshallingMethodEndpointAdapter()
- Creates a new
GenericMarshallingMethodEndpointAdapter
. The Marshaller
and Unmarshaller
must be injected using properties.
- See Also:
MarshallingMethodEndpointAdapter.setMarshaller(org.springframework.oxm.Marshaller)
,
MarshallingMethodEndpointAdapter.setUnmarshaller(org.springframework.oxm.Unmarshaller)
GenericMarshallingMethodEndpointAdapter
public GenericMarshallingMethodEndpointAdapter(Marshaller marshaller)
- Creates a new
GenericMarshallingMethodEndpointAdapter
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-WS also implement the Unmarshaller
interface,
so that you can safely use this constructor.
- Parameters:
marshaller
- object used as marshaller and unmarshaller
- Throws:
IllegalArgumentException
- when marshaller
does not implement the Unmarshaller
interface
GenericMarshallingMethodEndpointAdapter
public GenericMarshallingMethodEndpointAdapter(Marshaller marshaller,
Unmarshaller unmarshaller)
- Creates a new
GenericMarshallingMethodEndpointAdapter
with the given marshaller and unmarshaller.
- Parameters:
marshaller
- the marshaller to useunmarshaller
- the unmarshaller to use
supportsInternal
protected boolean supportsInternal(MethodEndpoint methodEndpoint)
- Description copied from class:
MarshallingMethodEndpointAdapter
- Supports a method with a single, unmarshallable parameter, and that return
void
or a marshallable
type.
- Overrides:
supportsInternal
in class MarshallingMethodEndpointAdapter
- Parameters:
methodEndpoint
- method endpoint to check
- Returns:
- whether or not this adapter can adapt the given method
- See Also:
Marshaller.supports(Class)
,
Unmarshaller.supports(Class)
Copyright © 2005-2010 The Spring Web Services Framework. All Rights Reserved.