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

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


    }

    private void setParameterAsHeader(JavaParameter parameter) {
        parameter.setHeader(true);
        JAnnotation parameterAnnotation = parameter.getAnnotation("WebParam");
        parameterAnnotation.addElement(new JAnnotationElement("header", true, true));
        parameterAnnotation.addElement(new JAnnotationElement("name",
                                                                     parameter.getQName().getLocalPart()));
        parameterAnnotation.addElement(new JAnnotationElement("partName", parameter.getPartName()));
        parameterAnnotation.addElement(new JAnnotationElement("targetNamespace",
                                                                     parameter.getTargetNamespace()));
    }
View Full Code Here


                    }
                }
            }
            if (penv.containsKey(ToolConstants.RUNTIME_DATABINDING_CLASS)) {
                JAnnotation ann = new JAnnotation(DataBinding.class);
                JAnnotationElement el
                    = new JAnnotationElement(null,
                                             penv.get(ToolConstants.RUNTIME_DATABINDING_CLASS),
                                             true);
                ann.addElement(el);
                intf.addAnnotation(ann);
            }
View Full Code Here

                                                                     ToolConstants.HANDLER_CHAINS_URI,
                                                                     ToolConstants.HANDLER_CHAIN);
        if (elemList.size() > 0) {
            String fName = ProcessorUtil.getHandlerConfigFileName(this.intf.getName());
            handlerChainAnnotation = new JAnnotation(HandlerChain.class);
            handlerChainAnnotation.addElement(new JAnnotationElement("name",
                                                                     HANDLER_CHAIN_NAME));
            handlerChainAnnotation.addElement(new JAnnotationElement("file", fName + ".xml"));          
            generateHandlerChainFile(e, parseOutputName(this.intf.getPackageName(),
                                                        fName,
                                                        ".xml"));
        }
    }
View Full Code Here

        asyncHandler.setStyle(JavaType.Style.IN);
       
        callbackMethod.addParameter(asyncHandler);
       
        JAnnotation asyncHandlerAnnotation = new JAnnotation(WebParam.class);
        asyncHandlerAnnotation.addElement(new JAnnotationElement("name", "asyncHandler"));
        asyncHandlerAnnotation.addElement(new JAnnotationElement("targetNamespace", ""));
        asyncHandler.setAnnotation(asyncHandlerAnnotation);               

        method.getInterface().addMethod(callbackMethod);
    }
View Full Code Here

                }

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

    }

    private void setParameterAsHeader(JavaParameter parameter) {
        parameter.setHeader(true);
        JAnnotation parameterAnnotation = parameter.getAnnotation();
        parameterAnnotation.addElement(new JAnnotationElement("header", true, true));
        parameterAnnotation.addElement(new JAnnotationElement("name",
                                                                     parameter.getQName().getLocalPart()));
        parameterAnnotation.addElement(new JAnnotationElement("targetNamespace",
                                                                     parameter.getTargetNamespace()));
    }
View Full Code Here

        } else {
            throw new RuntimeException("WrapperBeanAnnotator expect JavaClass as input");
        }

        JAnnotation xmlRootElement = new JAnnotation(XmlRootElement.class);
        xmlRootElement.addElement(new JAnnotationElement("name",
                                                         beanClass.getElementName().getLocalPart()));
        xmlRootElement.addElement(new JAnnotationElement("namespace",
                                                         beanClass.getElementName().getNamespaceURI()));
       
        JAnnotation xmlAccessorType = new JAnnotation(XmlAccessorType.class);
        xmlAccessorType.addElement(new JAnnotationElement(null, XmlAccessType.FIELD));

        JAnnotation xmlType = new JAnnotation(XmlType.class);
        xmlType.addElement(new JAnnotationElement("name",
                                                  beanClass.getElementName().getLocalPart()));
        xmlType.addElement(new JAnnotationElement("namespace",
                                                  beanClass.getElementName().getNamespaceURI()));
       
        List<String> props = new ArrayList<String>();
        for (JavaField f : beanClass.getFields()) {
            props.add(f.getParaName());
        }
        if (props.size() > 1) {
            xmlType.addElement(new JAnnotationElement("propOrder",
                                                      props));
        }
       
        // Revisit: why annotation is string?
        beanClass.addAnnotation(xmlRootElement);
View Full Code Here

        } else {
            throw new RuntimeException("WrapperBeanFiledAnnotator expect JavaField as input");
        }
        String rawName = jField.getRawName();
        JAnnotation xmlElementAnnotation = new JAnnotation(XmlElement.class);
        xmlElementAnnotation.addElement(new JAnnotationElement("name", rawName));
        if (!StringUtils.isEmpty(jField.getTargetNamespace())) {
            xmlElementAnnotation.addElement(new JAnnotationElement("namespace",
                                                                          jField.getTargetNamespace()));
        }

        jField.addAnnotation(xmlElementAnnotation);
       
        for (Annotation ann : jField.getJaxbAnnotaions()) {
            if (ann instanceof XmlMimeType) {
                JAnnotation mimeAnno = new JAnnotation(XmlMimeType.class);
                mimeAnno.addElement(new JAnnotationElement("value", ((XmlMimeType)ann).value()));
                jField.addAnnotation(mimeAnno);
            } else if (ann instanceof XmlJavaTypeAdapter) {          
                JAnnotation jaxbAnn = new JAnnotation(XmlJavaTypeAdapter.class);
                jaxbAnn.addElement(new JAnnotationElement("value", ((XmlJavaTypeAdapter)ann).value()));
                jaxbAnn.addElement(new JAnnotationElement("type", ((XmlJavaTypeAdapter)ann).type()));
                jField.addAnnotation(jaxbAnn);
            } else if (ann instanceof XmlAttachmentRef) {
                JAnnotation jaxbAnn = new JAnnotation(XmlAttachmentRef.class);
                jField.addAnnotation(jaxbAnn);
            } else if (ann instanceof XmlList) {
View Full Code Here

        asyncHandler.setStyle(JavaType.Style.IN);
       
        callbackMethod.addParameter(asyncHandler);
       
        JAnnotation asyncHandlerAnnotation = new JAnnotation(WebParam.class);
        asyncHandlerAnnotation.addElement(new JAnnotationElement("name", "asyncHandler"));
        asyncHandlerAnnotation.addElement(new JAnnotationElement("targetNamespace", ""));
        asyncHandler.addAnnotation("WebParam", asyncHandlerAnnotation);               

        method.getInterface().addImport("javax.jws.WebParam");
        method.getInterface().addMethod(callbackMethod);
    }
View Full Code Here

                }

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

TOP

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

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.