Examples of JavaAnnotation


Examples of org.apache.cxf.tools.common.model.JavaAnnotation

        }
        if (method.getSoapStyle() == SOAPBinding.Style.DOCUMENT) {
            if (!method.isWrapperStyle()
                && !SOAPBinding.ParameterStyle.BARE.equals(method.getInterface().getSOAPParameterStyle())) {
           
                JavaAnnotation bindingAnnotation = new JavaAnnotation("SOAPBinding");
                bindingAnnotation.addArgument("parameterStyle",
                                              SOAPBindingUtil.getBindingAnnotation("BARE"), "");
                method.addAnnotation("SOAPBinding", bindingAnnotation);
            } else if (method.isWrapperStyle()
                && SOAPBinding.ParameterStyle.BARE.equals(method.getInterface().getSOAPParameterStyle())) {
                JavaAnnotation bindingAnnotation = new JavaAnnotation("SOAPBinding");
                bindingAnnotation.addArgument("parameterStyle",
                                              SOAPBindingUtil.getBindingAnnotation("WRAPPED"), "");
                method.addAnnotation("SOAPBinding", bindingAnnotation);               
            }
        }
    }
View Full Code Here

Examples of org.apache.cxf.tools.common.model.JavaAnnotation

            parameter = (JavaParameter) ja;
        } else {
            throw new RuntimeException("WebParamAnnotator only annotate the JavaParameter");
        }
        JavaMethod method = parameter.getMethod();
        JavaAnnotation webParamAnnotation = new JavaAnnotation("WebParam");
        String name = parameter.getName();
        String targetNamespace = method.getInterface().getNamespace();
        String partName = null;

        if (method.getSoapStyle() == SOAPBinding.Style.DOCUMENT
            || parameter.isHeader()) {
            targetNamespace = parameter.getTargetNamespace();
            if (parameter.getQName() != null) {
                name = parameter.getQName().getLocalPart();
            }
            if (!method.isWrapperStyle()) {
                partName = parameter.getPartName();
            }
        }

        if (method.getSoapStyle() == SOAPBinding.Style.RPC) {
            name = parameter.getPartName();
            partName = parameter.getPartName();
        }

        if (partName != null) {
            webParamAnnotation.addArgument("partName", partName);
        }
        if (parameter.getStyle() == JavaType.Style.OUT || parameter.getStyle() == JavaType.Style.INOUT) {
            webParamAnnotation.addArgument("mode", "Mode." + parameter.getStyle().toString(), "");
        }
        webParamAnnotation.addArgument("name", name);
        if (method.getSoapStyle() == SOAPBinding.Style.DOCUMENT || parameter.isHeader()) {
            webParamAnnotation.addArgument("targetNamespace", targetNamespace);
        }

        parameter.setAnnotation(webParamAnnotation);
    }
View Full Code Here

Examples of org.apache.cxf.tools.common.model.JavaAnnotation

        Element e = this.intf.getHandlerChains();
        NodeList nl = e.getElementsByTagNameNS(ToolConstants.HANDLER_CHAINS_URI,
                                               ToolConstants.HANDLER_CHAIN);
        if (nl.getLength() > 0) {
            String fName = ProcessorUtil.getHandlerConfigFileName(this.intf.getName());
            handlerChainAnnotation = new JavaAnnotation("HandlerChain");
            handlerChainAnnotation.addArgument("name", HANDLER_CHAIN_NAME);
            handlerChainAnnotation.addArgument("file", fName + ".xml");
            generateHandlerChainFile(e, parseOutputName(this.intf.getPackageName(),
                                                        fName,
                                                        ".xml"));
View Full Code Here

Examples of org.apache.cxf.tools.common.model.JavaAnnotation

                    processor.processMethod(jm, bop.getOperationInfo(), jaxwsBinding);

                }

                if (headerType == this.resultHeader) {
                    JavaAnnotation resultAnno = jm.getAnnotationMap().get("WebResult");
                    if (resultAnno != null) {
                        resultAnno.addArgument("header", "true", "");
                    }
                }
                processParameter(jm, bop);
            }
        }
