diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-11 15:52:19 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-11 15:52:19 +0000 |
commit | c69b3dd7c546a77d2252e8bb8618e543b9703a64 (patch) | |
tree | 72e8ff63ef5c7daf7c2ca3001c92fef479ac2107 /java/sca/modules/assembly-xml | |
parent | 0af9a260aa2d589bbd84f8d86e1fb29c3ce5f157 (diff) |
Check that a profile intent doesn't have "." in its name - POL_3006
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@834925 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
2 files changed, 14 insertions, 3 deletions
diff --git a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/IntentProcessor.java b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/IntentProcessor.java index 12767ed55c..5db05a2cc7 100644 --- a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/IntentProcessor.java +++ b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/IntentProcessor.java @@ -121,7 +121,7 @@ public class IntentProcessor extends BaseStAXArtifactProcessor implements StAXAr intent.setName(new QName(intentLocalName)); intent.setType(Type.valueOf(intentType)); - readRequiredIntents(intent, reader); + readRequiredIntents(intent, reader, context); readExcludedIntents(intent, reader); readConstrainedTypes(intent, reader); @@ -352,7 +352,7 @@ public class IntentProcessor extends BaseStAXArtifactProcessor implements StAXAr } } - private void readRequiredIntents(Intent intent, XMLStreamReader reader) { + private void readRequiredIntents(Intent intent, XMLStreamReader reader, ProcessorContext context) { String value = reader.getAttributeValue(null, REQUIRES); if (value != null) { List<Intent> requiredIntents = intent.getRequiredIntents(); @@ -363,6 +363,17 @@ public class IntentProcessor extends BaseStAXArtifactProcessor implements StAXAr required.setUnresolved(true); requiredIntents.add(required); } + + // Check that a profile intent does not have "." in its name + if (requiredIntents.size() > 0) { + if (intent.getName().getLocalPart().contains(".")){ + Monitor.error(context.getMonitor(), + this, + Messages.RESOURCE_BUNDLE, + "ProfileIntentNameWithPeriod", + intent.getName().toString()); + } + } } } diff --git a/java/sca/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/policy/xml/policy-xml-validation-messages.properties b/java/sca/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/policy/xml/policy-xml-validation-messages.properties index 105158b986..c889ce9447 100644 --- a/java/sca/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/policy/xml/policy-xml-validation-messages.properties +++ b/java/sca/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/policy/xml/policy-xml-validation-messages.properties @@ -44,4 +44,4 @@ QualifierNameMissing = Required attribute "name" missing for qualifier definitio ConstrainedTypeNotFound = Unable to find the extension type {0} constrained by intent: {1} MultipleDefaultQualifiers = [POL30004] Intent {0} has more than one qualifier marked as the default qualifier QualifierIsNotUnique = [POL30005] The intent {0} has more than one qualifier with the name {1} - +ProfileIntentNameWithPeriod = [POL30006] The profile intent name {0} must not have the character "." in it |