W3C home > Mailing lists > Public > www-validator-cvs@w3.org > February 2009

2002/css-validator/org/w3c/css/parser CssError.java,1.5,1.6 CssSelectors.java,1.27,1.28

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Wed, 25 Feb 2009 20:44:51 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1LcQcd-0000sT-VM@lionel-hutz.w3.org>
Update of /sources/public/2002/css-validator/org/w3c/css/parser
In directory hutz:/tmp/cvs-serv3171/org/w3c/css/parser

Modified Files:
	CssError.java CssSelectors.java 
Log Message:
Fixes http://www.w3.org/Bugs/Public/show_bug.cgi?id=5770
Added accessors to get X/HTML escaped versions of differents String
(like URL representation, selectors, warning messages, etc).
The markup-based output were modified accordingly.



Index: CssSelectors.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/CssSelectors.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- CssSelectors.java	12 Feb 2009 21:26:34 -0000	1.27
+++ CssSelectors.java	25 Feb 2009 20:44:49 -0000	1.28
@@ -32,6 +32,7 @@
 import org.w3c.css.selectors.pseudofunctions.PseudoFunctionNthOfType;
 import org.w3c.css.util.ApplContext;
 import org.w3c.css.util.InvalidParamException;
+import org.w3c.css.util.Messages;
 import org.w3c.css.util.Util;
 import org.w3c.css.util.Warnings;
 
@@ -340,6 +341,12 @@
 	cachedRepresentation = sbrep.toString();
 	return cachedRepresentation;
     }
+    /**
+     * return XML escaped string
+     */
+    public String getEscaped() {
+	return Messages.escapeString(toString());
+    }
 
     public boolean isToStringCached() {
 	if (cachedRepresentation == null) {

Index: CssError.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/CssError.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- CssError.java	10 Dec 2008 15:10:15 -0000	1.5
+++ CssError.java	25 Feb 2009 20:44:49 -0000	1.6
@@ -7,6 +7,8 @@
 
 package org.w3c.css.parser;
 
+import org.w3c.css.util.Messages;
+
 /**
  * This class represents an unknown error during the parse.
  *
@@ -14,67 +16,75 @@
  */
 public class CssError {
 
-  /**
-   * The source file
-   */
-  String sourceFile;
+    /**
+     * The source file
+     */
+    String sourceFile;
 
-  /**
-   * The line number in the file
-   */
-  int line;
+    /**
+     * The line number in the file
+     */
+    int line;
 
-  /**
-   * The unknown error
-   */
-  Throwable error;
+    /**
+     * The unknown error
+     */
+    Throwable error;
 
-  /**
-   * Create a new CssError
-   */
-  public CssError() {
-  }
+    /**
+     * Create a new CssError
+     */
+    public CssError() {
+    }
 
-  /**
-   * Create a new CssError
-   *
-   * @param sourceFile The source file
-   * @param line       The error line number
-   * @param error      The exception
-   */
-  public CssError(String sourceFile, int line, Throwable error) {
-    this.sourceFile = sourceFile;
-    this.line = line;
-    this.error = error;
-  }
+    /**
+     * Create a new CssError
+     *
+     * @param sourceFile The source file
+     * @param line       The error line number
+     * @param error      The exception
+     */
+    public CssError(String sourceFile, int line, Throwable error) {
+	this.sourceFile = sourceFile;
+	this.line = line;
+	this.error = error;
+    }
 
-  /**
-   * Create a new CssError
-   *
-   * @param error      The exception
-   */
-  public CssError(Throwable error) {
-    this.error = error;
-  }
+    /**
+     * Create a new CssError
+     *
+     * @param error      The exception
+     */
+    public CssError(Throwable error) {
+	this.error = error;
+    }
 
-  /**
-   * Get the source file
-   */
-  public String getSourceFile() {
-    return sourceFile;
-  }
+    /**
+     * Get the source file
+     */
+    public String getSourceFile() {
+	return sourceFile;
+    }
 
-  /**
-   * get the line number
-   */
-  public int getLine() {
-    return line;
-  }
+    /**
+     * Get the source file
+     */
+    public String getSourceFileEscaped() {
+	return Messages.escapeString(sourceFile);
+    }
 
-  /**
-   * get the unknown error
-   */
-  public Throwable getException() {
-    return error;
-  }
+    
+    /**
+     * get the line number
+     */
+    public int getLine() {
+	return line;
+    }
+
+    /**
+     * get the unknown error
+     */
+    public Throwable getException() {
+	return error;
+    }
 }
Received on Wednesday, 25 February 2009 20:45:00 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:55:08 GMT