return new PolicyReference(attribute.getAttributeValue());
}
private PrimitiveAssertion readPrimitiveAssertion(OMElement element) {
QName qname = element.getQName();
PrimitiveAssertion result = new PrimitiveAssertion(qname);
result.setAttributes(getAttributes(element));
String isOptional = result.getAttribute(new QName(
PolicyConstants.WS_POLICY_NAMESPACE_URI, "Optional"));
result.setOptional(new Boolean(isOptional).booleanValue());
// setting the text value ..
String strValue = element.getText();
if (strValue != null && strValue.length() != 0) {
result.setStrValue(strValue.trim());
}
//CHECK ME
Iterator childElements = element.getChildElements();
while (childElements.hasNext()) {
OMElement childElement = (OMElement) childElements.next();
if (childElement.getNamespace().getName().equals(
PolicyConstants.WS_POLICY_NAMESPACE_URI)
&& childElement.getLocalName().equals(
PolicyConstants.WS_POLICY)) {
Policy policy = readPolicy(childElement);
result.addTerm(policy);
} else {
PrimitiveAssertion pa = readPrimitiveAssertion(childElement);
result.addTerm(pa);
}
}
return result;
}