Author: veithen
Date: Sun Oct 10 16:25:01 2010
New Revision: 1006318

URL: http://svn.apache.org/viewvc?rev=1006318&view=rev
Log:
DOOM: Use a better and more consistent way to look up exception messages from 
the resource bundles.

Modified:
    
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttrImpl.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttributeMap.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/CharacterImpl.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DOMMessageFormatter.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NamedNodeMapImpl.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ProcessingInstructionImpl.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextNodeImpl.java

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttrImpl.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttrImpl.java?rev=1006318&r1=1006317&r2=1006318&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttrImpl.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttrImpl.java
 Sun Oct 10 16:25:01 2010
@@ -284,7 +284,7 @@ public class AttrImpl extends NodeImpl i
         if (isReadonly()) {
             String msg = DOMMessageFormatter.formatMessage(
                     DOMMessageFormatter.DOM_DOMAIN,
-                    "NO_MODIFICATION_ALLOWED_ERR", null);
+                    DOMException.NO_MODIFICATION_ALLOWED_ERR, null);
             throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                    msg);
         }

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttributeMap.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttributeMap.java?rev=1006318&r1=1006317&r2=1006318&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttributeMap.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttributeMap.java
 Sun Oct 10 16:25:01 2010
@@ -48,18 +48,20 @@ public class AttributeMap extends NamedN
         if (isReadOnly()) {
             String msg = DOMMessageFormatter.formatMessage(
                     DOMMessageFormatter.DOM_DOMAIN,
-                    "NO_MODIFICATION_ALLOWED_ERR", null);
+                    DOMException.NO_MODIFICATION_ALLOWED_ERR, null);
             throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                    msg);
         }
         if (attribute.getOwnerDocument() != ownerNode.getOwnerDocument()) {
             String msg = DOMMessageFormatter.formatMessage(
-                    DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", 
null);
+                    DOMMessageFormatter.DOM_DOMAIN,
+                    DOMException.WRONG_DOCUMENT_ERR, null);
             throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
         }
         if (attribute.getNodeType() != Node.ATTRIBUTE_NODE) {
             String msg = DOMMessageFormatter.formatMessage(
-                    DOMMessageFormatter.DOM_DOMAIN, "HIERARCHY_REQUEST_ERR",
+                    DOMMessageFormatter.DOM_DOMAIN,
+                    DOMException.HIERARCHY_REQUEST_ERR,
                     null);
             throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, msg);
         }
@@ -72,7 +74,7 @@ public class AttributeMap extends NamedN
                 throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR,
                                        DOMMessageFormatter.formatMessage(
                                                DOMMessageFormatter.DOM_DOMAIN,
-                                               "INUSE_ATTRIBUTE_ERR", null));
+                                               
DOMException.INUSE_ATTRIBUTE_ERR, null));
             else
                 return attr; // No point adding the 'same' attr again to the
             // same element
@@ -119,18 +121,18 @@ public class AttributeMap extends NamedN
         if (isReadOnly()) {
             String msg = DOMMessageFormatter.formatMessage(
                     DOMMessageFormatter.DOM_DOMAIN,
-                    "NO_MODIFICATION_ALLOWED_ERR", null);
+                    DOMException.NO_MODIFICATION_ALLOWED_ERR, null);
             throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                    msg);
         }
         if (attribute.getOwnerDocument() != ownerNode.getOwnerDocument()) {
             String msg = DOMMessageFormatter.formatMessage(
-                    DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", 
null);
+                    DOMMessageFormatter.DOM_DOMAIN, 
DOMException.WRONG_DOCUMENT_ERR, null);
             throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
         }
         if (attribute.getNodeType() != Node.ATTRIBUTE_NODE) {
             String msg = DOMMessageFormatter.formatMessage(
-                    DOMMessageFormatter.DOM_DOMAIN, "HIERARCHY_REQUEST_ERR",
+                    DOMMessageFormatter.DOM_DOMAIN, 
DOMException.HIERARCHY_REQUEST_ERR,
                     null);
             throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, msg);
         }
@@ -142,7 +144,7 @@ public class AttributeMap extends NamedN
                 throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR,
                                        DOMMessageFormatter.formatMessage(
                                                DOMMessageFormatter.DOM_DOMAIN,
-                                               "INUSE_ATTRIBUTE_ERR", null));
+                                               
DOMException.INUSE_ATTRIBUTE_ERR, null));
             else
                 return attr; // No point adding the 'same' attr again to the
             // same element

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/CharacterImpl.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/CharacterImpl.java?rev=1006318&r1=1006317&r2=1006318&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/CharacterImpl.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/CharacterImpl.java
 Sun Oct 10 16:25:01 2010
