diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-10-09 17:59:57 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-10-09 17:59:57 +0000 |
commit | e2a82e1954ef1ac97c26d4f6bca4184494b541b9 (patch) | |
tree | e09045556ef5d683911c6476fa052c64ac1d6c56 /java/sca/modules/builder | |
parent | 2c4fb4511421e0e82c46f0e3297b2faf6a40418e (diff) |
TUSCANY-3258 raise an error when a component property type doesn't match the component type property type. This may need to be looked at further if we decide to consider if the types are compatible.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@823643 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/builder')
-rw-r--r-- | java/sca/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentBuilderImpl.java | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/java/sca/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentBuilderImpl.java b/java/sca/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentBuilderImpl.java index 76d5a850d1..971a64c91b 100644 --- a/java/sca/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentBuilderImpl.java +++ b/java/sca/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentBuilderImpl.java @@ -568,8 +568,6 @@ public class ComponentBuilderImpl { componentTypeProperty.setValue(componentProperty.getValue()); } - - // Check that a component property does not override the // many attribute if (!componentTypeProperty.isMany() && componentProperty.isMany()) { @@ -601,6 +599,31 @@ public class ComponentBuilderImpl { component.getName(), componentProperty.getName()); } + + // check that the types specified in the component type and component property match + if ( componentProperty.getXSDElement() != null && + !componentProperty.getXSDElement().equals(componentTypeProperty.getXSDElement())){ + Monitor.error(monitor, + this, + Messages.ASSEMBLY_VALIDATION, + "PropertXSDElementsDontMatch", + component.getName(), + componentProperty.getName(), + componentProperty.getXSDElement().toString(), + componentTypeProperty.getXSDElement().toString()); + } + + if ( componentProperty.getXSDType() != null && + !componentProperty.getXSDType().equals(componentTypeProperty.getXSDType())){ + Monitor.error(monitor, + this, + Messages.ASSEMBLY_VALIDATION, + "PropertXSDTypesDontMatch", + component.getName(), + componentProperty.getName(), + componentProperty.getXSDType().toString(), + componentTypeProperty.getXSDType().toString()); + } } } |