Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 52571 invoked from network); 17 Nov 2005 22:18:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Nov 2005 22:18:11 -0000 Received: (qmail 70073 invoked by uid 500); 17 Nov 2005 22:18:05 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 69996 invoked by uid 500); 17 Nov 2005 22:18:04 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 69979 invoked by uid 500); 17 Nov 2005 22:18:04 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 69974 invoked by uid 99); 17 Nov 2005 22:18:03 -0000 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 17 Nov 2005 14:18:03 -0800 Received: (qmail 52389 invoked by uid 65534); 17 Nov 2005 22:17:43 -0000 Message-ID: <20051117221743.52388.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r345345 - in /webservices/axis2/trunk/java/modules: saaj/src/org/apache/axis2/soap/impl/dom/ xml/src/org/apache/axis2/om/util/ xml/src/org/apache/axis2/soap/impl/llom/ xml/src/org/apache/axis2/soap/impl/llom/util/ Date: Thu, 17 Nov 2005 22:17:41 -0000 To: axis2-cvs@ws.apache.org From: dims@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: dims Date: Thu Nov 17 14:17:33 2005 New Revision: 345345 URL: http://svn.apache.org/viewcvs?rev=345345&view=rev Log: Move 2 tiny methods from UtilProvider to ElementHelper and got rid of a package Removed: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/util/ Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/soap/impl/dom/SOAPFaultCodeImpl.java webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/soap/impl/dom/SOAPFaultReasonImpl.java webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/soap/impl/dom/SOAPFaultSubCodeImpl.java webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/util/ElementHelper.java webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultCodeImpl.java webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultReasonImpl.java webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultSubCodeImpl.java Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/soap/impl/dom/SOAPFaultCodeImpl.java URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/soap/impl/dom/SOAPFaultCodeImpl.java?rev=345345&r1=345344&r2=345345&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/soap/impl/dom/SOAPFaultCodeImpl.java (original) +++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/soap/impl/dom/SOAPFaultCodeImpl.java Thu Nov 17 14:17:33 2005 @@ -17,6 +17,7 @@ package org.apache.axis2.soap.impl.dom; import org.apache.axis2.om.OMXMLParserWrapper; +import org.apache.axis2.om.util.ElementHelper; import org.apache.axis2.om.impl.OMOutputImpl; import org.apache.axis2.om.impl.llom.OMSerializerUtil; import org.apache.axis2.om.impl.llom.serialize.StreamWriterToContentHandlerConverter; @@ -27,7 +28,6 @@ import org.apache.axis2.soap.SOAPFaultValue; import org.apache.axis2.soap.SOAPProcessingException; import org.apache.axis2.soap.impl.dom.SOAPElement; -import org.apache.axis2.soap.impl.llom.util.UtilProvider; import javax.xml.stream.XMLStreamException; @@ -60,20 +60,20 @@ * Eran Chinthaka (chinthaka@apache.org) */ public void setValue(SOAPFaultValue value) throws SOAPProcessingException { - UtilProvider.setNewElement(this, value, value); + ElementHelper.setNewElement(this, value, value); } public SOAPFaultValue getValue() { - return (SOAPFaultValue) UtilProvider.getChildWithName(this, + return (SOAPFaultValue) ElementHelper.getChildWithName(this, SOAP12Constants.SOAP_FAULT_VALUE_LOCAL_NAME); } public void setSubCode(SOAPFaultSubCode value) throws SOAPProcessingException { - UtilProvider.setNewElement(this, getSubCode(), value); + ElementHelper.setNewElement(this, getSubCode(), value); } public SOAPFaultSubCode getSubCode() { - return (SOAPFaultSubCode) UtilProvider.getChildWithName(this, + return (SOAPFaultSubCode) ElementHelper.getChildWithName(this, SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME); } Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/soap/impl/dom/SOAPFaultReasonImpl.java URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/soap/impl/dom/SOAPFaultReasonImpl.java?rev=345345&r1=345344&r2=345345&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/soap/impl/dom/SOAPFaultReasonImpl.java (original) +++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/soap/impl/dom/SOAPFaultReasonImpl.java Thu Nov 17 14:17:33 2005 @@ -18,6 +18,7 @@ import org.apache.axis2.om.OMElement; import org.apache.axis2.om.OMXMLParserWrapper; +import org.apache.axis2.om.util.ElementHelper; import org.apache.axis2.om.impl.llom.OMSerializerUtil; import org.apache.axis2.om.impl.llom.serialize.StreamWriterToContentHandlerConverter; import org.apache.axis2.soap.SOAP12Constants; @@ -25,7 +26,6 @@ import org.apache.axis2.soap.SOAPFaultReason; import org.apache.axis2.soap.SOAPFaultText; import org.apache.axis2.soap.SOAPProcessingException; -import org.apache.axis2.soap.impl.llom.util.UtilProvider; import javax.xml.stream.XMLStreamException; @@ -56,11 +56,11 @@ * Eran Chinthaka (chinthaka@apache.org) */ public void setSOAPText(SOAPFaultText soapFaultText) throws SOAPProcessingException { - UtilProvider.setNewElement(this, text, soapFaultText); + ElementHelper.setNewElement(this, text, soapFaultText); } public SOAPFaultText getSOAPText() { - return (SOAPFaultText) UtilProvider.getChildWithName(this, + return (SOAPFaultText) ElementHelper.getChildWithName(this, SOAP12Constants.SOAP_FAULT_TEXT_LOCAL_NAME); } Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/soap/impl/dom/SOAPFaultSubCodeImpl.java URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/soap/impl/dom/SOAPFaultSubCodeImpl.java?rev=345345&r1=345344&r2=345345&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/soap/impl/dom/SOAPFaultSubCodeImpl.java (original) +++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/soap/impl/dom/SOAPFaultSubCodeImpl.java Thu Nov 17 14:17:33 2005 @@ -18,11 +18,11 @@ import org.apache.axis2.om.OMElement; import org.apache.axis2.om.OMXMLParserWrapper; +import org.apache.axis2.om.util.ElementHelper; import org.apache.axis2.soap.SOAP12Constants; import org.apache.axis2.soap.SOAPFaultSubCode; import org.apache.axis2.soap.SOAPFaultValue; import org.apache.axis2.soap.SOAPProcessingException; -import org.apache.axis2.soap.impl.llom.util.UtilProvider; public abstract class SOAPFaultSubCodeImpl extends SOAPElement implements SOAPFaultSubCode { @@ -41,27 +41,27 @@ } public void setValue(SOAPFaultValue soapFaultSubCodeValue) throws SOAPProcessingException { - UtilProvider.setNewElement(this, value, soapFaultSubCodeValue); + ElementHelper.setNewElement(this, value, soapFaultSubCodeValue); } public SOAPFaultValue getValue() { if (value == null) { value = - (SOAPFaultValue) UtilProvider.getChildWithName(this, + (SOAPFaultValue) ElementHelper.getChildWithName(this, SOAP12Constants.SOAP_FAULT_VALUE_LOCAL_NAME); } return value; } public void setSubCode(SOAPFaultSubCode subCode) throws SOAPProcessingException { - UtilProvider.setNewElement(this, this.subCode, subCode); + ElementHelper.setNewElement(this, this.subCode, subCode); } public SOAPFaultSubCode getSubCode() { if (subCode == null) { subCode = - (SOAPFaultSubCode) UtilProvider.getChildWithName(this, + (SOAPFaultSubCode) ElementHelper.getChildWithName(this, SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME); } return subCode; Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/util/ElementHelper.java URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/util/ElementHelper.java?rev=345345&r1=345344&r2=345345&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/util/ElementHelper.java (original) +++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/util/ElementHelper.java Thu Nov 17 14:17:33 2005 @@ -17,8 +17,10 @@ import org.apache.axis2.om.OMElement; import org.apache.axis2.om.OMNamespace; +import org.apache.axis2.om.OMNode; import javax.xml.namespace.QName; +import java.util.Iterator; /** * helper class to provide extra utility stuff against elements. @@ -81,4 +83,26 @@ return resolveQName(qname, true); } + public static void setNewElement(OMElement parent, + OMElement myElement, + OMElement newElement) { + if (myElement != null) { + myElement.discard(); + } + parent.addChild(newElement); + myElement = newElement; + } + + public static OMElement getChildWithName(OMElement parent, + String childName) { + Iterator childrenIter = parent.getChildren(); + while (childrenIter.hasNext()) { + OMNode node = (OMNode) childrenIter.next(); + if (node.getType() == OMNode.ELEMENT_NODE && + childName.equals(((OMElement) node).getLocalName())) { + return (OMElement) node; + } + } + return null; + } } Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultCodeImpl.java URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultCodeImpl.java?rev=345345&r1=345344&r2=345345&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultCodeImpl.java (original) +++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultCodeImpl.java Thu Nov 17 14:17:33 2005 @@ -17,6 +17,7 @@ package org.apache.axis2.soap.impl.llom; import org.apache.axis2.om.OMXMLParserWrapper; +import org.apache.axis2.om.util.ElementHelper; import org.apache.axis2.om.impl.OMOutputImpl; import org.apache.axis2.om.impl.llom.OMSerializerUtil; import org.apache.axis2.om.impl.llom.serialize.StreamWriterToContentHandlerConverter; @@ -26,7 +27,6 @@ import org.apache.axis2.soap.SOAPFaultSubCode; import org.apache.axis2.soap.SOAPFaultValue; import org.apache.axis2.soap.SOAPProcessingException; -import org.apache.axis2.soap.impl.llom.util.UtilProvider; import javax.xml.stream.XMLStreamException; @@ -60,20 +60,20 @@ * Eran Chinthaka (chinthaka@apache.org) */ public void setValue(SOAPFaultValue value) throws SOAPProcessingException { - UtilProvider.setNewElement(this, value, value); + ElementHelper.setNewElement(this, value, value); } public SOAPFaultValue getValue() { - return (SOAPFaultValue) UtilProvider.getChildWithName(this, + return (SOAPFaultValue) ElementHelper.getChildWithName(this, SOAP12Constants.SOAP_FAULT_VALUE_LOCAL_NAME); } public void setSubCode(SOAPFaultSubCode value) throws SOAPProcessingException { - UtilProvider.setNewElement(this, getSubCode(), value); + ElementHelper.setNewElement(this, getSubCode(), value); } public SOAPFaultSubCode getSubCode() { - return (SOAPFaultSubCode) UtilProvider.getChildWithName(this, + return (SOAPFaultSubCode) ElementHelper.getChildWithName(this, SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME); } Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultReasonImpl.java URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultReasonImpl.java?rev=345345&r1=345344&r2=345345&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultReasonImpl.java (original) +++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultReasonImpl.java Thu Nov 17 14:17:33 2005 @@ -18,6 +18,7 @@ import org.apache.axis2.om.OMElement; import org.apache.axis2.om.OMXMLParserWrapper; +import org.apache.axis2.om.util.ElementHelper; import org.apache.axis2.om.impl.llom.OMSerializerUtil; import org.apache.axis2.om.impl.llom.serialize.StreamWriterToContentHandlerConverter; import org.apache.axis2.soap.SOAP12Constants; @@ -25,7 +26,6 @@ import org.apache.axis2.soap.SOAPFaultReason; import org.apache.axis2.soap.SOAPFaultText; import org.apache.axis2.soap.SOAPProcessingException; -import org.apache.axis2.soap.impl.llom.util.UtilProvider; import javax.xml.stream.XMLStreamException; @@ -56,11 +56,11 @@ * Eran Chinthaka (chinthaka@apache.org) */ public void setSOAPText(SOAPFaultText soapFaultText) throws SOAPProcessingException { - UtilProvider.setNewElement(this, text, soapFaultText); + ElementHelper.setNewElement(this, text, soapFaultText); } public SOAPFaultText getSOAPText() { - return (SOAPFaultText) UtilProvider.getChildWithName(this, + return (SOAPFaultText) ElementHelper.getChildWithName(this, SOAP12Constants.SOAP_FAULT_TEXT_LOCAL_NAME); } Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultSubCodeImpl.java URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultSubCodeImpl.java?rev=345345&r1=345344&r2=345345&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultSubCodeImpl.java (original) +++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultSubCodeImpl.java Thu Nov 17 14:17:33 2005 @@ -18,11 +18,11 @@ import org.apache.axis2.om.OMElement; import org.apache.axis2.om.OMXMLParserWrapper; +import org.apache.axis2.om.util.ElementHelper; import org.apache.axis2.soap.SOAP12Constants; import org.apache.axis2.soap.SOAPFaultSubCode; import org.apache.axis2.soap.SOAPFaultValue; import org.apache.axis2.soap.SOAPProcessingException; -import org.apache.axis2.soap.impl.llom.util.UtilProvider; public abstract class SOAPFaultSubCodeImpl extends SOAPElement implements SOAPFaultSubCode { @@ -41,27 +41,27 @@ } public void setValue(SOAPFaultValue soapFaultSubCodeValue) throws SOAPProcessingException { - UtilProvider.setNewElement(this, value, soapFaultSubCodeValue); + ElementHelper.setNewElement(this, value, soapFaultSubCodeValue); } public SOAPFaultValue getValue() { if (value == null) { value = - (SOAPFaultValue) UtilProvider.getChildWithName(this, + (SOAPFaultValue) ElementHelper.getChildWithName(this, SOAP12Constants.SOAP_FAULT_VALUE_LOCAL_NAME); } return value; } public void setSubCode(SOAPFaultSubCode subCode) throws SOAPProcessingException { - UtilProvider.setNewElement(this, this.subCode, subCode); + ElementHelper.setNewElement(this, this.subCode, subCode); } public SOAPFaultSubCode getSubCode() { if (subCode == null) { subCode = - (SOAPFaultSubCode) UtilProvider.getChildWithName(this, + (SOAPFaultSubCode) ElementHelper.getChildWithName(this, SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME); } return subCode;