@@ -55,7 +55,7 @@ public abstract class CharacterImpl exte
             throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                    DOMMessageFormatter.formatMessage(
                                            DOMMessageFormatter.DOM_DOMAIN,
-                                           "NO_MODIFICATION_ALLOWED_ERR", 
null));
+                                           
DOMException.NO_MODIFICATION_ALLOWED_ERR, null));
         }
 
         this.textValue += value;
@@ -76,14 +76,14 @@ public abstract class CharacterImpl exte
             throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                    DOMMessageFormatter.formatMessage(
                                            DOMMessageFormatter.DOM_DOMAIN,
-                                           "NO_MODIFICATION_ALLOWED_ERR", 
null));
+                                           
DOMException.NO_MODIFICATION_ALLOWED_ERR, null));
         }
 
         int length = this.textValue.length();
         if (offset < 0 || offset > length - 1 || count < 0) {
             throw new DOMException(DOMException.INDEX_SIZE_ERR,
                                    DOMMessageFormatter.formatMessage(
-                                           DOMMessageFormatter.DOM_DOMAIN, 
"INDEX_SIZE_ERR",
+                                           DOMMessageFormatter.DOM_DOMAIN, 
DOMException.INDEX_SIZE_ERR,
                                            null));
         } else {
 
@@ -112,14 +112,14 @@ public abstract class CharacterImpl exte
             throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                    DOMMessageFormatter.formatMessage(
                                            DOMMessageFormatter.DOM_DOMAIN,
-                                           "NO_MODIFICATION_ALLOWED_ERR", 
null));
+                                           
DOMException.NO_MODIFICATION_ALLOWED_ERR, null));
         }
 
         if (offset < 0 || offset > length - 1) {
             throw new DOMException(DOMException.INDEX_SIZE_ERR,
                                    DOMMessageFormatter.formatMessage(
                                            DOMMessageFormatter.DOM_DOMAIN,
-                                           "INDEX_SIZE_ERR", null));
+                                           DOMException.INDEX_SIZE_ERR, null));
         }
 
         this.textValue = (new StringBuilder(textValue)).insert(offset, 
data).toString();
@@ -133,7 +133,7 @@ public abstract class CharacterImpl exte
             throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                    DOMMessageFormatter.formatMessage(
                                            DOMMessageFormatter.DOM_DOMAIN,
-                                           "NO_MODIFICATION_ALLOWED_ERR", 
null));
+                                           
DOMException.NO_MODIFICATION_ALLOWED_ERR, null));
         }
     }
 
@@ -148,7 +148,7 @@ public abstract class CharacterImpl exte
             throw new DOMException(DOMException.INDEX_SIZE_ERR,
                                    DOMMessageFormatter.formatMessage(
                                            DOMMessageFormatter.DOM_DOMAIN,
-                                           "INDEX_SIZE_ERR", null));
+                                           DOMException.INDEX_SIZE_ERR, null));
         }
 
         int end = Math.min(count + offset, textValue.length());

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DOMMessageFormatter.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DOMMessageFormatter.java?rev=1006318&r1=1006317&r2=1006318&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DOMMessageFormatter.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DOMMessageFormatter.java
 Sun Oct 10 16:25:01 2010
