*/
public class AttributeMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject samlElement, Element domElement) throws MarshallingException {
Attribute attribute = (Attribute) samlElement;
if (attribute.getName() != null) {
domElement.setAttributeNS(null, Attribute.NAME_ATTTRIB_NAME, attribute.getName());
}
if (attribute.getNameFormat() != null) {
domElement.setAttributeNS(null, Attribute.NAME_FORMAT_ATTRIB_NAME, attribute.getNameFormat());
}
if (attribute.getFriendlyName() != null) {
domElement.setAttributeNS(null, Attribute.FRIENDLY_NAME_ATTRIB_NAME, attribute.getFriendlyName());
}
Attr attr;
for (Entry<QName, String> entry : attribute.getUnknownAttributes().entrySet()) {
attr = XMLHelper.constructAttribute(domElement.getOwnerDocument(), entry.getKey());
attr.setValue(entry.getValue());
domElement.setAttributeNodeNS(attr);
if (Configuration.isIDAttribute(entry.getKey())
|| attribute.getUnknownAttributes().isIDAttribute(entry.getKey())) {
attr.getOwnerElement().setIdAttributeNode(attr, true);
}
}
}