}
private PrimitiveAssertion readPrimitiveAssertion(Element element) {
QName qname = new QName(element.getNamespaceURI(), element
.getLocalName(), element.getPrefix());
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());
//CHECK ME
NodeList list = element.getChildNodes();
int length = list.getLength();
for (int i = 0; i < length; i++) {
Node node = list.item(i);
short nodeType = node.getNodeType();
if (nodeType == Node.ELEMENT_NODE) {
Element childElement = (Element) node;
if (childElement.getNamespaceURI().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);
}
} else if (nodeType == Node.TEXT_NODE) {
String strValue = node.getNodeValue();