/** {@inheritDoc} */ protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException { RoleDescriptor roleDescriptor = (RoleDescriptor) samlObject; if (attribute.getLocalName().equals(RoleDescriptor.ID_ATTRIB_NAME)) { roleDescriptor.setID(attribute.getValue()); attribute.getOwnerElement().setIdAttributeNode(attribute, true); } else if (attribute.getLocalName().equals(TimeBoundSAMLObject.VALID_UNTIL_ATTRIB_NAME) && !DatatypeHelper.isEmpty(attribute.getValue())) { roleDescriptor.setValidUntil(new DateTime(attribute.getValue(), ISOChronology.getInstanceUTC())); } else if (attribute.getLocalName().equals(CacheableSAMLObject.CACHE_DURATION_ATTRIB_NAME)) { roleDescriptor.setCacheDuration(XMLHelper.durationToLong(attribute.getValue())); } else if (attribute.getLocalName().equals(RoleDescriptor.PROTOCOL_ENUMERATION_ATTRIB_NAME)) { StringTokenizer protocolTokenizer = new StringTokenizer(attribute.getValue(), " "); while (protocolTokenizer.hasMoreTokens()) { roleDescriptor.addSupportedProtocol(protocolTokenizer.nextToken()); } } else if (attribute.getLocalName().equals(RoleDescriptor.ERROR_URL_ATTRIB_NAME)) { roleDescriptor.setErrorURL(attribute.getValue()); } else { QName attribQName = XMLHelper.getNodeQName(attribute); if (attribute.isId()) { roleDescriptor.getUnknownAttributes().registerID(attribQName); } roleDescriptor.getUnknownAttributes().put(attribQName, attribute.getValue()); } } }
for (Entry<QName, String> entry : roleDescriptor.getUnknownAttributes().entrySet()) { attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), entry.getKey()); attribute.setValue(entry.getValue()); domElement.setAttributeNodeNS(attribute); if (Configuration.isIDAttribute(entry.getKey()) || roleDescriptor.getUnknownAttributes().isIDAttribute(entry.getKey())) { attribute.getOwnerElement().setIdAttributeNode(attribute, true);