summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/implementation-java-runtime
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-2.x/trunk/modules/implementation-java-runtime')
-rw-r--r--sca-java-2.x/trunk/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/JavaPropertyValueObjectFactory.java44
1 files changed, 18 insertions, 26 deletions
diff --git a/sca-java-2.x/trunk/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/JavaPropertyValueObjectFactory.java b/sca-java-2.x/trunk/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/JavaPropertyValueObjectFactory.java
index 01c3b148f8..606984659d 100644
--- a/sca-java-2.x/trunk/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/JavaPropertyValueObjectFactory.java
+++ b/sca-java-2.x/trunk/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/JavaPropertyValueObjectFactory.java
@@ -65,18 +65,6 @@ public class JavaPropertyValueObjectFactory implements PropertyValueFactory {
this.mediator = mediator;
}
- /**
- * Introspect the property
- * @param javaElement
- * @return
- */
- private DataType<?> introspect(JavaElementImpl javaElement) {
- DataType<XMLType> dt =
- new DataTypeImpl<XMLType>(null, javaElement.getType(), javaElement.getGenericType(), XMLType.UNKNOWN);
- mediator.getDataBindings().introspectType(dt, null);
- return dt;
- }
-
public ObjectFactory createValueFactory(Property property, Object propertyValue, JavaElementImpl javaElement) {
Document doc = (Document)propertyValue;
List<Node> nodes = getValues(doc);
@@ -131,24 +119,28 @@ public class JavaPropertyValueObjectFactory implements PropertyValueFactory {
sourceDataType =
new DataTypeImpl<XMLType>(DOMDataBinding.NAME, Node.class,
new XMLType(null, this.property.getXSDType()));
- TypeInfo typeInfo = null;
- if (this.property.getXSDType() != null) {
- if (simpleTypeMapper.isSimpleXSDType(this.property.getXSDType())) {
- typeInfo = new TypeInfo(property.getXSDType(), true, null);
+
+ targetDataType = property.getDataType();
+ if (targetDataType == null) {
+ TypeInfo typeInfo = null;
+ if (this.property.getXSDType() != null) {
+ if (simpleTypeMapper.isSimpleXSDType(this.property.getXSDType())) {
+ typeInfo = new TypeInfo(property.getXSDType(), true, null);
+ } else {
+ typeInfo = new TypeInfo(property.getXSDType(), false, null);
+ }
} else {
typeInfo = new TypeInfo(property.getXSDType(), false, null);
}
- } else {
- typeInfo = new TypeInfo(property.getXSDType(), false, null);
- }
- XMLType xmlType = new XMLType(typeInfo);
- String dataBinding = null; // (String)property.getExtensions().get(DataBinding.class.getName());
- if (dataBinding != null) {
- targetDataType = new DataTypeImpl<XMLType>(dataBinding, javaType, xmlType);
- } else {
- targetDataType = new DataTypeImpl<XMLType>(dataBinding, javaType, xmlType);
- mediator.getDataBindings().introspectType(targetDataType, null);
+ XMLType xmlType = new XMLType(typeInfo);
+ String dataBinding = null; // (String)property.getExtensions().get(DataBinding.class.getName());
+ if (dataBinding != null) {
+ targetDataType = new DataTypeImpl<XMLType>(dataBinding, javaType, xmlType);
+ } else {
+ targetDataType = new DataTypeImpl<XMLType>(dataBinding, javaType, xmlType);
+ mediator.getDataBindings().introspectType(targetDataType, null);
+ }
}
}
}