Author: veithen
Date: Fri May 14 20:48:22 2010
New Revision: 944459

URL: http://svn.apache.org/viewvc?rev=944459&view=rev
Log:
Broke another cyclic package dependency caused by StAXUtils#getEventTypeString.

Added:
    
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/XMLEventUtils.java
   (with props)
Modified:
    
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/util/StAXUtils.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/xop/XOPDecodingStreamReader.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/XMLStreamReaderComparator.java

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java?rev=944459&r1=944458&r2=944459&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java
 Fri May 14 20:48:22 2010
@@ -32,6 +32,7 @@ import org.apache.axiom.om.OMText;
 import org.apache.axiom.om.impl.OMContainerEx;
 import org.apache.axiom.om.impl.OMNodeEx;
 import org.apache.axiom.om.util.StAXUtils;
+import org.apache.axiom.util.stax.XMLEventUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -199,8 +200,8 @@ public class StAXOMBuilder extends StAXB
     
                         log.debug("WARNING: The current state of the parser is 
not equal to the " +
                                   "state just received from the parser. The 
current state in the paser is " +
-                                  
StAXUtils.getEventTypeString(currentParserToken) + " the state just received is 
" +
-                                  StAXUtils.getEventTypeString(token));
+                                  
XMLEventUtils.getEventTypeString(currentParserToken) + " the state just 
received is " +
+                                  XMLEventUtils.getEventTypeString(token));
     
                         /*
                           throw new OMException("The current token " + token + 

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/util/StAXUtils.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/util/StAXUtils.java?rev=944459&r1=944458&r2=944459&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/util/StAXUtils.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/util/StAXUtils.java
 Fri May 14 20:48:22 2010
@@ -22,6 +22,7 @@ package org.apache.axiom.om.util;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.axiom.om.OMConstants;
+import org.apache.axiom.util.stax.XMLEventUtils;
 import org.apache.axiom.util.stax.dialect.StAXDialect;
 import org.apache.axiom.util.stax.dialect.StAXDialectDetector;
 import org.apache.axiom.util.stax.wrapper.ImmutableXMLInputFactory;
@@ -750,52 +751,9 @@ public class StAXUtils {
     }
 
     /**
-     * Get the string representation of a given StAX event type. The returned 
value is the name
-     * of the constant in {...@link XMLStreamReader} corresponding to the 
event type.
-     * 
-     * @param event the event type as returned by {...@link 
XMLStreamReader#getEventType()} or
-     *              {...@link XMLStreamReader#next()}
-     * @return a string representation of the event type
+     * @deprecated Use {...@link XMLEventUtils#getEventTypeString(int)} instead
      */
     public static String getEventTypeString(int event) {
-        String state = null;
-        switch(event) {
-        case XMLStreamConstants.START_ELEMENT:
-            state = "START_ELEMENT";
-            break;
-        case XMLStreamConstants.START_DOCUMENT:
-            state = "START_DOCUMENT";
-            break;
-        case XMLStreamConstants.CHARACTERS:
-            state = "CHARACTERS";
-            break;
-        case XMLStreamConstants.CDATA:
-            state = "CDATA";
-            break;
-        case XMLStreamConstants.END_ELEMENT:
-            state = "END_ELEMENT";
-            break;
-        case XMLStreamConstants.END_DOCUMENT:
-            state = "END_DOCUMENT";
-            break;
-        case XMLStreamConstants.SPACE:
-            state = "SPACE";
-            break;
-        case XMLStreamConstants.COMMENT:
-            state = "COMMENT";
-            break;
-        case XMLStreamConstants.DTD:
-            state = "DTD";
-            break;
-        case XMLStreamConstants.PROCESSING_INSTRUCTION:
-            state = "PROCESSING_INSTRUCTION";
-            break;
-        case XMLStreamConstants.ENTITY_REFERENCE:
-            state = "ENTITY_REFERENCE";
-            break;
-        default :
-            state = "UNKNOWN_STATE: " + event;
-        }
-        return state;
+        return XMLEventUtils.getEventTypeString(event);
     }
 }

