axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ruchi...@apache.org
Subject svn commit: r358290 - in /webservices/axis2/trunk/java/modules: addressing/src/org/apache/axis2/handlers/addressing/ integration/src/test/interop/util/ integration/test/org/apache/axis2/swa/ saaj/src/org/apache/axis2/om/impl/dom/ saaj/src/org/apache/ax...
Date Wed, 21 Dec 2005 13:27:46 GMT
Author: ruchithf
Date: Wed Dec 21 05:27:08 2005
New Revision: 358290

URL: http://svn.apache.org/viewcvs?rev=358290&view=rev
Log:
- DOOM: Now we can add comments to XML documents
- Renamed 'rootElement' in OMDocumentImpl to 'documentElement'
- removed getFirstAttribute(Qname) from OMelement


Modified:
    webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
    webservices/axis2/trunk/java/modules/integration/src/test/interop/util/XMLComparatorInterop.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/swa/EchoSwA.java
    webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/om/impl/dom/AttrImpl.java
    webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/om/impl/dom/AttributeMap.java
    webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/om/impl/dom/ElementImpl.java
    webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java
    webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java
    webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/soap/impl/dom/SOAPFaultTextImpl.java
    webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/soap/impl/dom/SOAPHeaderBlockImpl.java
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/OMElement.java
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/traverse/OMChildrenWithSpecificAttributeIterator.java
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/util/XMLComparator.java
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultTextImpl.java
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPHeaderBlockImpl.java
    webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/util/XMLComparator.java

Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java?rev=358290&r1=358289&r2=358290&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
(original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
Wed Dec 21 05:27:08 2005
@@ -113,7 +113,7 @@
                     .WSA_TYPE_ATTRIBUTE_VALUE
                     .equals(
                             soapHeaderBlock
-                                    .getFirstAttribute(
+                                    .getAttribute(
                                             new QName(
                                                     Final.WSA_NAMESPACE,
                                                     Final.WSA_IS_REFERENCE_PARAMETER_ATTRIBUTE))
@@ -204,7 +204,7 @@
             } else if (AddressingConstants.WSA_RELATES_TO.equals(soapHeaderBlock.getLocalName()))
{
                 String address = soapHeaderBlock.getText();
                 OMAttribute relationshipType =
-                        soapHeaderBlock.getFirstAttribute(
+                        soapHeaderBlock.getAttribute(
                                 new QName(AddressingConstants.WSA_RELATES_TO_RELATIONSHIP_TYPE));
                 String relationshipTypeDefaultValue =
                         Submission.WSA_NAMESPACE.equals(addressingNamespace)

Modified: webservices/axis2/trunk/java/modules/integration/src/test/interop/util/XMLComparatorInterop.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/src/test/interop/util/XMLComparatorInterop.java?rev=358290&r1=358289&r2=358290&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/src/test/interop/util/XMLComparatorInterop.java
(original)
+++ webservices/axis2/trunk/java/modules/integration/src/test/interop/util/XMLComparatorInterop.java
Wed Dec 21 05:27:08 2005
@@ -193,7 +193,7 @@
         Iterator attributes = elementOne.getAllAttributes();
         while (attributes.hasNext()) {
             OMAttribute omAttribute = (OMAttribute) attributes.next();
-            OMAttribute attr = elementTwo.getFirstAttribute(omAttribute.getQName());
+            OMAttribute attr = elementTwo.getAttribute(omAttribute.getQName());
             if (attr == null) {
                 return false;
             }

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/swa/EchoSwA.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/swa/EchoSwA.java?rev=358290&r1=358289&r2=358290&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/swa/EchoSwA.java
(original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/swa/EchoSwA.java
Wed Dec 21 05:27:08 2005
@@ -43,7 +43,7 @@
 
     public OMElement echoAttachment(OMElement omEle) {
         OMElement child  = (OMElement)omEle.getFirstOMChild();
-        OMAttribute attr = child.getFirstAttribute(new QName("href"));
+        OMAttribute attr = child.getAttribute(new QName("href"));
         String contentID = attr.getAttributeValue();
         MIMEHelper attachment = (MIMEHelper)msgcts.getProperty(MTOMConstants.ATTACHMENTS);
         contentID = contentID.trim();

Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/om/impl/dom/AttrImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/om/impl/dom/AttrImpl.java?rev=358290&r1=358289&r2=358290&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/om/impl/dom/AttrImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/om/impl/dom/AttrImpl.java
Wed Dec 21 05:27:08 2005
@@ -97,8 +97,10 @@
 	 * Returns the name of this attribute 
 	 */
 	public String getNodeName() {
-		return (this.namespace != null) ? this.namespace.getPrefix() + ":"
-				+ this.attrName : this.attrName;
+		return (this.namespace != null && !"".equals(this.namespace)) ? this.namespace
+				.getPrefix()
+				+ ":" + this.attrName
+				: this.attrName;
 	}
 	
 	/**

Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/om/impl/dom/AttributeMap.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/om/impl/dom/AttributeMap.java?rev=358290&r1=358289&r2=358290&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/om/impl/dom/AttributeMap.java
(original)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/om/impl/dom/AttributeMap.java
Wed Dec 21 05:27:08 2005
@@ -81,7 +81,7 @@
         if (i >= 0) { //There's an attribute already with this attr's name
             previous = (AttrImpl) nodes.elementAt(i);
             nodes.setElementAt(attr,i);
-            previous.parent = (DocumentImpl)this.ownerNode;
+            previous.parent = this.ownerNode;
             previous.isOwned(false);
             
             // make sure it won't be mistaken with defaults in case it's reused

Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/om/impl/dom/ElementImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/om/impl/dom/ElementImpl.java?rev=358290&r1=358289&r2=358290&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/om/impl/dom/ElementImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/om/impl/dom/ElementImpl.java
Wed Dec 21 05:27:08 2005
@@ -417,7 +417,7 @@
 	 */
 	public void setAttributeNS(String namespaceURI, String qualifiedName, String value) throws
DOMException {
 		
-		if(namespaceURI != null) {
+		if(namespaceURI != null && !"".equals(namespaceURI)) {
 			if(namespaceURI.equals(OMConstants.XMLNS_NS_URI)) {
 				this.declareNamespace(value, DOMUtil.getLocalName(qualifiedName));
 			} else {
@@ -693,20 +693,6 @@
    */
 	public OMXMLParserWrapper getBuilder() {
 		return this.builder;
-	}
-
-
-	/**
-	 * Returns the first attribute of the set of attributes if there
-	 * are any attributes. Otherwise returns null
-	 * @see org.apache.axis2.om.OMElement#getFirstAttribute(javax.xml.namespace.QName)
-	 */
-	public OMAttribute getFirstAttribute(QName qname) {
-		if(this.attributes == null) {
-			return null;
-		} else {
-			return (AttrImpl)this.attributes.getItem(0);
-		}
 	}
 
 	/**

Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java?rev=358290&r1=358289&r2=358290&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java
Wed Dec 21 05:27:08 2005
@@ -103,7 +103,7 @@
         while (childIter.hasNext()) {
             OMElement child = (OMElement) childIter.next();
             //check if there is an href attribute
-            OMAttribute hrefAttr = (OMAttribute) child.getFirstAttribute(new QName("href"));
+            OMAttribute hrefAttr = (OMAttribute) child.getAttribute(new QName("href"));
             String hrefContentId = validateHref(hrefAttr);
 
             if (hrefContentId != null) {//This is an element referencing an attachment!

Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java?rev=358290&r1=358289&r2=358290&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java
Wed Dec 21 05:27:08 2005
@@ -230,7 +230,7 @@
     public String getAttributeValue(Name name) {
         //This method is waiting on the finalization of the name for a method
         //in OMElement that returns a OMAttribute from an input QName
-        return omElement.getFirstAttribute(
+        return omElement.getAttribute(
                 new QName(name.getURI(),
                         name.getLocalName(),
                         name.getPrefix()))
@@ -332,7 +332,7 @@
     public boolean removeAttribute(Name name) {
         //get the OMAttribute with the given Name first, and call a removeAttribute(OMAttribute)
         //method on the omElement datamember this SOAPElement has in it.
-        org.apache.axis2.om.OMAttribute attr = omElement.getFirstAttribute(
+        org.apache.axis2.om.OMAttribute attr = omElement.getAttribute(
                 new QName(name.getURI(),
                         name.getLocalName(),
                         name.getPrefix()));

Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/soap/impl/dom/SOAPFaultTextImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/soap/impl/dom/SOAPFaultTextImpl.java?rev=358290&r1=358289&r2=358290&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/soap/impl/dom/SOAPFaultTextImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/soap/impl/dom/SOAPFaultTextImpl.java
Wed Dec 21 05:27:08 2005
@@ -59,7 +59,7 @@
         if (langAttr == null) {
             //langAttr = this.getFirstAttribute(new QName(SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME,
parent.getNamespace().getName()));
             langAttr =
-                    this.getFirstAttribute(
+                    this.getAttribute(
                             new QName(langNamespace.getName(),
                                     SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME,
                                     SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_PREFIX));

Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/soap/impl/dom/SOAPHeaderBlockImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/soap/impl/dom/SOAPHeaderBlockImpl.java?rev=358290&r1=358289&r2=358290&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/soap/impl/dom/SOAPHeaderBlockImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/soap/impl/dom/SOAPHeaderBlockImpl.java
Wed Dec 21 05:27:08 2005
@@ -68,7 +68,7 @@
     protected void setAttribute(String attributeName,
                                 String attrValue,
                                 String soapEnvelopeNamespaceURI) {
-        OMAttribute omAttribute = this.getFirstAttribute(
+        OMAttribute omAttribute = this.getAttribute(
                 new QName(soapEnvelopeNamespaceURI, attributeName));
         if (omAttribute != null) {
             omAttribute.setAttributeValue(attrValue);
@@ -89,7 +89,7 @@
      */
     protected String getAttribute(String attrName,
                                   String soapEnvelopeNamespaceURI) {
-        OMAttribute omAttribute = this.getFirstAttribute(
+        OMAttribute omAttribute = this.getAttribute(
                 new QName(soapEnvelopeNamespaceURI, attrName));
         return (omAttribute != null)
                 ? omAttribute.getAttributeValue()

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/OMElement.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/OMElement.java?rev=358290&r1=358289&r2=358290&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/OMElement.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/OMElement.java Wed Dec
21 05:27:08 2005
@@ -106,15 +106,6 @@
      */
     public Iterator getAllDeclaredNamespaces() throws OMException;
 
-
-    /**
-     * This will search for an attribute with a given QName within this Element
-     *
-     * @param qname The attribute name to match.
-     * @return The attribute, if found, or <tt>null</tt> otherwise.
-     */
-    public OMAttribute getFirstAttribute(QName qname);
-
     /**
      * This will return a List of OMAttributes.
      * <p/>

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java?rev=358290&r1=358289&r2=358290&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java
Wed Dec 21 05:27:08 2005
@@ -409,16 +409,6 @@
     }
 
     /**
-     * This will help to search for an attribute with a given QName within this Element
-     */
-    public OMAttribute getFirstAttribute(QName qname) {
-        if (attributes == null) {
-            return null;
-        }
-        return (OMAttribute) attributes.get(qname);
-    }
-
-    /**
      * This will return a List of OMAttributes
      *
      * @return iterator

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/traverse/OMChildrenWithSpecificAttributeIterator.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/traverse/OMChildrenWithSpecificAttributeIterator.java?rev=358290&r1=358289&r2=358290&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/traverse/OMChildrenWithSpecificAttributeIterator.java
(original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/traverse/OMChildrenWithSpecificAttributeIterator.java
Wed Dec 21 05:27:08 2005
@@ -80,7 +80,7 @@
             // check the current node for the criteria
             if (currentChild instanceof OMElement) {
                 OMAttribute attr =
-                        ((OMElement) currentChild).getFirstAttribute(
+                        ((OMElement) currentChild).getAttribute(
                                 attributeName);
                 if ((attr != null)
                         && attr.getAttributeValue().equalsIgnoreCase(attributeValue))
{

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/util/XMLComparator.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/util/XMLComparator.java?rev=358290&r1=358289&r2=358290&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/util/XMLComparator.java
(original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/util/XMLComparator.java
Wed Dec 21 05:27:08 2005
@@ -168,7 +168,7 @@
         Iterator attributes = elementOne.getAllAttributes();
         while (attributes.hasNext()) {
             OMAttribute omAttribute = (OMAttribute) attributes.next();
-            OMAttribute attr = elementTwo.getFirstAttribute(
+            OMAttribute attr = elementTwo.getAttribute(
                     omAttribute.getQName());
             if (attr == null) {
                 throw new XMLComparisonException(

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultTextImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultTextImpl.java?rev=358290&r1=358289&r2=358290&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultTextImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultTextImpl.java
Wed Dec 21 05:27:08 2005
@@ -59,7 +59,7 @@
         if (langAttr == null) {
             //langAttr = this.getFirstAttribute(new QName(SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME,
parent.getNamespace().getName()));
             langAttr =
-                    this.getFirstAttribute(
+                    this.getAttribute(
                             new QName(langNamespace.getName(),
                                     SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME,
                                     SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_PREFIX));

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPHeaderBlockImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPHeaderBlockImpl.java?rev=358290&r1=358289&r2=358290&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPHeaderBlockImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPHeaderBlockImpl.java
Wed Dec 21 05:27:08 2005
@@ -70,7 +70,7 @@
     protected void setAttribute(String attributeName,
                                 String attrValue,
                                 String soapEnvelopeNamespaceURI) {
-        OMAttribute omAttribute = this.getFirstAttribute(
+        OMAttribute omAttribute = this.getAttribute(
                 new QName(soapEnvelopeNamespaceURI, attributeName));
         if (omAttribute != null) {
             omAttribute.setAttributeValue(attrValue);
@@ -91,7 +91,7 @@
      */
     protected String getAttribute(String attrName,
                                   String soapEnvelopeNamespaceURI) {
-        OMAttribute omAttribute = this.getFirstAttribute(
+        OMAttribute omAttribute = this.getAttribute(
                 new QName(soapEnvelopeNamespaceURI, attrName));
         return (omAttribute != null)
                 ? omAttribute.getAttributeValue()

Modified: webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/util/XMLComparator.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/util/XMLComparator.java?rev=358290&r1=358289&r2=358290&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/util/XMLComparator.java
(original)
+++ webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/util/XMLComparator.java
Wed Dec 21 05:27:08 2005
@@ -112,7 +112,7 @@
         Iterator attributes = elementOne.getAllAttributes();
         while (attributes.hasNext()) {
             OMAttribute omAttribute = (OMAttribute) attributes.next();
-            OMAttribute attr = elementTwo.getFirstAttribute(
+            OMAttribute attr = elementTwo.getAttribute(
                     omAttribute.getQName());
             if (attr == null) {
                 throw new XMLComparisonException(



Mime
View raw message