Package org.apache.cxf.tools.common.model

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


        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

            wrapperBeanClass = (WrapperBeanClass) clz;
        } else {
            throw new RuntimeException("WrapperBeanAnnotator expect JavaClass as input");
        }

        JavaAnnotation xmlRootElement = new JavaAnnotation("XmlRootElement");
        xmlRootElement.addArgument("name", wrapperBeanClass.getElementName().getLocalPart());
        xmlRootElement.addArgument("namespace", wrapperBeanClass.getElementName().getNamespaceURI());

        JavaAnnotation xmlAccessorType = new JavaAnnotation("XmlAccessorType");
        xmlAccessorType.addArgument("XmlAccessType.FIELD", "null", "");

        JavaAnnotation xmlType = new JavaAnnotation("XmlType");
        //xmlType.addArgument("name", wrapperBeanClass.getElementName().getLocalPart());
        xmlType.addArgument("name", wrapperBeanClass.getElementName().getLocalPart());
        xmlType.addArgument("namespace", wrapperBeanClass.getElementName().getNamespaceURI());
        // Revisit: why annotation is string?
        wrapperBeanClass.addAnnotation(xmlRootElement.toString());
        wrapperBeanClass.addAnnotation(xmlAccessorType.toString());
        wrapperBeanClass.addAnnotation(xmlType.toString());

        wrapperBeanClass.addImport("javax.xml.bind.annotation.XmlAccessType");
        wrapperBeanClass.addImport("javax.xml.bind.annotation.XmlAccessorType");
        wrapperBeanClass.addImport("javax.xml.bind.annotation.XmlRootElement");
        wrapperBeanClass.addImport("javax.xml.bind.annotation.XmlType");
View Full Code Here

            jField = (JavaField) field;
        } else {
            throw new RuntimeException("WrapperBeanFiledAnnotator expect JavaField as input");
        }
        String rawName = jField.getRawName();
        JavaAnnotation xmlElementAnnotation = new JavaAnnotation("XmlElement");
       
        xmlElementAnnotation.addArgument("name", rawName);
        xmlElementAnnotation.addArgIgnoreEmpty("namespace", jField.getTargetNamespace(), "\"");

        jField.setAnnotation(xmlElementAnnotation);
        jField.getOwner().addImport("javax.xml.bind.annotation.XmlElement");
    }
View Full Code Here

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

    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

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

        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

        }

        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

                    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

Related Classes of org.apache.cxf.tools.common.model.JavaAnnotation

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.