axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chinth...@apache.org
Subject svn commit: r111692 - in webservices/axis/trunk/java/dev/scratch/prototype2/src: java/org/apache/axis/client java/org/apache/axis/engine java/org/apache/axis/impl/handlers java/org/apache/axis/impl/llom java/org/apache/axis/impl/llom/builder java/org/apache/axis/impl/llom/serialize java/org/apache/axis/impl/llom/wrapper java/org/apache/axis/om test/org/apache/axis/engine test/org/apache/axis/om
Date Mon, 13 Dec 2004 06:48:14 GMT
Author: chinthaka
Date: Sun Dec 12 22:48:13 2004
New Revision: 111692

URL: http://svn.apache.org/viewcvs?view=rev&rev=111692
Log:
Changed the API of Namespace as dicussed in the mailing list
Modified:
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/client/Call.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/Constants.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/handlers/OpNameFinder.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMElementImpl.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMNamedNodeImpl.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMNamespaceImpl.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/ObjectToOMBuilder.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/StAXBuilder.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/StAXOMBuilder.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/StAXSOAPModelBuilder.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/serialize/SimpleOMSerializer.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/wrapper/OMStAXWrapper.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMElement.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMNamedNode.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMNamespace.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EngineUtils.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/om/OMTest.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/om/OMTestUtils.java

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/client/Call.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/client/Call.java?view=diff&rev=111692&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/client/Call.java&r1=111691&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/client/Call.java&r2=111692
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/client/Call.java
(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/client/Call.java
Sun Dec 12 22:48:13 2004
@@ -90,7 +90,7 @@
                     OMElement element = (OMElement) child;
                     OMNamespace ns = element.getNamespace();
                     if (OMConstants.SOAPFAULT_LOCAL_NAME.equals(element.getLocalName())
-                            && OMConstants.SOAPFAULT_NAMESPACE_URI.equals(ns.getValue()))
{
+                            && OMConstants.SOAPFAULT_NAMESPACE_URI.equals(ns.getName()))
{
                         Iterator it = element.getChildren();
                         String error = null;
                         while (it.hasNext()) {

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/Constants.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/Constants.java?view=diff&rev=111692&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/Constants.java&r1=111691&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/Constants.java&r2=111692
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/Constants.java
(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/Constants.java
Sun Dec 12 22:48:13 2004
@@ -194,7 +194,7 @@
 //     * @param localPart is the local part of the attribute name
 //     * @return the value of the attribute or null
 //     */
-//    public static String getValue(Attributes attributes,
+//    public static String getName(Attributes attributes,
 //                                  String [] search,
 //                                  String localPart) {
 //        if (attributes == null || attributes.getLength() == 0 || search == null || localPart
== null)
@@ -206,7 +206,7 @@
 //            if (attributes.getLocalName(i).equals(localPart)) {
 //                String uri = attributes.getURI(i);
 //                for (int j=0; j<search.length; j++) {
-//                    if (search[j].equals(uri)) return attributes.getValue(i);
+//                    if (search[j].equals(uri)) return attributes.getName(i);
 //                }
 //            }
 //        }
@@ -222,7 +222,7 @@
 //     * @param search
 //     * @return the value of the attribute
 //     */
-//    public static String getValue(Attributes attributes,
+//    public static String getName(Attributes attributes,
 //                                  QName [] search) {
 //        if (attributes == null || search == null)
 //            return null;
@@ -231,7 +231,7 @@
 //
 //        String value = null;
 //        for (int i=0; (value == null) && (i < search.length); i++) {
-//            value = attributes.getValue(search[i].getNamespaceURI(),
+//            value = attributes.getName(search[i].getNamespaceURI(),
 //                                        search[i].getLocalPart());
 //        }
 //

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/handlers/OpNameFinder.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/handlers/OpNameFinder.java?view=diff&rev=111692&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/handlers/OpNameFinder.java&r1=111691&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/handlers/OpNameFinder.java&r2=111692
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/handlers/OpNameFinder.java
(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/handlers/OpNameFinder.java
Sun Dec 12 22:48:13 2004
@@ -45,7 +45,7 @@
                         OMNamespace omns = bodyChild.getNamespace();
 
                         if (omns != null) {
-                            String ns = omns.getValue();
+                            String ns = omns.getName();
                             if (ns != null) {
                                 QName opName = new QName(ns, bodyChild.getLocalName());
                                 AxisService service = msgContext.getService();

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMElementImpl.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMElementImpl.java?view=diff&rev=111692&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMElementImpl.java&r1=111691&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMElementImpl.java&r2=111692
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMElementImpl.java
(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMElementImpl.java
Sun Dec 12 22:48:13 2004
@@ -5,7 +5,9 @@
 import org.apache.axis.om.*;
 
 import javax.xml.namespace.QName;
+import java.util.ArrayList;
 import java.util.Iterator;
+import java.util.ListIterator;
 
 
 /**
@@ -32,7 +34,7 @@
     private OMNode firstChild;
     private OMXMLParserWrapper builder;
     private OMAttributeImpl firstAttribute;
-    private OMNamespace firstNamespace;
+    private ArrayList namespaces;
 
     public OMElementImpl(OMElement parent) {
         super(parent);
@@ -49,7 +51,6 @@
     public OMElementImpl(String localName, OMNamespace ns, OMElement parent, OMXMLParserWrapper
builder) {
         super(localName, ns, parent);
         this.builder = builder;
-
     }
 
     /**
@@ -109,6 +110,7 @@
         return new OMChildrenIterator(getFirstChild());
     }
 
+    // --------------------- Namespace Methods ------------------------------------------------------------
     /**
      * THis will create a namespace in the current element scope
      *
@@ -116,10 +118,16 @@
      * @param prefix
      * @return
      */
-    public OMNamespace createNamespace(String uri, String prefix) {
+    public OMNamespace declareNamespace(String uri, String prefix) {
+
+        if (namespaces == null) {
+            namespaces = new ArrayList(5);
+            // the default size of the ArrayList is 10. But I think this is too much as on
average number of namespaces is
+            // much more than 10. So I selected 5. Hope this is ok as an initial value. --
Eran Chinthaka 13/12/2004
+
+        }
         OMNamespaceImpl ns = new OMNamespaceImpl(uri, prefix);
-        ns.setNextSibling(firstNamespace);
-        firstNamespace = ns;
+        namespaces.add(ns);
         return ns;
     }
 
@@ -127,9 +135,14 @@
      * @param namespace
      * @return
      */
-    public OMNamespace createNamespace(OMNamespace namespace) {
-        namespace.setNextSibling(firstNamespace);
-        firstNamespace = namespace;
+    public OMNamespace declareNamespace(OMNamespace namespace) {
+        if (namespaces == null) {
+            namespaces = new ArrayList(5);
+            // the default size of the ArrayList is 10. But I think this is too much as on
average number of namespaces is
+            // much more than 10. So I selected 5. Hope this is ok as an initial value. --
Eran Chinthaka 13/12/2004
+
+        }
+        namespaces.add(namespace);
         return namespace;
     }
 
@@ -143,17 +156,49 @@
      * @return
      * @throws org.apache.axis.om.OMException
      */
-    public OMNamespace resolveNamespace(String uri, String prefix) throws OMException {
-        OMNamespace ns = firstNamespace;
-        while (ns != null) {
-            if (ns.equals(uri, prefix))
-                return ns;
-            ns = (OMNamespace) ns.getNextSibling();
+    public OMNamespace findInScopeNamespace(String uri, String prefix) throws OMException
{
+
+        // check in the current element
+        OMNamespace namespace = findDeclaredNamespace(uri,prefix);
+        if(namespace != null){
+            return namespace;
         }
+
+        // go up to check with ancestors
         if (parent != null)
-            return parent.resolveNamespace(uri, prefix);
+            return parent.findInScopeNamespace(uri, prefix);
         return null;
     }
+
+    /**
+     * This will ckeck for the namespace <B>only</B> in the current Element
+     * @param uri
+     * @param prefix
+     * @return
+     * @throws OMException
+     */
+    public OMNamespace findDeclaredNamespace(String uri, String prefix) throws OMException
{
+
+        if(namespaces == null){
+            return null;
+        }
+        // check in the current element
+        ListIterator namespaceListIterator = namespaces.listIterator();
+        while (namespaceListIterator.hasNext()) {
+            OMNamespace omNamespace = (OMNamespace) namespaceListIterator.next();
+            if (omNamespace.equals(uri, prefix)) {
+                return omNamespace;
+            }
+        }
+
+        return null;
+    }
+
+    public ArrayList getAllDeclaredNamespaces(){
+        return namespaces;
+    }
+
+    // ---------------------------------------------------------------------------------------------------------------
 
     /**
      * This will help to search for an attribute with a given QName within this Element

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMNamedNodeImpl.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMNamedNodeImpl.java?view=diff&rev=111692&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMNamedNodeImpl.java&r1=111691&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMNamedNodeImpl.java&r2=111692
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMNamedNodeImpl.java
(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMNamedNodeImpl.java
Sun Dec 12 22:48:13 2004
@@ -56,6 +56,10 @@
         return ns;
     }
 
+    public String getNamespaceName() {
+        return ns.getName();
+    }
+
     /**
      * @param namespace
      */
@@ -65,7 +69,7 @@
 
 
     public QName getQName() {
-        QName qName = new QName(ns.getValue(), localName, ns.getPrefix());
+        QName qName = new QName(ns.getName(), localName, ns.getPrefix());
         return qName;
     }
 

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMNamespaceImpl.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMNamespaceImpl.java?view=diff&rev=111692&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMNamespaceImpl.java&r1=111691&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMNamespaceImpl.java&r2=111692
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMNamespaceImpl.java
(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMNamespaceImpl.java
Sun Dec 12 22:48:13 2004
@@ -1,8 +1,6 @@
 package org.apache.axis.impl.llom;
 
-import org.apache.axis.om.OMException;
 import org.apache.axis.om.OMNamespace;
-import org.apache.axis.om.OMNode;
 
 /**
  * Copyright 2001-2004 The Apache Software Foundation.
@@ -23,8 +21,9 @@
  * Date: Oct 6, 2004
  * Time: 11:43:32 AM
  */
-public class OMNamespaceImpl extends OMNodeImpl implements OMNamespace {
+public class OMNamespaceImpl implements OMNamespace {
     private String prefix;
+    private String uri;
     //private String value;
 
     /**
@@ -32,31 +31,24 @@
      * @param prefix
      */
     public OMNamespaceImpl(String uri, String prefix) {
-        value = uri;
+        this.uri = uri;
         this.prefix = prefix;
     }
 
 
-    public boolean equals(OMNamespace ns) {
-        return ((prefix == null && ns.getPrefix() == null) || (prefix != null &&
prefix.equals(ns.getPrefix())))
-                && value.equals(ns.getValue());
-    }
-
     public boolean equals(String uri, String prefix) {
         return ((prefix == null && this.prefix == null) || (prefix != null &&
prefix.equals(this.prefix)))
-                && value.equals(uri);
+                && uri.equals(uri);
     }
 
 
-    public boolean isDefaultNs() {
-        return prefix == null;
-    }
-
     public String getPrefix() {
         return prefix;
     }
 
-    public OMNode getNextSibling() throws OMException {
-        return nextSibling;
+    public String getName() {
+        return uri;
     }
+
+
 }

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/ObjectToOMBuilder.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/ObjectToOMBuilder.java?view=diff&rev=111692&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/ObjectToOMBuilder.java&r1=111691&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/ObjectToOMBuilder.java&r2=111692
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/ObjectToOMBuilder.java
(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/ObjectToOMBuilder.java
Sun Dec 12 22:48:13 2004
@@ -184,7 +184,7 @@
 
         for (int i = 0; i < nameSpaces.size(); i++) {
             OMNamespace ns = (OMNamespace) nameSpaces.elementAt(i);
-            element.createNamespace(ns);
+            element.declareNamespace(ns);
         }
         nameSpaces.clear();
 
@@ -198,7 +198,7 @@
             attrPrefix = (attrQName.indexOf(':') >= 0) ? attrQName.substring(0, attrQName.indexOf(':'))
: "";
 
             if (attrUri.hashCode() != 0)
-                ns = element.resolveNamespace(attrUri, attrPrefix);
+                ns = element.findInScopeNamespace(attrUri, attrPrefix);
 
             if (ns == null)
             //todo this needs to be fixed!!!!!

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/StAXBuilder.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/StAXBuilder.java?view=diff&rev=111692&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/StAXBuilder.java&r1=111691&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/StAXBuilder.java&r2=111692
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/StAXBuilder.java
(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/StAXBuilder.java
Sun Dec 12 22:48:13 2004
@@ -68,7 +68,7 @@
             OMNamespace ns = null;
             String uri = parser.getAttributeNamespace(i);
             if (uri.hashCode() != 0)
-                ns = node.resolveNamespace(uri, parser.getAttributePrefix(i));
+                ns = node.findInScopeNamespace(uri, parser.getAttributePrefix(i));
 
             //todo if the attributes are supposed to namespace qualified all the time
             //todo then this should throw an exception here

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/StAXOMBuilder.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/StAXOMBuilder.java?view=diff&rev=111692&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/StAXOMBuilder.java&r1=111691&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/StAXOMBuilder.java&r2=111692
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/StAXOMBuilder.java
(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/StAXOMBuilder.java
Sun Dec 12 22:48:13 2004
@@ -135,11 +135,11 @@
     protected void processNamespaceData(OMElement node, boolean isSOAPElement) {
         int namespaceCount = parser.getNamespaceCount();
         for (int i = 0; i < namespaceCount; i++) {
-            node.createNamespace(parser.getNamespaceURI(i), parser.getNamespacePrefix(i));
+            node.declareNamespace(parser.getNamespaceURI(i), parser.getNamespacePrefix(i));
         }
 
         //set the own namespace
-        OMNamespace namespace = node.resolveNamespace(parser.getNamespaceURI(), parser.getPrefix());
+        OMNamespace namespace = node.findInScopeNamespace(parser.getNamespaceURI(), parser.getPrefix());
         node.setNamespace(namespace);
     }
 }

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/StAXSOAPModelBuilder.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/StAXSOAPModelBuilder.java?view=diff&rev=111692&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/StAXSOAPModelBuilder.java&r1=111691&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/StAXSOAPModelBuilder.java&r2=111692
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/StAXSOAPModelBuilder.java
(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/StAXSOAPModelBuilder.java
Sun Dec 12 22:48:13 2004
@@ -188,18 +188,18 @@
     protected void processNamespaceData(OMElement node, boolean isSOAPElement) {
         int namespaceCount = parser.getNamespaceCount();
         for (int i = 0; i < namespaceCount; i++) {
-            node.createNamespace(parser.getNamespaceURI(i), parser.getNamespacePrefix(i));
+            node.declareNamespace(parser.getNamespaceURI(i), parser.getNamespacePrefix(i));
         }
 
         //set the own namespace
-        OMNamespace namespace = node.resolveNamespace(parser.getNamespaceURI(), parser.getPrefix());
+        OMNamespace namespace = node.findInScopeNamespace(parser.getNamespaceURI(), parser.getPrefix());
 
         if (namespace == null) {
             throw new OMException("All elements must be namespace qualified!");
         }
 
         if (isSOAPElement) {
-            if (!namespace.getValue().equals(OMConstants.SOAP_ENVELOPE_NAMESPACE_URI))
+            if (!namespace.getName().equals(OMConstants.SOAP_ENVELOPE_NAMESPACE_URI))
                 throw new OMBuilderException("invalid SOAP namespace URI");
         }
 

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/serialize/SimpleOMSerializer.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/serialize/SimpleOMSerializer.java?view=diff&rev=111692&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/serialize/SimpleOMSerializer.java&r1=111691&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/serialize/SimpleOMSerializer.java&r2=111692
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/serialize/SimpleOMSerializer.java
(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/serialize/SimpleOMSerializer.java
Sun Dec 12 22:48:13 2004
@@ -180,7 +180,7 @@
             else
                 returnText = returnText + "xmlns=";
 
-            returnText = returnText + "\"" + namespace.getValue() + "\"";
+            returnText = returnText + "\"" + namespace.getName() + "\"";
         }
         //add the local name and the value
 

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/wrapper/OMStAXWrapper.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/wrapper/OMStAXWrapper.java?view=diff&rev=111692&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/wrapper/OMStAXWrapper.java&r1=111691&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/wrapper/OMStAXWrapper.java&r2=111692
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/wrapper/OMStAXWrapper.java
(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/wrapper/OMStAXWrapper.java
Sun Dec 12 22:48:13 2004
@@ -122,7 +122,7 @@
         if (currentEvent == START_ELEMENT || currentEvent == END_ELEMENT || currentEvent
== NAMESPACE) {
             if (navigable) {
                 OMNamespace ns = ((OMElement) lastNode).getNamespace();
-                returnStr = ns == null ? null : ns.getValue();
+                returnStr = ns == null ? null : ns.getName();
             } else {
                 returnStr = parser.getNamespaceURI();
             }
@@ -385,7 +385,7 @@
                 if (attrib != null) {
                     OMNamespace nameSpace = attrib.getNamespace();
                     if (nameSpace != null) {
-                        returnString = nameSpace.getValue();
+                        returnString = nameSpace.getName();
                     }
                 }
             } else {
@@ -742,7 +742,7 @@
         String localPart = namedNode.getLocalName();
         if (ns != null) {
             String prefix = ns.getPrefix();
-            String uri = ns.getValue();
+            String uri = ns.getName();
             if (prefix==null || prefix.equals(""))
                 returnName = new QName(uri, localPart);
             else

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMElement.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMElement.java?view=diff&rev=111692&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMElement.java&r1=111691&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMElement.java&r2=111692
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMElement.java
(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMElement.java
Sun Dec 12 22:48:13 2004
@@ -2,6 +2,7 @@
 
 
 import javax.xml.namespace.QName;
+import java.util.ArrayList;
 import java.util.Iterator;
 
 /**
@@ -59,13 +60,13 @@
      * @param prefix
      * @return
      */
-    public OMNamespace createNamespace(String uri, String prefix);
+    public OMNamespace declareNamespace(String uri, String prefix);
 
     /**
      * @param namespace
      * @return
      */
-    public OMNamespace createNamespace(OMNamespace namespace);
+    public OMNamespace declareNamespace(OMNamespace namespace);
 
     /**
      * This will find a namespace with the given uri and prefix, in the scope of the docuemnt.
@@ -77,7 +78,25 @@
      * @return
      * @throws OMException
      */
-    public OMNamespace resolveNamespace(String uri, String prefix) throws OMException;
+    public OMNamespace findInScopeNamespace(String uri, String prefix) throws OMException;
+
+    /**
+     * This will ckeck for the namespace <B>only</B> in the current Element
+     *
+     * @param uri
+     * @param prefix
+     * @return
+     * @throws OMException
+     */
+    public OMNamespace findDeclaredNamespace(String uri, String prefix) throws OMException;
+
+    /**
+     * This will provide a list of namespace defined within this Element <B>only</B>
+     *
+     * @return
+     * @throws OMException
+     */
+    public ArrayList getAllDeclaredNamespaces();
 
     /**
      * This will help to search for an attribute with a given QName within this Element

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMNamedNode.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMNamedNode.java?view=diff&rev=111692&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMNamedNode.java&r1=111691&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMNamedNode.java&r2=111692
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMNamedNode.java
(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMNamedNode.java
Sun Dec 12 22:48:13 2004
@@ -31,6 +31,8 @@
 
     public OMNamespace getNamespace() throws OMException;
 
+    public String getNamespaceName();
+
     public void setNamespace(OMNamespace namespace);
 
     

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMNamespace.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMNamespace.java?view=diff&rev=111692&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMNamespace.java&r1=111691&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMNamespace.java&r2=111692
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMNamespace.java
(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMNamespace.java
Sun Dec 12 22:48:13 2004
@@ -19,15 +19,11 @@
  * Date: Oct 4, 2004
  * Time: 1:24:00 PM
  */
-public interface OMNamespace extends OMNode{
-
-    public boolean equals(OMNamespace ns);
+public interface OMNamespace {
 
     public boolean equals(String uri, String prefix);
 
-    public boolean isDefaultNs();
-
     public String getPrefix();
 
-    public String getValue();
+    public String getName();
 }

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EngineUtils.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EngineUtils.java?view=diff&rev=111692&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EngineUtils.java&r1=111691&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EngineUtils.java&r2=111692
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EngineUtils.java
(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EngineUtils.java
Sun Dec 12 22:48:13 2004
@@ -39,7 +39,7 @@
  * @author Srinath Perera (hemapani@opensource.lk)
  */
 public class EngineUtils {
-    public static final int TESTING_PORT = 7777;
+    public static final int TESTING_PORT = 7778;
     public static final String FAILURE_MESSAGE = "Intentional Faliure";
     private static int index = 0; 
     

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/om/OMTest.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/om/OMTest.java?view=diff&rev=111692&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/om/OMTest.java&r1=111691&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/om/OMTest.java&r2=111692
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/om/OMTest.java
(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/om/OMTest.java
Sun Dec 12 22:48:13 2004
@@ -78,7 +78,7 @@
     public void isNameSpacesMissing(OMElement omeleent){
         OMNamespace omns = omeleent.getNamespace();
         assertNotNull(omns);
-        assertNotNull(omns.getValue());
+        assertNotNull(omns.getName());
         Iterator it = omeleent.getChildren();
         while(it.hasNext()){
             OMNode node = (OMNode)it.next();
@@ -115,10 +115,10 @@
 
 //        OMElement root= envelope;
 //
-//        OMNamespace soapenv= root.resolveNamespace("http://schemas.xmlsoap.org/soap/envelope/",
"soapenv");
-//        OMNamespace wsa= root.resolveNamespace("http://schemas.xmlsoap.org/ws/2004/03/addressing",
"wsa");
+//        OMNamespace soapenv= root.findInScopeNamespace("http://schemas.xmlsoap.org/soap/envelope/",
"soapenv");
+//        OMNamespace wsa= root.findInScopeNamespace("http://schemas.xmlsoap.org/ws/2004/03/addressing",
"wsa");
 //        if (wsa==null)
-//            wsa= root.createNamespace("http://schemas.xmlsoap.org/ws/2004/03/addressing",
"wsa");
+//            wsa= root.declareNamespace("http://schemas.xmlsoap.org/ws/2004/03/addressing",
"wsa");
 //
 //        //Assumption - A RelatesTo Element does not exist in the input document
 //        OMElement relatesTo= fac.createOMElement ("RelatesTo", wsa);
@@ -129,7 +129,7 @@
 //
 //        root.addChild(relatesTo);
 //
-//        QName name = new QName(wsa.getValue(),"RelatesTo",wsa.getPrefix());
+//        QName name = new QName(wsa.getName(),"RelatesTo",wsa.getPrefix());
 //
 //        Iterator children = root.getChildrenWithName(name);
 //        //this should contain only one child!

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/om/OMTestUtils.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/om/OMTestUtils.java?view=diff&rev=111692&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/om/OMTestUtils.java&r1=111691&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/om/OMTestUtils.java&r2=111692
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/om/OMTestUtils.java
(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/om/OMTestUtils.java
Sun Dec 12 22:48:13 2004
@@ -67,7 +67,7 @@
         }else if(ele != null && omele != null){
 
             TestCase.assertTrue(ele.getLocalName().equals(omele.getLocalName()));
-            TestCase.assertTrue(ele.getNamespaceURI().equals(omele.getNamespace().getValue()));
+            TestCase.assertTrue(ele.getNamespaceURI().equals(omele.getNamespace().getName()));
             
             Iterator it = omele.getChildren();
             

Mime
View raw message