@@ -48,6 +48,27 @@ public class DOMMessageFormatter {
     public static final String NOT_REQUIRED_FOR_XMLSEC_OR_WSS4J =
             "This method is not required by Apache XML-Security Impl or WSS4J";
 
+    private static final String[] exceptionKeys = {
+        // Note: order is determined by the constants defined in DOMException
+        "INDEX_SIZE_ERR",
+        "DOMSTRING_SIZE_ERR",
+        "HIERARCHY_REQUEST_ERR",
+        "WRONG_DOCUMENT_ERR",
+        "INVALID_CHARACTER_ERR",
+        "NO_DATA_ALLOWED_ERR",
+        "NO_MODIFICATION_ALLOWED_ERR",
+        "NOT_FOUND_ERR",
+        "NOT_SUPPORTED_ERR",
+        "INUSE_ATTRIBUTE_ERR",
+        "INVALID_STATE_ERR",
+        "SYNTAX_ERR",
+        "INVALID_MODIFICATION_ERR",
+        "NAMESPACE_ERR",
+        "INVALID_ACCESS_ERR",
+        "VALIDATION_ERR",
+        "TYPE_MISMATCH_ERR",
+    };
+
     DOMMessageFormatter() {
         locale = Locale.getDefault();
     }
@@ -109,6 +130,11 @@ public class DOMMessageFormatter {
         return msg;
     }
 
+    public static String formatMessage(String domain, int exceptionId,
+                                       Object[] arguments) throws 
MissingResourceException {
+        return formatMessage(domain, exceptionKeys[exceptionId], arguments);
+    }
+    
     static ResourceBundle getResourceBundle(String domain) {
         if (domain == DOM_DOMAIN || domain.equals(DOM_DOMAIN))
             return domResourceBundle;

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java?rev=1006318&r1=1006317&r2=1006318&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java
 Sun Oct 10 16:25:01 2010
@@ -158,7 +158,7 @@ public class DocumentImpl extends Parent
     public Attr createAttribute(String name) throws DOMException {
         if (!DOMUtil.isQualifiedName(name)) {
             String msg = DOMMessageFormatter.formatMessage(
-                    DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR",
+                    DOMMessageFormatter.DOM_DOMAIN, 
DOMException.INVALID_CHARACTER_ERR,
                     null);
             throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
         }
@@ -363,7 +363,7 @@ public class DocumentImpl extends Parent
             case Node.DOCUMENT_NODE: // Can't import document nodes
             default: { // Unknown node type
                 String msg = DOMMessageFormatter.formatMessage(
-                        DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", 
null);
+                        DOMMessageFormatter.DOM_DOMAIN, 
DOMException.NOT_SUPPORTED_ERR, null);
                 throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
             }
 
@@ -464,14 +464,14 @@ public class DocumentImpl extends Parent
         if (!validNCName) {
             // REVISIT: add qname parameter to the message
             String msg = DOMMessageFormatter.formatMessage(
-                    DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR",
+                    DOMMessageFormatter.DOM_DOMAIN, 
DOMException.INVALID_CHARACTER_ERR,
                     null);
             throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
         }
 
         if (prefix == null || prefix.equals("")) {
             String msg = DOMMessageFormatter.formatMessage(
-                    DOMMessageFormatter.DOM_DOMAIN, "NAMESPACE_ERR", null);
+                    DOMMessageFormatter.DOM_DOMAIN, 
DOMException.NAMESPACE_ERR, null);
             throw new DOMException(DOMException.NAMESPACE_ERR, msg);
         }
     }

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java?rev=1006318&r1=1006317&r2=1006318&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
 Sun Oct 10 16:25:01 2010
@@ -77,13 +77,6 @@ public class ElementImpl extends ParentN
     
     private static final OMNamespace XMLNS_NAMESPACE_WITHOUT_PREFIX = new 
NamespaceImpl(OMConstants.XMLNS_NS_URI, null);
     
