tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsdelf...@apache.org
Subject svn commit: r524562 - in /incubator/tuscany/java/sca/scdl4j/stax/src/main/java/org/apache/tuscany/scdl/stax/impl: BaseLoader.java ComponentTypeLoader.java CompositeLoader.java ConstrainingTypeLoader.java
Date Sun, 01 Apr 2007 09:04:42 GMT
Author: jsdelfino
Date: Sun Apr  1 02:04:41 2007
New Revision: 524562

URL: http://svn.apache.org/viewvc?view=rev&rev=524562
Log:
Fixed support for multiplicity on references

Modified:
    incubator/tuscany/java/sca/scdl4j/stax/src/main/java/org/apache/tuscany/scdl/stax/impl/BaseLoader.java
    incubator/tuscany/java/sca/scdl4j/stax/src/main/java/org/apache/tuscany/scdl/stax/impl/ComponentTypeLoader.java
    incubator/tuscany/java/sca/scdl4j/stax/src/main/java/org/apache/tuscany/scdl/stax/impl/CompositeLoader.java
    incubator/tuscany/java/sca/scdl4j/stax/src/main/java/org/apache/tuscany/scdl/stax/impl/ConstrainingTypeLoader.java

Modified: incubator/tuscany/java/sca/scdl4j/stax/src/main/java/org/apache/tuscany/scdl/stax/impl/BaseLoader.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/stax/src/main/java/org/apache/tuscany/scdl/stax/impl/BaseLoader.java?view=diff&rev=524562&r1=524561&r2=524562
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/stax/src/main/java/org/apache/tuscany/scdl/stax/impl/BaseLoader.java
(original)
+++ incubator/tuscany/java/sca/scdl4j/stax/src/main/java/org/apache/tuscany/scdl/stax/impl/BaseLoader.java
Sun Apr  1 02:04:41 2007
@@ -30,8 +30,10 @@
 import javax.xml.stream.XMLStreamReader;
 
 import org.apache.tuscany.assembly.model.AbstractProperty;
+import org.apache.tuscany.assembly.model.AbstractReference;
 import org.apache.tuscany.assembly.model.AssemblyFactory;
 import org.apache.tuscany.assembly.model.ConstrainingType;
+import org.apache.tuscany.assembly.model.Multiplicity;
 import org.apache.tuscany.assembly.model.Property;
 import org.apache.tuscany.policy.model.Intent;
 import org.apache.tuscany.policy.model.IntentAttachPoint;
@@ -124,6 +126,17 @@
 
     protected void readPolicies(PolicySetAttachPoint attachPoint, XMLStreamReader reader)
{
     	readPolicies(attachPoint, null, reader);
+    }
+    
+    protected void readMultiplicity(AbstractReference reference, XMLStreamReader reader)
{
+        String value = reader.getAttributeValue(null, MULTIPLICITY);
+        if (ZERO_ONE.equals(value)) {
+            reference.setMultiplicity(Multiplicity.ZERO_ONE);
+        } else if (ONE_N.equals(value)) {
+            reference.setMultiplicity(Multiplicity.ONE_N);
+        } else if (ZERO_N.equals(value)) {
+            reference.setMultiplicity(Multiplicity.ZERO_N);
+        }
     }
 
     protected void readPolicies(PolicySetAttachPoint attachPoint, Operation operation, XMLStreamReader
reader) {

Modified: incubator/tuscany/java/sca/scdl4j/stax/src/main/java/org/apache/tuscany/scdl/stax/impl/ComponentTypeLoader.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/stax/src/main/java/org/apache/tuscany/scdl/stax/impl/ComponentTypeLoader.java?view=diff&rev=524562&r1=524561&r2=524562
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/stax/src/main/java/org/apache/tuscany/scdl/stax/impl/ComponentTypeLoader.java
(original)
+++ incubator/tuscany/java/sca/scdl4j/stax/src/main/java/org/apache/tuscany/scdl/stax/impl/ComponentTypeLoader.java
Sun Apr  1 02:04:41 2007
@@ -102,6 +102,7 @@
                         reference = factory.createReference();
                         contract = reference;
                         reference.setName(getString(reader, Constants.NAME));
+                        readMultiplicity(reference, reader);
 
                         // TODO support multivalued attribute
                         ComponentService target = factory.createComponentService();

Modified: incubator/tuscany/java/sca/scdl4j/stax/src/main/java/org/apache/tuscany/scdl/stax/impl/CompositeLoader.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/stax/src/main/java/org/apache/tuscany/scdl/stax/impl/CompositeLoader.java?view=diff&rev=524562&r1=524561&r2=524562
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/stax/src/main/java/org/apache/tuscany/scdl/stax/impl/CompositeLoader.java
(original)
+++ incubator/tuscany/java/sca/scdl4j/stax/src/main/java/org/apache/tuscany/scdl/stax/impl/CompositeLoader.java
Sun Apr  1 02:04:41 2007
@@ -139,6 +139,7 @@
                             componentReference = factory.createComponentReference();
                             contract = componentReference;
                             componentReference.setName(getString(reader, NAME));
+                            readMultiplicity(componentReference, reader);
 
                             // TODO support multivalued attribute
                             ComponentService target = factory.createComponentService();
@@ -154,6 +155,7 @@
                             compositeReference = factory.createCompositeReference();
                             contract = compositeReference;
                             compositeReference.setName(getString(reader, NAME));
+                            readMultiplicity(compositeReference, reader);
 
                             // TODO support multivalued attribute
                             ComponentReference promoted = factory.createComponentReference();

Modified: incubator/tuscany/java/sca/scdl4j/stax/src/main/java/org/apache/tuscany/scdl/stax/impl/ConstrainingTypeLoader.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/stax/src/main/java/org/apache/tuscany/scdl/stax/impl/ConstrainingTypeLoader.java?view=diff&rev=524562&r1=524561&r2=524562
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/stax/src/main/java/org/apache/tuscany/scdl/stax/impl/ConstrainingTypeLoader.java
(original)
+++ incubator/tuscany/java/sca/scdl4j/stax/src/main/java/org/apache/tuscany/scdl/stax/impl/ConstrainingTypeLoader.java
Sun Apr  1 02:04:41 2007
@@ -97,6 +97,7 @@
                         abstractReference = factory.createAbstractReference();
                         abstractContract = abstractReference;
                         abstractReference.setName(getString(reader, Constants.NAME));
+                        readMultiplicity(abstractReference, reader);
                         constrainingType.getReferences().add(abstractReference);
                         readIntents(abstractReference, reader);
 



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message