[java-opensaml COMMIT] in /trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2: core/impl/AttributeMarshal...

noreply at shibboleth.net noreply at shibboleth.net
Wed Jun 6 17:03:06 BST 2012


Author: rdw
Date: Wed Jun  6 17:03:06 2012
New Revision: 3057

URL: http://svn.shibboleth.net/view/java-opensaml?rev=3057&view=rev
Log:
Handle unknown attributes during marshalling/unmarshalling using helper methods.

Modified:
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AttributeMarshaller.java
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AttributeUnmarshaller.java
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectConfirmationDataMarshaller.java
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectConfirmationDataUnmarshaller.java
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AffiliationDescriptorMarshaller.java
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AffiliationDescriptorUnmarshaller.java
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/ContactPersonMarshaller.java
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/ContactPersonUnmarshaller.java
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EndpointMarshaller.java
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EndpointUnmarshaller.java
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EntityDescriptorMarshaller.java
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EntityDescriptorUnmarshaller.java
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/OrganizationMarshaller.java
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/OrganizationUnmarshaller.java
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/RoleDescriptorMarshaller.java
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/RoleDescriptorUnmarshaller.java

Modified: trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AttributeMarshaller.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AttributeMarshaller.java?rev=3057&r1=3056&r2=3057&view=diff
==============================================================================
--- trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AttributeMarshaller.java (original)
+++ trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AttributeMarshaller.java Wed Jun  6 17:03:06 2012
@@ -17,18 +17,10 @@
 
 package org.opensaml.saml.saml2.core.impl;
 
-import java.util.Map.Entry;
-
-import javax.xml.namespace.QName;
-
-import net.shibboleth.utilities.java.support.xml.AttributeSupport;
-
 import org.opensaml.core.xml.XMLObject;
-import org.opensaml.core.xml.config.XMLObjectProviderRegistrySupport;
 import org.opensaml.core.xml.io.MarshallingException;
 import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
 import org.opensaml.saml.saml2.core.Attribute;
-import org.w3c.dom.Attr;
 import org.w3c.dom.Element;
 
 /**
@@ -52,15 +44,6 @@
             domElement.setAttributeNS(null, Attribute.FRIENDLY_NAME_ATTRIB_NAME, attribute.getFriendlyName());
         }
 
-        Attr attr;
-        for (Entry<QName, String> entry : attribute.getUnknownAttributes().entrySet()) {
-            attr = AttributeSupport.constructAttribute(domElement.getOwnerDocument(), entry.getKey());
-            attr.setValue(entry.getValue());
-            domElement.setAttributeNodeNS(attr);
-            if (XMLObjectProviderRegistrySupport.isIDAttribute(entry.getKey())
-                    || attribute.getUnknownAttributes().isIDAttribute(entry.getKey())) {
-                attr.getOwnerElement().setIdAttributeNode(attr, true);
-            }
-        }
+        marshallUnknownAttributes(attribute, domElement);
     }
 }

Modified: trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AttributeUnmarshaller.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AttributeUnmarshaller.java?rev=3057&r1=3056&r2=3057&view=diff
==============================================================================
--- trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AttributeUnmarshaller.java (original)
+++ trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AttributeUnmarshaller.java Wed Jun  6 17:03:06 2012
@@ -18,8 +18,6 @@
 package org.opensaml.saml.saml2.core.impl;
 
 import javax.xml.namespace.QName;
-
-import net.shibboleth.utilities.java.support.xml.QNameSupport;
 
 import org.opensaml.core.xml.XMLObject;
 import org.opensaml.core.xml.io.UnmarshallingException;
@@ -60,11 +58,7 @@
         } else if (attribute.getLocalName().equals(Attribute.FRIENDLY_NAME_ATTRIB_NAME)) {
             attrib.setFriendlyName(attribute.getValue());
         } else {
-            QName attribQName = QNameSupport.getNodeQName(attribute);

[... 484 lines stripped ...]


More information about the commits mailing list