Package org.springframework.core

Examples of org.springframework.core.MethodParameter


    @Before
    public void setUp() throws Exception {
        marshaller = createMock("marshaller", GenericMarshaller.class);
        unmarshaller = createMock("unmarshaller", GenericUnmarshaller.class);
        processor = new MarshallingPayloadMethodProcessor(marshaller, unmarshaller);
        supportedParameter = new MethodParameter(getClass().getMethod("method", MyObject.class), 0);
        supportedReturnType = new MethodParameter(getClass().getMethod("method", MyObject.class), -1);
    }
View Full Code Here


    private MethodParameter supported;

    @Before
    public void setUp() throws NoSuchMethodException {
        resolver = new MessageContextMethodArgumentResolver();
        supported = new MethodParameter(getClass().getMethod("supported", MessageContext.class), 0);
    }
View Full Code Here

        return new SourcePayloadMethodProcessor();
    }

    @Override
    protected MethodParameter[] createSupportedParameters() throws NoSuchMethodException {
        return new MethodParameter[]{new MethodParameter(getClass().getMethod("source", Source.class), 0),
                new MethodParameter(getClass().getMethod("dom", DOMSource.class), 0),
                new MethodParameter(getClass().getMethod("sax", SAXSource.class), 0),
                new MethodParameter(getClass().getMethod("stream", StreamSource.class), 0),
                new MethodParameter(getClass().getMethod("stax", StAXSource.class), 0)};
    }
View Full Code Here

                new MethodParameter(getClass().getMethod("stax", StAXSource.class), 0)};
    }

    @Override
    protected MethodParameter[] createSupportedReturnTypes() throws NoSuchMethodException {
        return new MethodParameter[]{new MethodParameter(getClass().getMethod("source", Source.class), -1),
                new MethodParameter(getClass().getMethod("dom", DOMSource.class), -1),
                new MethodParameter(getClass().getMethod("sax", SAXSource.class), -1),
                new MethodParameter(getClass().getMethod("stream", StreamSource.class), -1),
        new MethodParameter(getClass().getMethod("stax", StAXSource.class), -1)};
    }
View Full Code Here

        return new XomPayloadMethodProcessor();
    }

    @Override
    protected MethodParameter[] createSupportedParameters() throws NoSuchMethodException {
        return new MethodParameter[]{new MethodParameter(getClass().getMethod("element", Element.class), 0)};
    }
View Full Code Here

        return new MethodParameter[]{new MethodParameter(getClass().getMethod("element", Element.class), 0)};
    }

    @Override
    protected MethodParameter[] createSupportedReturnTypes() throws NoSuchMethodException {
        return new MethodParameter[]{new MethodParameter(getClass().getMethod("element", Element.class), -1)};
    }
View Full Code Here

    private MethodParameter stringReturnType;

    @Before
    public void setUp() throws Exception {
        processor = new JaxbElementPayloadMethodProcessor();
        supportedParameter = new MethodParameter(getClass().getMethod("supported", JAXBElement.class), 0);
        supportedReturnType = new MethodParameter(getClass().getMethod("supported", JAXBElement.class), -1);
        stringReturnType = new MethodParameter(getClass().getMethod("string"), -1);
    }
View Full Code Here

     * @throws Exception in case of errors
     */
    protected void handleMethodReturnValue(MessageContext messageContext,
                                           Object returnValue,
                                           MethodEndpoint methodEndpoint) throws Exception {
        MethodParameter returnType = methodEndpoint.getReturnType();
        for (MethodReturnValueHandler methodReturnValueHandler : methodReturnValueHandlers) {
            if (methodReturnValueHandler.supportsReturnType(returnType)) {
                methodReturnValueHandler.handleReturnValue(messageContext, returnType, returnValue);
                return;
            }
View Full Code Here

    public void supportsParameter() throws NoSuchMethodException {
        for (MethodParameter supportedParameter : supportedParameters) {
            assertTrue("processor does not support " + supportedParameter.getParameterType() + " parameter",
                    processor.supportsParameter(supportedParameter));
        }
        MethodParameter unsupportedParameter =
                new MethodParameter(getClass().getMethod("unsupported", String.class), 0);
        assertFalse("processor supports invalid parameter", processor.supportsParameter(unsupportedParameter));
    }
View Full Code Here

    public void supportsReturnType() throws NoSuchMethodException {
        for (MethodParameter supportedReturnType : supportedReturnTypes) {
            assertTrue("processor does not support " + supportedReturnType.getParameterType() + " return type",
                    processor.supportsReturnType(supportedReturnType));
        }
        MethodParameter unsupportedReturnType =
                new MethodParameter(getClass().getMethod("unsupported", String.class), -1);
        assertFalse("processor supports invalid return type", processor.supportsReturnType(unsupportedReturnType));
    }
View Full Code Here

TOP

Related Classes of org.springframework.core.MethodParameter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.