//mappedIntent.setName(getQName(reader, PROVIDES));
String defaultQualifier = getString(reader, DEFAULT);
String qualifierName = null;
String qualfiedIntentName = null;
Intent qualifiedIntent = 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);
qualfiedIntentName = mappedIntent.getName().getLocalPart() +
QUALIFIER + qualifierName;
qualifiedIntent = policyFactory.createIntent();
qualifiedIntent.setName(new QName(mappedIntent.getName().getNamespaceURI(),
qualfiedIntentName));
} else if ( POLICY_INTENT_MAP_QNAME.equals(name) ) {
QName providedIntent = getQName(reader, PROVIDES);
if ( qualifierName.equals(providedIntent.getLocalPart()) ) {
readIntentMap(reader, policySet, qualifiedIntent);
} else {
throw new ContributionReadException("Intent provided by IntentMap " +
providedIntent + " does not match parent qualifier " + qualifierName +
" in policyset - " + policySet);
}
}/* else if ( WS_POLICY_QNAME.equals(name) ) {
OMElement policyElement = loadElement(reader);
Policy wsPolicy = PolicyEngine.getPolicy(policyElement);
policySet.getPolicies().add(wsPolicy);
List<Object> policyList = mappedPolicies.get(qualifiedIntent);
if ( policyList == null ) {
policyList = new ArrayList<Object>();
mappedPolicies.put(qualifiedIntent, policyList);
if (qualifierName.equals(defaultQualifier)) {
mappedPolicies.put(mappedIntent, policyList);
}
}
policyList.add((Policy)wsPolicy);
}*/ else {
Object extension = extensionProcessor.read(reader);
if ( extension != null ) {
List<Object> policyList = mappedPolicies.get(qualifiedIntent);
if ( policyList == null ) {
policyList = new ArrayList<Object>();
mappedPolicies.put(qualifiedIntent, policyList);
if (qualifierName.equals(defaultQualifier)) {
mappedPolicies.put(mappedIntent, policyList);
}
}
policyList.add(extension);
}
}
break;
}
case END_ELEMENT : {
if ( POLICY_INTENT_MAP_QNAME.equals(reader.getName()) ) {
if ( defaultQualifier != null ) {
String qualifiedIntentName = mappedIntent.getName().getLocalPart() + QUALIFIER + defaultQualifier;
Intent defaultQualifiedIntent = policyFactory.createIntent();
defaultQualifiedIntent.setName(new QName(mappedIntent.getName().getNamespaceURI(),
qualifiedIntentName));
List<Object> policyList = mappedPolicies.get(defaultQualifiedIntent);
if ( policyList != null ) {
mappedPolicies.put(mappedIntent, policyList);
} else {