Added: 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/XMLEventUtils.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/XMLEventUtils.java?rev=944459&view=auto
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/XMLEventUtils.java
 (added)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/XMLEventUtils.java
 Fri May 14 20:48:22 2010
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.util.stax;
+
+import javax.xml.stream.XMLStreamConstants;
+
+public final class XMLEventUtils {
+    private XMLEventUtils() {}
+    
+    /**
+     * Get the string representation of a given StAX event type. The returned
+     * value is the name of the constant in {...@link XMLStreamConstants}
+     * corresponding to the event type.
+     * 
+     * @param event
+     *            the event type as returned by
+     *            {...@link javax.xml.stream.events.XMLEvent#getEventType()},
+     *            {...@link javax.xml.stream.XMLStreamReader#getEventType()} or
+     *            {...@link javax.xml.stream.XMLStreamReader#next()}
+     * @return a string representation of the event type
+     */
+    public static String getEventTypeString(int event) {
+        String state = null;
+        switch(event) {
+        case XMLStreamConstants.START_ELEMENT:
+            state = "START_ELEMENT";
+            break;
+        case XMLStreamConstants.START_DOCUMENT:
+            state = "START_DOCUMENT";
+            break;
+        case XMLStreamConstants.CHARACTERS:
+            state = "CHARACTERS";
+            break;
+        case XMLStreamConstants.CDATA:
+            state = "CDATA";
+            break;
+        case XMLStreamConstants.END_ELEMENT:
+            state = "END_ELEMENT";
+            break;
+        case XMLStreamConstants.END_DOCUMENT:
+            state = "END_DOCUMENT";
+            break;
+        case XMLStreamConstants.SPACE:
+            state = "SPACE";
+            break;
+        case XMLStreamConstants.COMMENT:
+            state = "COMMENT";
+            break;
+        case XMLStreamConstants.DTD:
+            state = "DTD";
+            break;
+        case XMLStreamConstants.PROCESSING_INSTRUCTION:
+            state = "PROCESSING_INSTRUCTION";
+            break;
+        case XMLStreamConstants.ENTITY_REFERENCE:
+            state = "ENTITY_REFERENCE";
+            break;
+        default :
+            state = "UNKNOWN_STATE: " + event;
+        }
+        return state;
+    }
+}

Propchange: 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/XMLEventUtils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/xop/XOPDecodingStreamReader.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/xop/XOPDecodingStreamReader.java?rev=944459&r1=944458&r2=944459&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/xop/XOPDecodingStreamReader.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/xop/XOPDecodingStreamReader.java
 Fri May 14 20:48:22 2010
@@ -24,7 +24,6 @@ import java.io.UnsupportedEncodingExcept
 import java.net.URLDecoder;
 
 import javax.activation.DataHandler;
-import javax.xml.namespace.NamespaceContext;
 import javax.xml.namespace.QName;
 import javax.xml.stream.Location;
 import javax.xml.stream.XMLStreamException;
@@ -33,8 +32,8 @@ import javax.xml.stream.util.StreamReade
 
 import org.apache.axiom.ext.stax.datahandler.DataHandlerProvider;
 import org.apache.axiom.ext.stax.datahandler.DataHandlerReader;
-import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.util.base64.Base64Utils;
+import org.apache.axiom.util.stax.XMLEventUtils;
 import org.apache.axiom.util.stax.wrapper.XMLStreamReaderContainer;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -262,7 +261,7 @@ public class XOPDecodingStreamReader ext
                         break;
                     default:
                         throw new XMLStreamException("Unexpected event " +
-                                StAXUtils.getEventTypeString(event) +
+                                XMLEventUtils.getEventTypeString(event) +
                                 " while reading element text");
                 }
                 event = parent.next();

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/XMLStreamReaderComparator.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/XMLStreamReaderComparator.java?rev=944459&r1=944458&r2=944459&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/XMLStreamReaderComparator.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/XMLStreamReaderComparator.java
 Fri May 14 20:48:22 2010
@@ -35,8 +35,6 @@ import javax.xml.stream.XMLStreamReader;
 
 import junit.framework.Assert;
 
-import org.apache.axiom.om.util.StAXUtils;
-
 /**
  * Helper class that compares the events produced by two {...@link 
XMLStreamReader} objects.
  * Note that this class is not meant to be used to compare two XML documents 
(the error
@@ -72,7 +70,7 @@ public class XMLStreamReaderComparator e
     private String getLocation() {
         StringBuffer buffer = new StringBuffer();
         buffer.append("event type ");
-        buffer.append(StAXUtils.getEventTypeString(expected.getEventType()));
+        
buffer.append(XMLEventUtils.getEventTypeString(expected.getEventType()));
         buffer.append("; location ");
         for (Iterator it = path.iterator(); it.hasNext(); ) {
             buffer.append('/');


Reply via email to