public KeyValueTokenBuilder() {
}
public Assertion build(Element element, AssertionBuilderFactory factory) {
SPConstants consts = MS_NS.equals(element.getNamespaceURI())
? SP11Constants.INSTANCE : SP12Constants.INSTANCE;
KeyValueToken token = new KeyValueToken(consts);
token.setOptional(PolicyConstants.isOptional(element));
token.setIgnorable(PolicyConstants.isIgnorable(element));
String attribute = element.getAttributeNS(element.getNamespaceURI(), SPConstants.ATTR_INCLUDE_TOKEN);
if (StringUtils.isEmpty(attribute)) {
attribute = element.getAttributeNS(consts.getNamespace(), SPConstants.ATTR_INCLUDE_TOKEN);
}
if (StringUtils.isEmpty(attribute)) {
attribute = element.getAttributeNS(SP11Constants.INSTANCE.getNamespace(),
SPConstants.ATTR_INCLUDE_TOKEN);
}
if (!StringUtils.isEmpty(attribute)) {
token.setInclusion(consts.getInclusionFromAttributeValue(attribute));
}
Element polEl = PolicyConstants.findPolicyElement(element);
if (polEl != null) {
Element child = DOMUtils.getFirstElement(polEl);