-    private static final String INVALID_CHARACTER_ERR = 
"INVALID_CHARACTER_ERR";
-    private static final String NO_MODIFICATION_ALLOWED_ERR = 
"NO_MODIFICATION_ALLOWED_ERR";
-    private static final String NAMESPACE_ERR = "NAMESPACE_ERR";
-    private static final String NOT_FOUND_ERR = "NOT_FOUND_ERR";
-    private static final String WRONG_DOCUMENT_ERR = "WRONG_DOCUMENT_ERR";
-    private static final String INUSE_ATTRIBUTE_ERR = "INUSE_ATTRIBUTE_ERR";
-
     /** @param ownerDocument  ownerDocument
      *  @param tagName tagName
      *  @param factory OMFactory
@@ -249,7 +242,7 @@ public class ElementImpl extends ParentN
         if (this.isReadonly()) {
             String msg = DOMMessageFormatter.formatMessage(
                     DOMMessageFormatter.DOM_DOMAIN,
-                    ElementImpl.NO_MODIFICATION_ALLOWED_ERR, null);
+                    DOMException.NO_MODIFICATION_ALLOWED_ERR, null);
             throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                    msg);
         }
@@ -277,7 +270,7 @@ public class ElementImpl extends ParentN
         if (this.isReadonly()) {
             String msg = DOMMessageFormatter.formatMessage(
                     DOMMessageFormatter.DOM_DOMAIN,
-                    ElementImpl.NO_MODIFICATION_ALLOWED_ERR, null);
+                    DOMException.NO_MODIFICATION_ALLOWED_ERR, null);
             throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                    msg);
         }
@@ -302,14 +295,14 @@ public class ElementImpl extends ParentN
         if (isReadonly()) {
             String msg = DOMMessageFormatter.formatMessage(
                     DOMMessageFormatter.DOM_DOMAIN,
-                    ElementImpl.NO_MODIFICATION_ALLOWED_ERR, null);
+                    DOMException.NO_MODIFICATION_ALLOWED_ERR, null);
             throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                    msg);
         }
         if (this.attributes == null
                 || this.attributes.getNamedItem(oldAttr.getName()) == null) {
             String msg = DOMMessageFormatter.formatMessage(
-                    DOMMessageFormatter.DOM_DOMAIN, ElementImpl.NOT_FOUND_ERR, 
null);
+                    DOMMessageFormatter.DOM_DOMAIN, 
DOMException.NOT_FOUND_ERR, null);
             throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
         }
         return (AttrImpl) this.attributes.removeNamedItem(oldAttr
@@ -406,7 +399,7 @@ public class ElementImpl extends ParentN
         if (attrImpl.isOwned()) {// check for ownership
             if (!this.getOwnerDocument().equals(attr.getOwnerDocument())) {
                 String msg = DOMMessageFormatter.formatMessage(
-                        DOMMessageFormatter.DOM_DOMAIN, 
ElementImpl.WRONG_DOCUMENT_ERR,
+                        DOMMessageFormatter.DOM_DOMAIN, 
DOMException.WRONG_DOCUMENT_ERR,
                         null);
                 throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
             }
@@ -415,7 +408,7 @@ public class ElementImpl extends ParentN
         if (this.isReadonly()) {
             String msg = DOMMessageFormatter.formatMessage(
                     DOMMessageFormatter.DOM_DOMAIN,
-                    ElementImpl.NO_MODIFICATION_ALLOWED_ERR, null);
+                    DOMException.NO_MODIFICATION_ALLOWED_ERR, null);
             throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                    msg);
         }
@@ -424,7 +417,7 @@ public class ElementImpl extends ParentN
         if (attrImpl.isUsed()) {
             String msg = DOMMessageFormatter
                     .formatMessage(DOMMessageFormatter.DOM_DOMAIN,
-                                   ElementImpl.INUSE_ATTRIBUTE_ERR, null);
+                                   DOMException.INUSE_ATTRIBUTE_ERR, null);
             throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR, msg);
         }
 
@@ -458,7 +451,7 @@ public class ElementImpl extends ParentN
         // Check for invalid charaters
         if (!DOMUtil.isQualifiedName(name)) {
             String msg = DOMMessageFormatter.formatMessage(
-                    DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR",
+                    DOMMessageFormatter.DOM_DOMAIN, 
DOMException.INVALID_CHARACTER_ERR,
                     null);
             throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
         }
@@ -494,7 +487,7 @@ public class ElementImpl extends ParentN
                 if (!this.getOwnerDocument().equals(attr.getOwnerDocument())) {
                     String msg = DOMMessageFormatter.formatMessage(
                             DOMMessageFormatter.DOM_DOMAIN,
-                            ElementImpl.WRONG_DOCUMENT_ERR, null);
+                            DOMException.WRONG_DOCUMENT_ERR, null);
                     throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, 
msg);
                 }
             }
@@ -502,7 +495,7 @@ public class ElementImpl extends ParentN
             if (this.isReadonly()) {
                 String msg = DOMMessageFormatter.formatMessage(
                         DOMMessageFormatter.DOM_DOMAIN,
-                        ElementImpl.NO_MODIFICATION_ALLOWED_ERR, null);
+                        DOMException.NO_MODIFICATION_ALLOWED_ERR, null);
                 throw new DOMException(
                         DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
             }
@@ -510,7 +503,7 @@ public class ElementImpl extends ParentN
             // check whether the attr is in use
             if (attrImpl.isUsed()) {
                 String msg = DOMMessageFormatter.formatMessage(
-                        DOMMessageFormatter.DOM_DOMAIN, "INUSE_ATTRIBUTE_ERR",
+                        DOMMessageFormatter.DOM_DOMAIN, 
DOMException.INUSE_ATTRIBUTE_ERR,
                         null);
                 throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR, msg);
             }
@@ -566,7 +559,7 @@ public class ElementImpl extends ParentN
                                      String value) throws DOMException {
         if (!DOMUtil.isQualifiedName(qualifiedName)) {
             String msg = DOMMessageFormatter.formatMessage(
-                    DOMMessageFormatter.DOM_DOMAIN, 
ElementImpl.INVALID_CHARACTER_ERR ,
+                    DOMMessageFormatter.DOM_DOMAIN, 
DOMException.INVALID_CHARACTER_ERR ,
                     null);
             throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
         }
@@ -574,7 +567,7 @@ public class ElementImpl extends ParentN
         if (this.isReadonly()) {
             String msg = DOMMessageFormatter.formatMessage(
                     DOMMessageFormatter.DOM_DOMAIN,
-                    ElementImpl.NO_MODIFICATION_ALLOWED_ERR, null);
+                    DOMException.NO_MODIFICATION_ALLOWED_ERR, null);
             throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                    msg);
         }
@@ -585,7 +578,7 @@ public class ElementImpl extends ParentN
         if (namespaceURI != null) {
             if (!DOMUtil.isValidNamespace(namespaceURI, qualifiedName)) {
                 String msg = DOMMessageFormatter.formatMessage(
-                        DOMMessageFormatter.DOM_DOMAIN, 
ElementImpl.NAMESPACE_ERR, null);
+                        DOMMessageFormatter.DOM_DOMAIN, 
DOMException.NAMESPACE_ERR, null);
                 throw new DOMException(DOMException.NAMESPACE_ERR, msg);
             }
             // Check whether there's an existing Attr with same local name and
@@ -1071,7 +1064,7 @@ public class ElementImpl extends ParentN
         if (this.isReadonly()) {
             String msg = DOMMessageFormatter.formatMessage(
                     DOMMessageFormatter.DOM_DOMAIN,
-                    ElementImpl.NO_MODIFICATION_ALLOWED_ERR, null);
+                    DOMException.NO_MODIFICATION_ALLOWED_ERR, null);
             throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                    msg);
         }
@@ -1385,7 +1378,7 @@ public class ElementImpl extends ParentN
         if (this.isReadonly()) {
             String msg = DOMMessageFormatter.formatMessage(
                     DOMMessageFormatter.DOM_DOMAIN,
-                    ElementImpl.NO_MODIFICATION_ALLOWED_ERR, null);
+                    DOMException.NO_MODIFICATION_ALLOWED_ERR, null);
             throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                    msg);
         }
@@ -1394,7 +1387,7 @@ public class ElementImpl extends ParentN
         if (tempAttr == null) {
             String msg = DOMMessageFormatter.formatMessage(
                     DOMMessageFormatter.DOM_DOMAIN,
-                    ElementImpl.NOT_FOUND_ERR, null);
+                    DOMException.NOT_FOUND_ERR, null);
             throw new DOMException(DOMException.NOT_FOUND_ERR,
                                    msg);
         }
@@ -1407,7 +1400,7 @@ public class ElementImpl extends ParentN
         if (this.isReadonly()) {
             String msg = DOMMessageFormatter.formatMessage(
                     DOMMessageFormatter.DOM_DOMAIN,
-                    ElementImpl.NO_MODIFICATION_ALLOWED_ERR, null);
+                    DOMException.NO_MODIFICATION_ALLOWED_ERR, null);
             throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                    msg);
         }
@@ -1416,7 +1409,7 @@ public class ElementImpl extends ParentN
         if (tempAttr == null) {
             String msg = DOMMessageFormatter.formatMessage(
                     DOMMessageFormatter.DOM_DOMAIN,
-                    ElementImpl.NOT_FOUND_ERR, null);
+                    DOMException.NOT_FOUND_ERR, null);
             throw new DOMException(DOMException.NOT_FOUND_ERR,
                                    msg);
         }
@@ -1428,7 +1421,7 @@ public class ElementImpl extends ParentN
         if (this.isReadonly()) {
             String msg = DOMMessageFormatter.formatMessage(
                     DOMMessageFormatter.DOM_DOMAIN,
-                    ElementImpl.NO_MODIFICATION_ALLOWED_ERR, null);
+                    DOMException.NO_MODIFICATION_ALLOWED_ERR, null);
             throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                    msg);
         }
@@ -1446,7 +1439,7 @@ public class ElementImpl extends ParentN
         if (tempAttr == null) {
             String msg = DOMMessageFormatter.formatMessage(
                     DOMMessageFormatter.DOM_DOMAIN,
-                    ElementImpl.NOT_FOUND_ERR, null);
+                    DOMException.NOT_FOUND_ERR, null);
             throw new DOMException(DOMException.NOT_FOUND_ERR,
                                    msg);
         }

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NamedNodeMapImpl.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NamedNodeMapImpl.java?rev=1006318&r1=1006317&r2=1006318&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NamedNodeMapImpl.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NamedNodeMapImpl.java
 Sun Oct 10 16:25:01 2010
@@ -82,14 +82,14 @@ public class NamedNodeMapImpl implements
         if (isReadOnly()) {
             String msg = DOMMessageFormatter.formatMessage(
                     DOMMessageFormatter.DOM_DOMAIN,
-                    "NO_MODIFICATION_ALLOWED_ERR", null);
+                    DOMException.NO_MODIFICATION_ALLOWED_ERR, null);
             throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                    msg);
         }
         int i = findNamePoint(name, 0);
         if (i < 0) {
             String msg = DOMMessageFormatter.formatMessage(
-                    DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null);
+                    DOMMessageFormatter.DOM_DOMAIN, 
DOMException.NOT_FOUND_ERR, null);
             throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
         }
 
@@ -134,14 +134,14 @@ public class NamedNodeMapImpl implements
         if (isReadOnly()) {
             String msg = DOMMessageFormatter.formatMessage(
                     DOMMessageFormatter.DOM_DOMAIN,
-                    "NO_MODIFICATION_ALLOWED_ERR", null);
+                    DOMException.NO_MODIFICATION_ALLOWED_ERR, null);
             throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                    msg);
         }
 
         if (arg.getOwnerDocument() != ownerDocument) {
             String msg = DOMMessageFormatter.formatMessage(
-                    DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", 
null);
+                    DOMMessageFormatter.DOM_DOMAIN, 
DOMException.WRONG_DOCUMENT_ERR, null);
             throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
         }
 
@@ -185,14 +185,14 @@ public class NamedNodeMapImpl implements
         if (isReadOnly()) {
             String msg = DOMMessageFormatter.formatMessage(
                     DOMMessageFormatter.DOM_DOMAIN,
-                    "NO_MODIFICATION_ALLOWED_ERR", null);
+                    DOMException.NO_MODIFICATION_ALLOWED_ERR, null);
             throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                    msg);
         }
         int i = findNamePoint(namespaceURI, name);
         if (i < 0) {
             String msg = DOMMessageFormatter.formatMessage(
-                    DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null);
+                    DOMMessageFormatter.DOM_DOMAIN, 
DOMException.NOT_FOUND_ERR, null);
             throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
         }
 
@@ -226,13 +226,13 @@ public class NamedNodeMapImpl implements
         if (isReadOnly()) {
             String msg = DOMMessageFormatter.formatMessage(
                     DOMMessageFormatter.DOM_DOMAIN,
-                    "NO_MODIFICATION_ALLOWED_ERR", null);
+                    DOMException.NO_MODIFICATION_ALLOWED_ERR, null);
             throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                    msg);
         }
         if (arg.getOwnerDocument() != ownerDocument) {
             String msg = DOMMessageFormatter.formatMessage(
-                    DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", 
null);
+                    DOMMessageFormatter.DOM_DOMAIN, 
DOMException.WRONG_DOCUMENT_ERR, null);
             throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
         }
 

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java?rev=1006318&r1=1006317&r2=1006318&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java
 Sun Oct 10 16:25:01 2010
@@ -125,7 +125,7 @@ public abstract class NodeImpl implement
 
     public void setPrefix(String prefix) throws DOMException {
         throw new DOMException(DOMException.NAMESPACE_ERR, DOMMessageFormatter
-                .formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NAMESPACE_ERR",
+                .formatMessage(DOMMessageFormatter.DOM_DOMAIN, 
DOMException.NAMESPACE_ERR,
                                null));
     }
 
@@ -247,7 +247,7 @@ public abstract class NodeImpl implement
      */
     public Node removeChild(Node oldChild) throws DOMException {
         throw new DOMException(DOMException.NOT_FOUND_ERR, DOMMessageFormatter
-                .formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR",
+                .formatMessage(DOMMessageFormatter.DOM_DOMAIN, 
DOMException.NOT_FOUND_ERR,
                                null));
     }
 
