CVS 2002/css-validator/org/w3c/css/util

Update of /sources/public/2002/css-validator/org/w3c/css/util
In directory roscoe:/tmp/cvs-serv24782/org/w3c/css/util

Modified Files:
	InvalidParamException.java 
Log Message:
make the error type (used as they key to generate the message) accessible in the CssError class

--- /sources/public/2002/css-validator/org/w3c/css/util/InvalidParamException.java	2011/09/17 06:02:27	1.12
+++ /sources/public/2002/css-validator/org/w3c/css/util/InvalidParamException.java	2013/04/09 14:55:04	1.13
@@ -1,5 +1,5 @@
 //
-// $Id: InvalidParamException.java,v 1.12 2011/09/17 06:02:27 ylafon Exp $
+// $Id: InvalidParamException.java,v 1.13 2013/04/09 14:55:04 ylafon Exp $
 // From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
 //
 // (c) COPYRIGHT MIT and INRIA, 1997.
@@ -10,9 +10,10 @@
 import org.w3c.css.parser.analyzer.ParseException;
 
 /**
- * @version $Revision: 1.12 $
+ * @version $Revision: 1.13 $
  */
 public class InvalidParamException extends ParseException {
+	String errorType = null;
 
     /**
      * Create a new InvalidParamException.
@@ -28,6 +29,7 @@
      */
     public InvalidParamException(String message, ApplContext ac) {
         super(ac.getMsg().getErrorString((message != null) ? message : ""));
+		errorType = message;
     }
 
     /**
@@ -38,6 +40,7 @@
      */
     public InvalidParamException(String error, Object message, ApplContext ac) {
         super(processError(error, (message != null) ? message : null, ac));
+		errorType = error;
     }
 
     /**
@@ -48,6 +51,7 @@
      */
     public InvalidParamException(String error, String[] args, ApplContext ac) {
         super(processError(error, args, ac));
+		errorType = error;
     }
 
     /**
@@ -63,8 +67,17 @@
                 (message1 != null) ? message1.toString() : null,
                 (message2 != null) ? message2.toString() : null,
                 ac));
+		errorType = error;
     }
 
+	/**
+	 * Get the error type if defined
+	 * @return a String or null if undefined
+	 */
+	public String getErrorType() {
+		return errorType;
+	}
+
     private static String processError(String error, String[] args, ApplContext ac) {
         StringBuilder sb = new StringBuilder();
         String str = null;

Received on Tuesday, 9 April 2013 14:55:10 UTC