diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-10 10:10:58 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-10 10:10:58 +0000 |
commit | 1303bb654471a586be4049978daba5a8fe221d71 (patch) | |
tree | a47e003108e2498ecbf770ea8f15f9f85fa1fe41 /sca-java-1.x/branches/sca-java-1.5.2/modules/assembly-xml/src/main/java/org | |
parent | 5b3b3cf5da7c994092c1eb44fef2e142d1e744f1 (diff) |
TUSCANY-242 add URI specific processing wherever we read an anyURI attribute
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@921279 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-1.x/branches/sca-java-1.5.2/modules/assembly-xml/src/main/java/org')
2 files changed, 13 insertions, 8 deletions
diff --git a/sca-java-1.x/branches/sca-java-1.5.2/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java b/sca-java-1.x/branches/sca-java-1.5.2/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java index f34adbc581..36ef0e0d02 100644 --- a/sca-java-1.x/branches/sca-java-1.5.2/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java +++ b/sca-java-1.x/branches/sca-java-1.5.2/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java @@ -180,7 +180,7 @@ public class CompositeProcessor extends BaseAssemblyProcessor implements StAXArt // Read a <composite> composite = assemblyFactory.createComposite(); - composite.setName(new QName(getString(reader, TARGET_NAMESPACE), getString(reader, NAME))); + composite.setName(new QName(getURIString(reader, TARGET_NAMESPACE), getString(reader, NAME))); if(!isSet(reader, TARGET_NAMESPACE)){ // spec says that a composite must have a namespace @@ -227,7 +227,7 @@ public class CompositeProcessor extends BaseAssemblyProcessor implements StAXArt contract = compositeService; compositeService.setName(getString(reader, NAME)); - String promoted = getString(reader, PROMOTE); + String promoted = getURIString(reader, PROMOTE); if (promoted != null) { String promotedComponentName; String promotedServiceName; @@ -283,7 +283,7 @@ public class CompositeProcessor extends BaseAssemblyProcessor implements StAXArt compositeReference.setName(getString(reader, NAME)); readMultiplicity(compositeReference, reader); readTargets(compositeReference, reader); - String promote = reader.getAttributeValue(null, Constants.PROMOTE); + String promote = getString(reader, Constants.PROMOTE); if (promote != null) { for (StringTokenizer tokens = new StringTokenizer(promote); tokens.hasMoreTokens();) { ComponentReference promotedReference = @@ -337,7 +337,7 @@ public class CompositeProcessor extends BaseAssemblyProcessor implements StAXArt //throw ce; } } - componentProperty.setFile(getString(reader, FILE)); + componentProperty.setFile(getURIString(reader, FILE)); //handle extension attributes this.readExtendedAttributes(reader, componentProperty); @@ -380,7 +380,7 @@ public class CompositeProcessor extends BaseAssemblyProcessor implements StAXArt component.setAutowire(getBoolean(reader, AUTOWIRE)); } if (isSet(reader, URI)) { - component.setURI(getString(reader, URI)); + component.setURI(getURIString(reader, URI)); } //handle extension attributes @@ -396,12 +396,12 @@ public class CompositeProcessor extends BaseAssemblyProcessor implements StAXArt wire = assemblyFactory.createWire(); ComponentReference source = assemblyFactory.createComponentReference(); source.setUnresolved(true); - source.setName(getString(reader, SOURCE)); + source.setName(getURIString(reader, SOURCE)); wire.setSource(source); ComponentService target = assemblyFactory.createComponentService(); target.setUnresolved(true); - target.setName(getString(reader, TARGET)); + target.setName(getURIString(reader, TARGET)); wire.setTarget(target); //handle extension attributes diff --git a/sca-java-1.x/branches/sca-java-1.5.2/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/DefaultBeanModelProcessor.java b/sca-java-1.x/branches/sca-java-1.5.2/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/DefaultBeanModelProcessor.java index 467ed37638..1c5c5f8233 100644 --- a/sca-java-1.x/branches/sca-java-1.5.2/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/DefaultBeanModelProcessor.java +++ b/sca-java-1.x/branches/sca-java-1.5.2/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/DefaultBeanModelProcessor.java @@ -144,7 +144,12 @@ public class DefaultBeanModelProcessor<T> extends BaseAssemblyProcessor implemen String attributeName = reader.getAttributeLocalName(i); Method setter = setterMethods.get(attributeName); if (setter != null) { - String value = reader.getAttributeValue(i); + String value = null; + if (attributeName.equals("uri")){ + value = getURIString(reader, "uri"); + } else { + value = reader.getAttributeValue(i); + } setter.invoke(model, value); } } |