@@ -261,7 +261,7 @@ public abstract class NodeImpl implement
         throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
                                DOMMessageFormatter.formatMessage(
                                        DOMMessageFormatter.DOM_DOMAIN,
-                                       "HIERARCHY_REQUEST_ERR", null));
+                                       DOMException.HIERARCHY_REQUEST_ERR, 
null));
 
     }
 
@@ -274,7 +274,7 @@ public abstract class NodeImpl implement
         throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
                                DOMMessageFormatter.formatMessage(
                                        DOMMessageFormatter.DOM_DOMAIN,
-                                       "HIERARCHY_REQUEST_ERR", null));
+                                       DOMException.HIERARCHY_REQUEST_ERR, 
null));
     }
 
     //
@@ -394,7 +394,7 @@ public abstract class NodeImpl implement
         throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
                                DOMMessageFormatter.formatMessage(
                                        DOMMessageFormatter.DOM_DOMAIN,
-                                       "HIERARCHY_REQUEST_ERR", null));
+                                       DOMException.HIERARCHY_REQUEST_ERR, 
null));
 
     }
 
@@ -409,7 +409,7 @@ public abstract class NodeImpl implement
         throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
                                DOMMessageFormatter.formatMessage(
                                        DOMMessageFormatter.DOM_DOMAIN,
-                                       "HIERARCHY_REQUEST_ERR", null));
+                                       DOMException.HIERARCHY_REQUEST_ERR, 
null));
 
     }
 
