[java-opensaml COMMIT] in /trunk: opensaml-core/src/main/java/org/opensaml/core/xml/AbstractXMLObject.java opensaml-c...

noreply at shibboleth.net noreply at shibboleth.net
Fri Apr 20 00:02:42 BST 2012


Author: putmanb
Date: Fri Apr 20 00:02:42 2012
New Revision: 3041

URL: http://svn.shibboleth.net/view/java-opensaml?rev=3041&view=rev
Log:
Remove deprecated methods on XMLObject related to adding and removing Namespaces, in favor of NamespaceManger.
Remove deprecated methods on Namespace related to 'alwaysDeclare' property, in favor of NamespaceManager.
Remove prefix and URI setters on Namespace. They aren't used anywhere, and having the Namespace be mutable is problematic in a few places.  This helps simply a bunch of other code.

Modified:
    trunk/opensaml-core/src/main/java/org/opensaml/core/xml/AbstractXMLObject.java
    trunk/opensaml-core/src/main/java/org/opensaml/core/xml/Namespace.java
    trunk/opensaml-core/src/main/java/org/opensaml/core/xml/NamespaceManager.java
    trunk/opensaml-core/src/main/java/org/opensaml/core/xml/XMLObject.java
    trunk/opensaml-core/src/main/java/org/opensaml/core/xml/io/AbstractXMLObjectMarshaller.java
    trunk/opensaml-core/src/main/java/org/opensaml/core/xml/io/AbstractXMLObjectUnmarshaller.java
    trunk/opensaml-core/src/test/java/org/opensaml/core/xml/NamespaceManagerTest.java
    trunk/opensaml-core/src/test/java/org/opensaml/core/xml/util/AttributeMapTest.java
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/provider/ChainingMetadataProvider.java

Modified: trunk/opensaml-core/src/main/java/org/opensaml/core/xml/AbstractXMLObject.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-core/src/main/java/org/opensaml/core/xml/AbstractXMLObject.java?rev=3041&r1=3040&r2=3041&view=diff
==============================================================================
--- trunk/opensaml-core/src/main/java/org/opensaml/core/xml/AbstractXMLObject.java (original)
+++ trunk/opensaml-core/src/main/java/org/opensaml/core/xml/AbstractXMLObject.java Fri Apr 20 00:02:42 2012
@@ -17,7 +17,6 @@
 
 package org.opensaml.core.xml;
 
-import java.util.Collections;
 import java.util.List;
 import java.util.Set;
 
@@ -88,11 +87,6 @@
             setElementNamespacePrefix(namespacePrefix);
         }
     }
-    
-    /** {@inheritDoc} */
-    public void addNamespace(Namespace newNamespace) {
-        getNamespaceManager().registerNamespace(newNamespace);
-    }
 
     /** {@inheritDoc} */
     public void detach(){
@@ -122,7 +116,7 @@
 
     /** {@inheritDoc} */
     public Set<Namespace> getNamespaces() {
-        return Collections.unmodifiableSet(getNamespaceManager().getNamespaces());
+        return getNamespaceManager().getNamespaces();
     }
 
     /** {@inheritDoc} */
@@ -173,42 +167,6 @@
         } else {
             getNamespaceManager().deregisterAttributeName(attributeName);
         }
-    }
-
-    /**
-     * A helper function for derived classes. This checks for semantic equality between two QNames if it they are
-     * different invalidates the DOM. It returns the normalized value so subclasses just have to go. this.foo =
-     * prepareForAssignment(this.foo, foo);
-     * 
-     * @param oldValue - the current value
-     * @param newValue - the new value
-     * 
-     * @return the value that should be assigned
-     * 
-     * @deprecated replacement {@link #prepareAttributeValueForAssignment(String, QName, QName)} 
-     *                or {@link #prepareElementContentForAssignment(QName, QName)} as appropriate
-     */
-    protected QName prepareForAssignment(QName oldValue, QName newValue) {
-        if (oldValue == null) {
-            if (newValue != null) {
-                Namespace newNamespace = new Namespace(newValue.getNamespaceURI(), newValue.getPrefix());
-                addNamespace(newNamespace);
-                releaseThisandParentDOM();
-                return newValue;
-            } else {
-                return null;
-            }
-        }
-
-        if (!oldValue.equals(newValue)) {
-            if (newValue != null) {
-                Namespace newNamespace = new Namespace(newValue.getNamespaceURI(), newValue.getPrefix());
-                addNamespace(newNamespace);
-            }
-            releaseThisandParentDOM();
-        }
-
-        return newValue;
     }
     
     /**
@@ -460,11 +418,6 @@
     }
 
     /** {@inheritDoc} */
-    public void removeNamespace(Namespace namespace) {
-        getNamespaceManager().deregisterNamespace(namespace);
-    }
-
-    /** {@inheritDoc} */
     public XMLObject resolveID(String id) {
         return idIndex.lookup(id);
     }

Modified: trunk/opensaml-core/src/main/java/org/opensaml/core/xml/Namespace.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-core/src/main/java/org/opensaml/core/xml/Namespace.java?rev=3041&r1=3040&r2=3041&view=diff
==============================================================================
--- trunk/opensaml-core/src/main/java/org/opensaml/core/xml/Namespace.java (original)
+++ trunk/opensaml-core/src/main/java/org/opensaml/core/xml/Namespace.java Fri Apr 20 00:02:42 2012
@@ -31,16 +31,8 @@
     /** Prefix of the namespace. */
     private String namespacePrefix;
 

[... 667 lines stripped ...]


More information about the commits mailing list