Examples of MethodParameter


Examples of org.springframework.core.MethodParameter

        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

Examples of org.springframework.core.MethodParameter

    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

Examples of org.springframework.core.MethodParameter

     * @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

Examples of org.springframework.core.MethodParameter

    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

Examples of org.springframework.core.MethodParameter

    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

Examples of org.springframework.core.MethodParameter

    private MethodParameter invalidParameter;

    @Before
    public void setUp() throws Exception {
        resolver = new StaxPayloadMethodArgumentResolver();
        streamParameter = new MethodParameter(getClass().getMethod("streamReader", XMLStreamReader.class), 0);
        eventParameter = new MethodParameter(getClass().getMethod("eventReader", XMLEventReader.class), 0);
        invalidParameter = new MethodParameter(getClass().getMethod("invalid", XMLStreamReader.class), 0);
    }
View Full Code Here

Examples of org.springframework.core.MethodParameter

    @Before
    public void setUp() throws Exception {
        resolver = new XPathParamMethodArgumentResolver();
        Method supportedTypes = getClass()
                .getMethod("supportedTypes", Boolean.TYPE, Double.TYPE, Node.class, NodeList.class, String.class);
        booleanParameter = new MethodParameter(supportedTypes, 0);
        doubleParameter = new MethodParameter(supportedTypes, 1);
        nodeParameter = new MethodParameter(supportedTypes, 2);
        nodeListParameter = new MethodParameter(supportedTypes, 3);
        stringParameter = new MethodParameter(supportedTypes, 4);
        convertedParameter = new MethodParameter(getClass().getMethod("convertedType", Integer.TYPE), 0);
        unsupportedParameter = new MethodParameter(getClass().getMethod("unsupported", String.class), 0);
        namespaceMethodParameter = new MethodParameter(getClass().getMethod("namespacesMethod", String.class), 0);
        namespaceClassParameter = new MethodParameter(getClass().getMethod("namespacesClass", String.class), 0);
    }
View Full Code Here

Examples of org.springframework.core.MethodParameter

    /** Returns the method parameters for this method endpoint. */
    public MethodParameter[] getMethodParameters() {
        int parameterCount = getMethod().getParameterTypes().length;
        MethodParameter[] parameters = new MethodParameter[parameterCount];
        for (int i = 0; i < parameterCount; i++) {
            parameters[i] = new MethodParameter(getMethod(), i);
        }
        return parameters;
    }
View Full Code Here

Examples of org.springframework.core.MethodParameter

        return parameters;
    }

    /** Returns the method return type, as {@code MethodParameter}. */
    public MethodParameter getReturnType() {
        return new MethodParameter(method, -1);
    }
View Full Code Here

Examples of org.springframework.core.MethodParameter

    @Override
    protected QName getLookupKeyForMethod(Method method) {
        Class<?>[] parameterTypes = method.getParameterTypes();
        for (int i = 0; i < parameterTypes.length; i++) {
            MethodParameter methodParameter = new MethodParameter(method, i);
            Class<?> parameterType = methodParameter.getParameterType();
            if (parameterType.isAnnotationPresent(XmlRootElement.class)) {
                QName result = handleRootElement(parameterType);
                if (result != null) {
                    return result;
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.