@@ -431,14 +431,14 @@ public abstract class NodeImpl implement
         throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
                                DOMMessageFormatter.formatMessage(
                                        DOMMessageFormatter.DOM_DOMAIN,
-                                       "HIERARCHY_REQUEST_ERR", null));
+                                       DOMException.HIERARCHY_REQUEST_ERR, 
null));
     }
 
     public void setNextOMSibling(OMNode previousSibling) {
         throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
                                DOMMessageFormatter.formatMessage(
                                        DOMMessageFormatter.DOM_DOMAIN,
-                                       "HIERARCHY_REQUEST_ERR", null));
+                                       DOMException.HIERARCHY_REQUEST_ERR, 
null));
     }
 
     /** Builds next element. */
@@ -520,7 +520,7 @@ public abstract class NodeImpl implement
         // and not an UnsupportedOperationException, since this works better 
with
         // some other libraries (such as Saxon 8.9).
         throw new DOMException(DOMException.NOT_SUPPORTED_ERR, 
DOMMessageFormatter
-                .formatMessage(DOMMessageFormatter.DOM_DOMAIN, 
"NOT_SUPPORTED_ERR", null));
+                .formatMessage(DOMMessageFormatter.DOM_DOMAIN, 
DOMException.NOT_SUPPORTED_ERR, null));
     }
 
     public String getTextContent() throws DOMException {

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java?rev=1006318&r1=1006317&r2=1006318&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java
 Sun Oct 10 16:25:01 2010
@@ -198,7 +198,7 @@ public abstract class ParentNode extends
             throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
                                    DOMMessageFormatter.formatMessage(
                                            DOMMessageFormatter.DOM_DOMAIN,
-                                           "HIERARCHY_REQUEST_ERR", null));
+                                           DOMException.HIERARCHY_REQUEST_ERR, 
null));
         }
 
         if (newDomChild.parentNode != null && newDomChild.ownerNode == 
this.ownerNode) {
@@ -211,14 +211,14 @@ public abstract class ParentNode extends
             throw new DOMException(DOMException.WRONG_DOCUMENT_ERR,
                                    DOMMessageFormatter.formatMessage(
                                            DOMMessageFormatter.DOM_DOMAIN,
-                                           "WRONG_DOCUMENT_ERR", null));
+                                           DOMException.WRONG_DOCUMENT_ERR, 
null));
         }
 
         if (this.isReadonly()) {
             throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                    DOMMessageFormatter.formatMessage(
                                            DOMMessageFormatter.DOM_DOMAIN,
-                                           "NO_MODIFICATION_ALLOWED_ERR", 
null));
+                                           
DOMException.NO_MODIFICATION_ALLOWED_ERR, null));
         }
 
         if (this instanceof Document) {
@@ -228,7 +228,7 @@ public abstract class ParentNode extends
                     throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
                                            DOMMessageFormatter.formatMessage(
                                                    
DOMMessageFormatter.DOM_DOMAIN,
-                                                   "HIERARCHY_REQUEST_ERR", 
null));
+                                                   
DOMException.HIERARCHY_REQUEST_ERR, null));
                 }
                 if (newDomChild.parentNode == null) {
                     newDomChild.parentNode = this;
@@ -242,7 +242,7 @@ public abstract class ParentNode extends
                 throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
                         DOMMessageFormatter.formatMessage(
                                 DOMMessageFormatter.DOM_DOMAIN,
-                                "HIERARCHY_REQUEST_ERR", null));
+                                DOMException.HIERARCHY_REQUEST_ERR, null));
             }
         }
         boolean compositeChild = newDomChild.nextSibling != null;
