axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdani...@apache.org
Subject svn commit: r349409 - in /webservices/axis2/trunk/java/modules: saaj/src/org/apache/axis2/om/impl/dom/ElementImpl.java xml/src/org/apache/axis2/om/OMElement.java xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java
Date Mon, 28 Nov 2005 15:55:00 GMT
Author: gdaniels
Date: Mon Nov 28 07:54:54 2005
New Revision: 349409

URL: http://svn.apache.org/viewcvs?rev=349409&view=rev
Log:
* Add getAttributeValue() method to OMElement

Modified:
    webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/om/impl/dom/ElementImpl.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

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=349409&r1=349408&r2=349409&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
Mon Nov 28 07:54:54 2005
@@ -568,9 +568,20 @@
 		}
 	}
 
-	/* (non-Javadoc)
-	 * @see org.apache.axis2.om.OMElement#getBuilder()
-	 */
+    /**
+     * Return a named attribute's value, if present.
+     *
+     * @param qname the qualified name to search for
+     * @return a String containing the attribute value, or null
+     */
+    public String getAttributeValue(QName qname) {
+        OMAttribute attr = getAttribute(qname);
+        return (attr == null) ? null : attr.getAttributeValue();
+    }
+
+    /* (non-Javadoc)
+    * @see org.apache.axis2.om.OMElement#getBuilder()
+    */
 	public OMXMLParserWrapper getBuilder() {
 		return this.builder;
 	}

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=349409&r1=349408&r2=349409&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 Mon Nov
28 07:54:54 2005
@@ -138,6 +138,14 @@
     public OMAttribute getAttribute(QName qname);
 
     /**
+     * Return a named attribute's value, if present.
+     *
+     * @param qname the qualified name to search for
+     * @return a String containing the attribute value, or null
+     */
+    public String getAttributeValue(QName qname);
+
+    /**
      * This will add an attribute to this element.
      * <p/>
      * <p>There is no order implied by added attributes.</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=349409&r1=349408&r2=349409&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
Mon Nov 28 07:54:54 2005
@@ -417,8 +417,18 @@
      * @return an OMAttribute with the given name if found, or null
      */
     public OMAttribute getAttribute(QName qname) {
-
         return attributes == null ? null : (OMAttribute) attributes.get(qname);
+    }
+
+    /**
+     * Return a named attribute's value, if present.
+     *
+     * @param qname the qualified name to search for
+     * @return a String containing the attribute value, or null
+     */
+    public String getAttributeValue(QName qname) {
+        OMAttribute attr = getAttribute(qname);
+        return (attr == null) ? null : attr.getAttributeValue();
     }
 
     /**



Mime
View raw message