processInterface(javaInterface, operations);
}
private void processInterface(JavaInterface javaInterface, List<Operation> operations) {
Class<?> clazz = javaInterface.getJavaClass();
DataBinding dataBinding = clazz.getAnnotation(DataBinding.class);
String dataBindingId = null;
boolean wrapperStyle = false;
if (dataBinding != null) {
dataBindingId = dataBinding.value();
wrapperStyle = dataBinding.wrapped();
}
Map<String, Operation> opMap = new HashMap<String, Operation>();
for (Operation op : javaInterface.getOperations()) {
opMap.put(op.getName(), op);
// In the case of @WebMethod, the method name can be different from the operation name
if (op instanceof JavaOperation) {
opMap.put(((JavaOperation)op).getJavaMethod().getName(), op);
}
if (dataBindingId != null) {
op.setDataBinding(dataBindingId);
op.setWrapperStyle(wrapperStyle);
}
}
for (Method method : clazz.getMethods()) {
if (method.getDeclaringClass() == Object.class) {
continue;
}
Operation operation = opMap.get(method.getName());
if (operation == null) { // @WebMethod exclude=true
continue;
}
DataBinding methodDataBinding = clazz.getAnnotation(DataBinding.class);
if (methodDataBinding == null) {
methodDataBinding = dataBinding;
}
dataBindingId = null;
wrapperStyle = false;