@@ -349,7 +349,7 @@ public abstract class ParentNode extends
                 throw new DOMException(DOMException.NOT_FOUND_ERR,
                                        DOMMessageFormatter.formatMessage(
                                                DOMMessageFormatter.DOM_DOMAIN,
-                                               "NOT_FOUND_ERR", null));
+                                               DOMException.NOT_FOUND_ERR, 
null));
             }
 
             if (newDomChild.parentNode == null) {
@@ -373,7 +373,7 @@ public abstract class ParentNode extends
             throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
                                    DOMMessageFormatter.formatMessage(
                                            DOMMessageFormatter.DOM_DOMAIN,
-                                           "HIERARCHY_REQUEST_ERR", null));
+                                           DOMException.HIERARCHY_REQUEST_ERR, 
null));
         }
 
         if (newDomChild != null &&
@@ -384,14 +384,14 @@ public abstract class ParentNode extends
             throw new DOMException(DOMException.WRONG_DOCUMENT_ERR,
                                    DOMMessageFormatter.formatMessage(
                                            DOMMessageFormatter.DOM_DOMAIN,
-                                           "WRONG_DOCUMENT_ERR", null));
+                                           DOMException.WRONG_DOCUMENT_ERR, 
null));
         }
 
         if (this.isReadonly()) {
             throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                    DOMMessageFormatter.formatMessage(
                                            DOMMessageFormatter.DOM_DOMAIN,
-                                           "NO_MODIFICATION_ALLOWED_ERR", 
null));
+                                           
DOMException.NO_MODIFICATION_ALLOWED_ERR, null));
         }
 
         Iterator children = this.getChildren();
