throws ContributionReadException {
Monitor monitor = context.getMonitor();
QName name = reader.getName();
if (POLICY_INTENT_MAP_QNAME.equals(name)) {
IntentMap intentMap = policyFactory.createIntentMap();
QName intentName = getQName(reader, INTENT_MAP);
intentMap.setProvidedIntent(mappedIntent);
if (!policySet.getIntentMaps().contains(intentMap)) {
policySet.getIntentMaps().add(intentMap);
} else {
Monitor.error(context.getMonitor(), this, Messages.RESOURCE_BUNDLE, "IntentMapIsNotUnique", policySet
.getName().toString(), mappedIntent.getName().getLocalPart());
}
String qualifierName = null;
String qualfiedIntentName = null;
Intent qualifiedIntent = null;
Qualifier qualifier = null;
int event = reader.getEventType();
try {
reader.next();
while (reader.hasNext()) {
event = reader.getEventType();
switch (event) {
case START_ELEMENT: {
name = reader.getName();
if (POLICY_INTENT_MAP_QUALIFIER_QNAME.equals(name)) {
qualifierName = getString(reader, NAME);
if (qualifierName != null) {
qualfiedIntentName =
mappedIntent.getName().getLocalPart() + QUALIFIER + qualifierName;
qualifiedIntent = policyFactory.createIntent();
qualifiedIntent.setName(new QName(mappedIntent.getName().getNamespaceURI(),
qualfiedIntentName));
qualifier = policyFactory.createQualifier();
qualifier.setIntent(qualifiedIntent);
intentMap.getQualifiers().add(qualifier);
} else {
error(monitor, "QualifierNameMissing", reader, policySet.getName());
}
} else if (POLICY_INTENT_MAP_QNAME.equals(name)) {