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

Examples of org.apache.cxf.tools.common.model.JavaMethod.addAnnotation()


            methodAnnotation.addElement(new JAnnotationElement("operationName", operationName));
        }
        if (!StringUtils.isEmpty(method.getSoapAction())) {
            methodAnnotation.addElement(new JAnnotationElement("action", method.getSoapAction()));
        }
        method.addAnnotation("WebMethod", methodAnnotation);
    }
}
View Full Code Here


                && !SOAPBinding.ParameterStyle.BARE.equals(method.getInterface().getSOAPParameterStyle())) {
           
                JAnnotation bindingAnnotation = new JAnnotation(SOAPBinding.class);
                bindingAnnotation.addElement(new JAnnotationElement("parameterStyle",
                                                                           SOAPBinding.ParameterStyle.BARE));
                method.addAnnotation("SOAPBinding", bindingAnnotation);
            } else if (method.isWrapperStyle()
                && SOAPBinding.ParameterStyle.BARE.equals(method.getInterface().getSOAPParameterStyle())) {
                JAnnotation bindingAnnotation = new JAnnotation(SOAPBinding.class);
                bindingAnnotation.addElement(new JAnnotationElement("parameterStyle",
                                                                        SOAPBinding.ParameterStyle.WRAPPED));
View Full Code Here

            } else if (method.isWrapperStyle()
                && SOAPBinding.ParameterStyle.BARE.equals(method.getInterface().getSOAPParameterStyle())) {
                JAnnotation bindingAnnotation = new JAnnotation(SOAPBinding.class);
                bindingAnnotation.addElement(new JAnnotationElement("parameterStyle",
                                                                        SOAPBinding.ParameterStyle.WRAPPED));
                method.addAnnotation("SOAPBinding", bindingAnnotation);               
            }
        } else if (!SOAPBinding.Style.RPC.equals(method.getInterface().getSOAPStyle())) {
            JAnnotation bindingAnnotation = new JAnnotation(SOAPBinding.class);
            bindingAnnotation.addElement(new JAnnotationElement("style",
                                                                       SOAPBinding.Style.RPC));
View Full Code Here

            }
        } else if (!SOAPBinding.Style.RPC.equals(method.getInterface().getSOAPStyle())) {
            JAnnotation bindingAnnotation = new JAnnotation(SOAPBinding.class);
            bindingAnnotation.addElement(new JAnnotationElement("style",
                                                                       SOAPBinding.Style.RPC));
            method.addAnnotation("SOAPBinding", bindingAnnotation);           
        }
    }
   
}
View Full Code Here

            requestAnnotation.addElement(new JAnnotationElement("targetNamespace",
                                                                       wrapperRequest.getTargetNamespace()));
            requestAnnotation.addElement(new JAnnotationElement("className",
                                                                       wrapperRequest.getClassName()));

            method.addAnnotation("RequestWrapper", requestAnnotation);
            method.getInterface().addImports(requestAnnotation.getImports());
        }
        if (wrapperResponse != null) {
            List<JAnnotationElement> elements = new ArrayList<JAnnotationElement>();
            elements.add(new JAnnotationElement("localName", wrapperResponse.getType()));
View Full Code Here

            elements.add(new JAnnotationElement("targetNamespace", wrapperResponse.getTargetNamespace()));
            elements.add(new JAnnotationElement("className", wrapperResponse.getClassName()));

            JAnnotation responseAnnotation = new JAnnotation(ResponseWrapper.class);
            responseAnnotation.getElements().addAll(elements);
            method.addAnnotation("ResponseWrapper", responseAnnotation);
            method.getInterface().addImports(responseAnnotation.getImports());
        }
    }
}
View Full Code Here

            throw new RuntimeException("WebResult can only annotate JavaMethod");
        }
           
        if (method.isOneWay()) {
            JAnnotation oneWayAnnotation = new JAnnotation(Oneway.class);
            method.addAnnotation("Oneway", oneWayAnnotation);
            return;
        }

        if ("void".equals(method.getReturn().getType())) {
            return;
View Full Code Here

            || (method.getSoapStyle() == SOAPBinding.Style.DOCUMENT && !method.isWrapperStyle())) {
            resultAnnotation.addElement(new JAnnotationElement("partName",
                                                                      method.getReturn().getName()));
        }

        method.addAnnotation("WebResult", resultAnnotation);
        method.getInterface().addImport("javax.jws.WebResult");
    }
}
View Full Code Here

        JavaReturn future = new JavaReturn();
        future.setClassName("Future<?>");
        pollingMethod.setReturn(future);

        addWebMethodAnnotation(pollingMethod, method.getOperationName());
        pollingMethod.addAnnotation("ResponseWrapper", method.getAnnotationMap().get("ResponseWrapper"));
        pollingMethod.addAnnotation("RequestWrapper", method.getAnnotationMap().get("RequestWrapper"));
        pollingMethod.addAnnotation("SOAPBinding", method.getAnnotationMap().get("SOAPBinding"));

        for (Iterator iter = method.getParameters().iterator(); iter.hasNext();) {
            pollingMethod.addParameter((JavaParameter)iter.next());
View Full Code Here

        future.setClassName("Future<?>");
        pollingMethod.setReturn(future);

        addWebMethodAnnotation(pollingMethod, method.getOperationName());
        pollingMethod.addAnnotation("ResponseWrapper", method.getAnnotationMap().get("ResponseWrapper"));
        pollingMethod.addAnnotation("RequestWrapper", method.getAnnotationMap().get("RequestWrapper"));
        pollingMethod.addAnnotation("SOAPBinding", method.getAnnotationMap().get("SOAPBinding"));

        for (Iterator iter = method.getParameters().iterator(); iter.hasNext();) {
            pollingMethod.addParameter((JavaParameter)iter.next());
        }
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.