@@ -458,7 +458,7 @@ public abstract class ParentNode extends
         if (!found)
             throw new DOMException(DOMException.NOT_FOUND_ERR,
                                    DOMMessageFormatter.formatMessage(
-                                           DOMMessageFormatter.DOM_DOMAIN, 
"NOT_FOUND_ERR",
+                                           DOMMessageFormatter.DOM_DOMAIN, 
DOMException.NOT_FOUND_ERR,
                                            null));
 
         return oldChild;
@@ -471,7 +471,7 @@ public abstract class ParentNode extends
             throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                    DOMMessageFormatter.formatMessage(
                                            DOMMessageFormatter.DOM_DOMAIN,
-                                           "NO_MODIFICATION_ALLOWED_ERR", 
null));
+                                           
DOMException.NO_MODIFICATION_ALLOWED_ERR, null));
         }
 
         // Check if the Child is there
@@ -519,7 +519,7 @@ public abstract class ParentNode extends
         if (!childFound)
             throw new DOMException(DOMException.NOT_FOUND_ERR,
                                    DOMMessageFormatter.formatMessage(
-                                           DOMMessageFormatter.DOM_DOMAIN, 
"NOT_FOUND_ERR",
+                                           DOMMessageFormatter.DOM_DOMAIN, 
DOMException.NOT_FOUND_ERR,
                                            null));
 
         return oldChild;

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ProcessingInstructionImpl.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ProcessingInstructionImpl.java?rev=1006318&r1=1006317&r2=1006318&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ProcessingInstructionImpl.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ProcessingInstructionImpl.java
 Sun Oct 10 16:25:01 2010
@@ -84,7 +84,7 @@ public class ProcessingInstructionImpl e
             throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                    DOMMessageFormatter.formatMessage(
                                            DOMMessageFormatter.DOM_DOMAIN,
-                                           "NO_MODIFICATION_ALLOWED_ERR", 
null));
+                                           
DOMException.NO_MODIFICATION_ALLOWED_ERR, null));
         }
     }
     

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextNodeImpl.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextNodeImpl.java?rev=1006318&r1=1006317&r2=1006318&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextNodeImpl.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextNodeImpl.java
 Sun Oct 10 16:25:01 2010
@@ -245,12 +245,12 @@ public abstract class TextNodeImpl exten
             throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                     DOMMessageFormatter.formatMessage(
                             DOMMessageFormatter.DOM_DOMAIN,
-                            "NO_MODIFICATION_ALLOWED_ERR", null));
+                            DOMException.NO_MODIFICATION_ALLOWED_ERR, null));
         }
         if (offset < 0 || offset > this.textValue.length()) {
             throw new DOMException(DOMException.INDEX_SIZE_ERR,
                     DOMMessageFormatter.formatMessage(
-                            DOMMessageFormatter.DOM_DOMAIN, "INDEX_SIZE_ERR",
+                            DOMMessageFormatter.DOM_DOMAIN, 
DOMException.INDEX_SIZE_ERR,
                             null));
         }
         String newValue = this.textValue.substring(offset);


Reply via email to