Spring Web Services Framework

org.springframework.ws.server.endpoint
Class AbstractValidatingMarshallingPayloadEndpoint

java.lang.Object
  extended by org.springframework.ws.server.endpoint.AbstractMarshallingPayloadEndpoint
      extended by org.springframework.ws.server.endpoint.AbstractValidatingMarshallingPayloadEndpoint
All Implemented Interfaces:
InitializingBean, MessageEndpoint
Direct Known Subclasses:
AbstractFaultCreatingValidatingMarshallingPayloadEndpoint

public abstract class AbstractValidatingMarshallingPayloadEndpoint
extends AbstractMarshallingPayloadEndpoint

Extension of the AbstractMarshallingPayloadEndpoint which validates the request payload with Validator(s). The desired validators can be set using properties, and must support the request object.

Since:
1.0.2
Author:
Arjen Poutsma

Field Summary
static String DEFAULT_REQUEST_NAME
          Default request object name used for validating request objects.
 
Fields inherited from class org.springframework.ws.server.endpoint.AbstractMarshallingPayloadEndpoint
logger
 
Constructor Summary
AbstractValidatingMarshallingPayloadEndpoint()
           
 
Method Summary
 String getRequestName()
          Return the name of the request object for validation error codes.
 Validator getValidator()
          Return the primary Validator for this controller.
 Validator[] getValidators()
          Return the Validators for this controller.
protected  boolean onUnmarshalRequest(MessageContext messageContext, Object requestObject)
          Callback for post-processing in terms of unmarshalling.
protected abstract  boolean onValidationErrors(MessageContext messageContext, Object requestObject, Errors errors)
          Callback for post-processing validation errors.
 void setRequestName(String requestName)
          Set the name of the request object user for validation errors.
 void setValidator(Validator validator)
          Set the primary Validator for this endpoint.
 void setValidators(Validator[] validators)
          Set the Validators for this controller.
 
Methods inherited from class org.springframework.ws.server.endpoint.AbstractMarshallingPayloadEndpoint
afterMarshallerSet, afterPropertiesSet, getMarshaller, getUnmarshaller, invoke, invokeInternal, onMarshalResponse, setMarshaller, setUnmarshaller
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_REQUEST_NAME

public static final String DEFAULT_REQUEST_NAME
Default request object name used for validating request objects.

See Also:
Constant Field Values
Constructor Detail

AbstractValidatingMarshallingPayloadEndpoint

public AbstractValidatingMarshallingPayloadEndpoint()
Method Detail

getRequestName

public String getRequestName()
Return the name of the request object for validation error codes.


setRequestName

public void setRequestName(String requestName)
Set the name of the request object user for validation errors.


getValidator

public Validator getValidator()
Return the primary Validator for this controller.


setValidator

public void setValidator(Validator validator)
Set the primary Validator for this endpoint. The Validator is must support the unmarshalled class. If there are one or more existing validators set already when this method is called, only the specified validator will be kept. Use setValidators(Validator[]) to set multiple validators.


getValidators

public Validator[] getValidators()
Return the Validators for this controller.


setValidators

public void setValidators(Validator[] validators)
Set the Validators for this controller. The Validator must support the specified command class.


onUnmarshalRequest

protected boolean onUnmarshalRequest(MessageContext messageContext,
                                     Object requestObject)
                              throws Exception
Description copied from class: AbstractMarshallingPayloadEndpoint
Callback for post-processing in terms of unmarshalling. Called on each message request, after standard unmarshalling.

Default implementation returns true.

Overrides:
onUnmarshalRequest in class AbstractMarshallingPayloadEndpoint
Parameters:
messageContext - the message context
requestObject - the object unmarshalled from the request
Returns:
true to continue and call AbstractMarshallingPayloadEndpoint.invokeInternal(Object); false otherwise
Throws:
Exception

onValidationErrors

protected abstract boolean onValidationErrors(MessageContext messageContext,
                                              Object requestObject,
                                              Errors errors)
Callback for post-processing validation errors. Called when validator(s) have been specified, and validation fails.

Parameters:
messageContext - the message context
requestObject - the object unmarshalled from the request
errors - validation errors holder
Returns:
true to continue and call AbstractMarshallingPayloadEndpoint.invokeInternal(Object); false otherwise

Spring Web Services Framework

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