You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2005/06/19 23:43:49 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/parsers DOMParser.java

mrglavas    2005/06/19 14:43:49

  Modified:    java/src/org/apache/xerces/parsers DOMParser.java
  Log:
  Formatting error messages provided for SAXNotRecognizedException and SAXNotSupportedException.
  
  Revision  Changes    Path
  1.75      +30 -13    xml-xerces/java/src/org/apache/xerces/parsers/DOMParser.java
  
  Index: DOMParser.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/DOMParser.java,v
  retrieving revision 1.74
  retrieving revision 1.75
  diff -u -r1.74 -r1.75
  --- DOMParser.java	4 May 2005 03:56:45 -0000	1.74
  +++ DOMParser.java	19 Jun 2005 21:43:49 -0000	1.75
  @@ -22,6 +22,7 @@
   import org.apache.xerces.util.EntityResolverWrapper;
   import org.apache.xerces.util.EntityResolver2Wrapper;
   import org.apache.xerces.util.ErrorHandlerWrapper;
  +import org.apache.xerces.util.SAXMessageFormatter;
   import org.apache.xerces.util.SymbolTable;
   import org.apache.xerces.xni.XNIException;
   import org.apache.xerces.xni.grammars.XMLGrammarPool;
  @@ -412,12 +413,16 @@
               fConfiguration.setFeature(featureId, state);
           }
           catch (XMLConfigurationException e) {
  -            String message = e.getMessage();
  +            String identifier = e.getIdentifier();
               if (e.getType() == XMLConfigurationException.NOT_RECOGNIZED) {
  -                throw new SAXNotRecognizedException(message);
  +                throw new SAXNotRecognizedException(
  +                    SAXMessageFormatter.formatMessage(fConfiguration.getLocale(), 
  +                    "feature-not-recognized", new Object [] {identifier}));
               }
               else {
  -                throw new SAXNotSupportedException(message);
  +                throw new SAXNotSupportedException(
  +                    SAXMessageFormatter.formatMessage(fConfiguration.getLocale(), 
  +                    "feature-not-supported", new Object [] {identifier}));
               }
           }
   
  @@ -457,12 +462,16 @@
               return fConfiguration.getFeature(featureId);
           }
           catch (XMLConfigurationException e) {
  -            String message = e.getMessage();
  +            String identifier = e.getIdentifier();
               if (e.getType() == XMLConfigurationException.NOT_RECOGNIZED) {
  -                throw new SAXNotRecognizedException(message);
  +                throw new SAXNotRecognizedException(
  +                    SAXMessageFormatter.formatMessage(fConfiguration.getLocale(), 
  +                    "feature-not-recognized", new Object [] {identifier}));
               }
               else {
  -                throw new SAXNotSupportedException(message);
  +                throw new SAXNotSupportedException(
  +                    SAXMessageFormatter.formatMessage(fConfiguration.getLocale(), 
  +                    "feature-not-supported", new Object [] {identifier}));
               }
           }
   
  @@ -490,12 +499,16 @@
               fConfiguration.setProperty(propertyId, value);
           }
           catch (XMLConfigurationException e) {
  -            String message = e.getMessage();
  +            String identifier = e.getIdentifier();
               if (e.getType() == XMLConfigurationException.NOT_RECOGNIZED) {
  -                throw new SAXNotRecognizedException(message);
  +                throw new SAXNotRecognizedException(
  +                    SAXMessageFormatter.formatMessage(fConfiguration.getLocale(), 
  +                    "property-not-recognized", new Object [] {identifier}));
               }
               else {
  -                throw new SAXNotSupportedException(message);
  +                throw new SAXNotSupportedException(
  +                    SAXMessageFormatter.formatMessage(fConfiguration.getLocale(), 
  +                    "property-not-supported", new Object [] {identifier}));
               }
           }
   
  @@ -537,12 +550,16 @@
               return fConfiguration.getProperty(propertyId);
           }
           catch (XMLConfigurationException e) {
  -            String message = e.getMessage();
  +            String identifier = e.getIdentifier();
               if (e.getType() == XMLConfigurationException.NOT_RECOGNIZED) {
  -                throw new SAXNotRecognizedException(message);
  +                throw new SAXNotRecognizedException(
  +                    SAXMessageFormatter.formatMessage(fConfiguration.getLocale(), 
  +                    "property-not-recognized", new Object [] {identifier}));
               }
               else {
  -                throw new SAXNotSupportedException(message);
  +                throw new SAXNotSupportedException(
  +                    SAXMessageFormatter.formatMessage(fConfiguration.getLocale(), 
  +                    "property-not-supported", new Object [] {identifier}));
               }
           }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org