} else {
throw new RuntimeException("RequestWrapper and ResponseWrapper can only annotate JavaMethod");
}
if (wrapperRequest != null) {
JAnnotation requestAnnotation = new JAnnotation(RequestWrapper.class);
requestAnnotation.addElement(new JAnnotationElement("localName",
wrapperRequest.getType()));
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()));
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());