View Full Code Here

Examples of org.apache.cxf.tools.common.model.JavaAnnotation

   
    public void testAnnotateDOCWrapped() throws Exception {
        init(method, parameter, SOAPBinding.Style.DOCUMENT, true);
        parameter.annotate(new WebParamAnnotator());

        JavaAnnotation annotation = parameter.getAnnotation();
        Map<String, String> args = annotation.getArguments();
        assertEquals(2, args.size());
        assertEquals("\"http://apache.org/cxf\"", args.get("targetNamespace"));
        assertEquals("\"x\"", args.get("name"));
        // XXX - order that attributes are appended to the string
        //       differs with the ibmjdk...
View Full Code Here

Examples of org.apache.cxf.tools.common.model.JavaAnnotation

    public void testAnnotateDOCBare() throws Exception {
        init(method, parameter, SOAPBinding.Style.DOCUMENT, false);

        parameter.annotate(new WebParamAnnotator());

        JavaAnnotation annotation = parameter.getAnnotation();
        Map<String, String> args = annotation.getArguments();
        assertEquals(3, args.size());
        assertEquals("\"http://apache.org/cxf\"", args.get("targetNamespace"));
        assertEquals("\"y\"", args.get("partName"));
        assertEquals("\"x\"", args.get("name"));
        // XXX - order that attributes are appended to the string
View Full Code Here

Examples of org.apache.cxf.tools.common.model.JavaAnnotation

    }

    public void testAnnotateRPC() throws Exception {
        init(method, parameter, SOAPBinding.Style.RPC, true);
        parameter.annotate(new WebParamAnnotator());
        JavaAnnotation annotation = parameter.getAnnotation();
        assertEquals(2, annotation.getArguments().size());
        assertEquals("@WebParam(partName = \"y\", name = \"y\")",
                     annotation.toString());
    }
View Full Code Here

Examples of org.apache.cxf.tools.common.model.JavaAnnotation

        method.annotate(new WebResultAnnotator());
        Map<String, JavaAnnotation> annotations = method.getAnnotationMap();
        assertNotNull(annotations);
        assertEquals(1, annotations.size());
        assertEquals("WebResult", annotations.keySet().iterator().next());
        JavaAnnotation resultAnnotation = annotations.values().iterator().next();
        Map<String, String> arguments = resultAnnotation.getArguments();
        assertNotNull(arguments);
        assertEquals(1, arguments.size());
        assertEquals("name", arguments.keySet().iterator().next());
        assertEquals("\"return\"", arguments.values().iterator().next());
    }
View Full Code Here

Examples of org.apache.cxf.tools.common.model.JavaAnnotation

        }

        JavaParameter asyncHandler = new JavaParameter();
        asyncHandler.setName("asyncHandler");
        asyncHandler.setClassName(getAsyncClassName(method, "AsyncHandler"));
        JavaAnnotation asyncHandlerAnnotation = new JavaAnnotation("WebParam");
        asyncHandlerAnnotation.addArgument("name", "asyncHandler");
        asyncHandlerAnnotation.addArgument("targetNamespace", "");
        asyncHandler.setAnnotation(asyncHandlerAnnotation);

        pollingMethod.addParameter(asyncHandler);

        method.getInterface().addMethod(pollingMethod);
View Full Code Here

Examples of org.apache.cxf.tools.common.model.JavaAnnotation

                    processor.processMethod(jm, bop.getOperationInfo(), jaxwsBinding);

                }

                if (headerType == this.resultHeader) {
                    JavaAnnotation resultAnno = jm.getAnnotationMap().get("WebResult");
                    if (resultAnno != null) {
                        resultAnno.addArgument("header", "true", "");
                    }
                }
                processParameter(jm, bop);
            }
        }
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.