summaryrefslogtreecommitdiffstats
path: root/java/sca
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/IntentProcessor.java15
-rw-r--r--java/sca/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/policy/xml/policy-xml-validation-messages.properties2
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