summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/core-databinding/src
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2008-08-27 19:37:32 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2008-08-27 19:37:32 +0000
commit06471ed17178a7a9811bf6b63cbf40a07af392b4 (patch)
tree08169aa59b4bbde2ff53e8a6b83dac37963df351 /java/sca/modules/core-databinding/src
parent5b86eacdc5fb7395c2755c1510231d7a1630b3b0 (diff)
Fix for TUSCANY-2398
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@689587 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/core-databinding/src')
-rw-r--r--java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Input2InputTransformer.java18
-rw-r--r--java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Output2OutputTransformer.java11
2 files changed, 17 insertions, 12 deletions
diff --git a/java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Input2InputTransformer.java b/java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Input2InputTransformer.java
index 71694c0a0a..fb5f939edb 100644
--- a/java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Input2InputTransformer.java
+++ b/java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Input2InputTransformer.java
@@ -133,7 +133,8 @@ public class Input2InputTransformer extends BaseTransformer<Object[], Object[]>
// Check if the source operation is wrapped
DataType<List<DataType>> sourceType = context.getSourceDataType();
Operation sourceOp = context.getSourceOperation();
- boolean sourceWrapped = sourceOp != null && sourceOp.isWrapperStyle();
+ boolean sourceWrapped = sourceOp != null && sourceOp.isWrapperStyle() && sourceOp.getWrapper() != null;
+ boolean sourceBare = sourceOp != null && !sourceOp.isWrapperStyle() && sourceOp.getWrapper() == null;
// Find the wrapper handler for source data
WrapperHandler sourceWrapperHandler = null;
@@ -143,19 +144,20 @@ public class Input2InputTransformer extends BaseTransformer<Object[], Object[]>
// Check if the target operation is wrapped
DataType<List<DataType>> targetType = context.getTargetDataType();
Operation targetOp = (Operation)context.getTargetOperation();
- boolean targetWrapped = targetOp != null && targetOp.isWrapperStyle();
+ boolean targetWrapped = targetOp != null && targetOp.isWrapperStyle() && targetOp.getWrapper() != null;
+ boolean targetBare = targetOp != null && !targetOp.isWrapperStyle() && targetOp.getWrapper() == null;
// Find the wrapper handler for target data
WrapperHandler targetWrapperHandler = null;
String targetDataBinding = getDataBinding(targetOp);
targetWrapperHandler = getWrapperHandler(targetDataBinding, targetWrapped);
- if ((!sourceWrapped) && targetWrapped) {
+ if ((!sourceWrapped && !sourceBare) && targetWrapped) {
// Unwrapped --> Wrapped
WrapperInfo wrapper = targetOp.getWrapper();
- ElementInfo wrapperElement = wrapper.getInputWrapperElement();
+ // ElementInfo wrapperElement = wrapper.getInputWrapperElement();
- Class<?> targetWrapperClass = wrapper != null ? wrapper.getInputWrapperClass() : null;
+ // Class<?> targetWrapperClass = wrapper != null ? wrapper.getInputWrapperClass() : null;
if (source == null) {
// Empty child elements
@@ -207,14 +209,14 @@ public class Input2InputTransformer extends BaseTransformer<Object[], Object[]>
true);
return new Object[] {targetWrapper};
- } else if (sourceWrapped && (!targetWrapped)) {
+ } else if (sourceWrapped && (!targetWrapped && !targetBare)) {
// Wrapped to Unwrapped
Object sourceWrapper = source[0];
Object[] target = null;
- List<ElementInfo> childElements = sourceOp.getWrapper().getInputChildElements();
+ // List<ElementInfo> childElements = sourceOp.getWrapper().getInputChildElements();
if (targetWrapperHandler != null) {
- ElementInfo wrapperElement = sourceOp.getWrapper().getInputWrapperElement();
+ // ElementInfo wrapperElement = sourceOp.getWrapper().getInputWrapperElement();
// FIXME: This is a workaround for the wsdless support as it passes in child elements
// under the wrapper that only matches by position
if (sourceWrapperHandler.isInstance(sourceWrapper, sourceOp, true)) {
diff --git a/java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Output2OutputTransformer.java b/java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Output2OutputTransformer.java
index 71253f00b4..8d586905c4 100644
--- a/java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Output2OutputTransformer.java
+++ b/java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/transformers/Output2OutputTransformer.java
@@ -154,7 +154,8 @@ public class Output2OutputTransformer extends BaseTransformer<Object, Object> im
try {
DataType<DataType> sourceType = context.getSourceDataType();
Operation sourceOp = context.getSourceOperation();
- boolean sourceWrapped = sourceOp != null && sourceOp.isWrapperStyle();
+ boolean sourceWrapped = sourceOp != null && sourceOp.isWrapperStyle() && sourceOp.getWrapper() != null;
+ boolean sourceBare = sourceOp != null && !sourceOp.isWrapperStyle() && sourceOp.getWrapper() == null;
WrapperHandler sourceWrapperHandler = null;
String sourceDataBinding = getDataBinding(sourceOp);
@@ -162,12 +163,14 @@ public class Output2OutputTransformer extends BaseTransformer<Object, Object> im
DataType<DataType> targetType = context.getTargetDataType();
Operation targetOp = (Operation)context.getTargetOperation();
- boolean targetWrapped = targetOp != null && targetOp.isWrapperStyle();
+ boolean targetWrapped = targetOp != null && targetOp.isWrapperStyle() && targetOp.getWrapper() != null;
+ boolean targetBare = targetOp != null && !targetOp.isWrapperStyle() && targetOp.getWrapper() == null;
+
WrapperHandler targetWrapperHandler = null;
String targetDataBinding = getDataBinding(targetOp);
targetWrapperHandler = getWrapperHandler(targetDataBinding, targetWrapped);
- if ((!sourceWrapped) && targetWrapped) {
+ if ((!sourceWrapped &&!sourceBare) && targetWrapped) {
// Unwrapped --> Wrapped
WrapperInfo wrapper = targetOp.getWrapper();
ElementInfo wrapperElement = wrapper.getOutputWrapperElement();
@@ -211,7 +214,7 @@ public class Output2OutputTransformer extends BaseTransformer<Object, Object> im
child = mediator.mediate(response, sourceType.getLogical(), argType, context.getMetadata());
targetWrapperHandler.setChildren(targetWrapper, new Object[] {child}, targetOp, false);
return targetWrapper;
- } else if (sourceWrapped && (!targetWrapped)) {
+ } else if (sourceWrapped && (!targetWrapped && !targetBare)) {
// Wrapped to Unwrapped
Object sourceWrapper = response;
List<ElementInfo> childElements = sourceOp.getWrapper().getOutputChildElements();