Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2005-2010 the original author or authors.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 package org.springframework.ws.server.endpoint.adapter.method;
 
 
 
 public abstract class AbstractPayloadMethodProcessor extends TransformerObjectSupport
         implements MethodArgumentResolverMethodReturnValueHandler {
 
     // MethodArgumentResolver
 
    

This implementation gets checks if the given parameter is annotated with org.springframework.ws.server.endpoint.annotation.RequestPayload, and invokes supportsRequestPayloadParameter(org.springframework.core.MethodParameter) afterwards.

 
     public final boolean supportsParameter(MethodParameter parameter) {
         Assert.isTrue(parameter.getParameterIndex() >= 0, "Parameter index larger smaller than 0");
         if (parameter.getParameterAnnotation(RequestPayload.class) == null) {
             return false;
         }
         else {
             return supportsRequestPayloadParameter(parameter);
         }
     }

    
Indicates whether the given method parameter, annotated with org.springframework.ws.server.endpoint.annotation.RequestPayload, is supported by this resolver.

Parameters:
parameter the method parameter to check
Returns:
true if this resolver supports the supplied parameter; false otherwise
 
     protected abstract boolean supportsRequestPayloadParameter(MethodParameter parameter);
 
     // MethodReturnValueHandler
     
    

This implementation gets checks if the method of the given return type is annotated with org.springframework.ws.server.endpoint.annotation.ResponsePayload, and invokes supportsResponsePayloadReturnType(org.springframework.core.MethodParameter) afterwards.

 
     public final boolean supportsReturnType(MethodParameter returnType) {
         Assert.isTrue(returnType.getParameterIndex() == -1, "Parameter index is not -1");
         if (returnType.getMethodAnnotation(ResponsePayload.class) == null) {
             return false;
         }
         else {
             return supportsResponsePayloadReturnType(returnType);
         }
     }

    
Indicates whether the given method return type, annotated with org.springframework.ws.server.endpoint.annotation.ResponsePayload, is supported.

Parameters:
returnType the method parameter to check
Returns:
true if this resolver supports the supplied return type; false otherwise
 
     protected abstract boolean supportsResponsePayloadReturnType(MethodParameter returnType);

    
Converts the given source to a byte array input stream.

Parameters:
source the source to convert
Returns:
the input stream
Throws:
javax.xml.transform.TransformerException in case of transformation errors
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        transform(sourcenew StreamResult(bos));
        return new ByteArrayInputStream(bos.toByteArray());
    }
New to GrepCode? Check out our FAQ X