dataBindingId = dataBinding.value();
wrapperStyle = dataBinding.wrapped();
}
for (Operation op : javaInterface.getOperations()) {
JavaOperation operation = (JavaOperation) op;
// In the case of @WebMethod, the method name can be different from the operation name
if (dataBindingId != null) {
op.setDataBinding(dataBindingId);
op.setWrapperStyle(wrapperStyle);
}
Method method = operation.getJavaMethod();
DataBinding methodDataBinding = clazz.getAnnotation(DataBinding.class);
if (methodDataBinding == null) {
methodDataBinding = dataBinding;
}
dataBindingId = null;
wrapperStyle = false;
if (dataBinding != null) {
dataBindingId = dataBinding.value();
wrapperStyle = dataBinding.wrapped();
operation.setDataBinding(dataBindingId);
operation.setWrapperStyle(wrapperStyle);
}
// FIXME: We need a better way to identify simple java types
int i = 0;
for (org.apache.tuscany.sca.interfacedef.DataType<?> d : operation.getInputType().getLogical()) {
if (d.getDataBinding() == null) {
d.setDataBinding(dataBindingId);
}
for (Annotation a : method.getParameterAnnotations()[i]) {
if (a.annotationType() == org.apache.tuscany.sca.databinding.annotation.DataType.class) {
String value = ((org.apache.tuscany.sca.databinding.annotation.DataType)a).value();
d.setDataBinding(value);
}
}
dataBindingRegistry.introspectType(d, operation);
i++;
}
if (operation.getOutputType() != null) {
for ( org.apache.tuscany.sca.interfacedef.DataType<?> d : operation.getOutputType().getLogical()) {
if ( d != null ) {
// The DataType is null for void operations
if ( d.getDataBinding() == null ) {
d.setDataBinding(dataBindingId);
}
dataBindingRegistry.introspectType(d, operation);
}
}
org.apache.tuscany.sca.databinding.annotation.DataType dt =
method.getAnnotation(org.apache.tuscany.sca.databinding.annotation.DataType.class);
if (dt != null) {
operation.getOutputType().getLogical().get(0).setDataBinding(dt.value());
}
}
}
}