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

2002/css-validator/org/w3c/css/css CssRuleList.java,1.17,1.18 CssStyleRule.java,1.16,1.17 StyleSheetGenerator.java,1.26,1.27

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Tue, 24 Feb 2009 21:45:16 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1Lc55Y-0006tU-MI@lionel-hutz.w3.org>
Update of /sources/public/2002/css-validator/org/w3c/css/css
In directory hutz:/tmp/cvs-serv25796/org/w3c/css/css

Modified Files:
	CssRuleList.java CssStyleRule.java StyleSheetGenerator.java 
Log Message:
minor changes


Index: CssStyleRule.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/css/CssStyleRule.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- CssStyleRule.java	30 Jul 2007 11:35:52 -0000	1.16
+++ CssStyleRule.java	24 Feb 2009 21:45:14 -0000	1.17
@@ -11,79 +11,83 @@
 
 public class CssStyleRule {
 
-	public CssStyleRule(String indent, String selectors, Vector properties, boolean important) {
-		this.selectors = selectors;
-		this.properties = properties;
-		this.indent = indent;
-	}
-	/**
-	 * This function is only used inside the velocity template
-	 * @return the list of selectors in a string
-	 */
-	public String getSelectors() {
-		return selectors;
-	}
+    public CssStyleRule(String indent, String selectors, 
+			Vector properties, boolean important) 
+    {
+	this.selectors = selectors;
+	this.properties = properties;
+	this.indent = indent;
+    }
+    /**
+     * This function is only used inside the velocity template
+     * @return the list of selectors in a string
+     */
+    public String getSelectors() {
+	return selectors;
+    }
 	
-	/**
-	 * This function is only used inside the velocity template
-	 * @return the list of properties in a Vector
-	 */
-	public Vector getProperties() {
-		return properties;
-	}
+    /**
+     * This function is only used inside the velocity template
+     * @return the list of properties in a Vector
+     */
+    public Vector getProperties() {
+	return properties;
+    }
 
-	public String toString() {
-		StringBuffer ret = new StringBuffer();
-		if (selectors != null) {
-			ret.append(selectors);
-			ret.append(' ');
-			ret.append('{');
-			ret.append('\n');
-		}
+    public String toString() {
+	StringBuilder ret = new StringBuilder();
+	if (selectors != null) {
+	    ret.append(selectors);
+	    ret.append(' ');
+	    ret.append('{');
+	    ret.append('\n');
+	}
 
-		for (int i = 0; i < properties.size(); i++) {
-			CssProperty property = (CssProperty) properties.elementAt(i);
-			ret.append(indent);
-			ret.append("   ");
-			ret.append(property.getPropertyName());
-			ret.append(" : ");
-			ret.append(property.toString());
-			if (property.getImportant()) {
-				ret.append(" important");
-			}
-			ret.append(';');
-			ret.append('\n');
-		}
-		if (selectors != null) {
-			ret.append(indent);
-			ret.append('}');
-			ret.append('\n');
-			ret.append('\n');
-		}
-		return ret.toString();
+	for (int i = 0; i < properties.size(); i++) {
+	    CssProperty property = (CssProperty) properties.elementAt(i);
+	    ret.append(indent);
+	    ret.append("   ");
+	    ret.append(property.getPropertyName());
+	    ret.append(" : ");
+	    ret.append(property.toString());
+	    if (property.getImportant()) {
+		ret.append(" important");
+	    }
+	    ret.append(';');
+	    ret.append('\n');
 	}
+	if (selectors != null) {
+	    ret.append(indent);
+	    ret.append('}');
+	    ret.append('\n');
+	    ret.append('\n');
+	}
+	return ret.toString();
+    }
 
-	/*
-	 * public String toHTML() { StringBuffer ret = new StringBuffer("<li><span
-	 * class='selector'>"); if (selectors != null) { ret.append(selectors);
-	 * ret.append("</span> {<ul class='vRule'>\n"); }
-	 * 
-	 * for (int i = 0; i < properties.size() ; i++) { CssProperty property =
-	 * (CssProperty)properties.elementAt(i); ret.append("<li>");
-	 * ret.append(property.getPropertyName()); ret.append(" : <span
-	 * class='vPropertyValue'>"); ret.append(property.toString()); ret.append("</span>");
-	 * if (property.getImportant()) { ret.append(" !important"); } ret.append(";</li>\n"); }
-	 * ret.append("</ul>}</li>\n\n"); return ret.toString(); }
-	 */
+    /*
+     * public String toHTML() { StringBuffer ret = new StringBuffer("<li><span
+     * class='selector'>"); if (selectors != null) { ret.append(selectors);
+     * ret.append("</span> {<ul class='vRule'>\n"); }
+     * 
+     * for (int i = 0; i < properties.size() ; i++) { CssProperty property =
+     * (CssProperty)properties.elementAt(i); ret.append("<li>");
+     * ret.append(property.getPropertyName()); ret.append(" : <span
+     * class='vPropertyValue'>"); ret.append(property.toString());
+     * ret.append("</span>");
+     * if (property.getImportant()) { ret.append(" !important"); } 
+     * ret.append(";</li>\n"); }
+     * ret.append("</ul>}</li>\n\n"); return ret.toString(); }
+     */
 	
-	/**
-	 * This method returns a part of the style sheet to be displayed
-	 * Some identation (\t) was necessary to maintain the correct formatting
-	 * of the html output.
-	 */
+    /**
+     * This method returns a part of the style sheet to be displayed
+     * Some identation (\t) was necessary to maintain the correct formatting
+     * of the html output.
+     */
 
-	private String indent;
-	private String selectors;
-	private Vector properties;
+    private String indent;
+    private String selectors;
+    private Vector properties;
 
 }

Index: StyleSheetGenerator.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/css/StyleSheetGenerator.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- StyleSheetGenerator.java	17 Feb 2009 13:25:23 -0000	1.26
+++ StyleSheetGenerator.java	24 Feb 2009 21:45:14 -0000	1.27
@@ -356,7 +356,7 @@
 				       Hashtable<String,Object> ht_error) {
         if (error.getContexts() != null && error.getContexts().size() != 0) {
             ht_error.put("CtxName", "codeContext");
-            StringBuffer buf = new StringBuffer();
+            StringBuilder buf = new StringBuilder();
             // Loop on the list of contexts for errors
 	    Enumeration e;
             for (e = error.getContexts().elements(); e.hasMoreElements();) {

Index: CssRuleList.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/css/CssRuleList.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- CssRuleList.java	31 Jul 2007 09:59:37 -0000	1.17
+++ CssRuleList.java	24 Feb 2009 21:45:14 -0000	1.18
@@ -11,61 +11,61 @@
 
 public class CssRuleList {
 
-	AtRule atRule;
-	String atRuleString;
-	Vector rulelist;
-	public String pseudopage;
-	String indent;
+    AtRule atRule;
+    String atRuleString;
+    Vector rulelist;
+    public String pseudopage;
+    String indent;
 
-	public CssRuleList() {
-		atRule = null;
-		atRuleString = new String();
-		rulelist = new Vector();
-		indent = new String();
-	}
+    public CssRuleList() {
+	atRule = null;
+	atRuleString = new String();
+	rulelist = new Vector();
+	indent = new String();
+    }
 
-	public void addStyleRule(CssStyleRule stylerule) {
-		rulelist.addElement(stylerule);
-	}
+    public void addStyleRule(CssStyleRule stylerule) {
+	rulelist.addElement(stylerule);
+    }
 
-	public Vector getStyleRules() {
-		return rulelist;
-	}
+    public Vector getStyleRules() {
+	return rulelist;
+    }
 
-	public void addAtRule(AtRule atRule) {
-		this.atRule = atRule;
-		atRuleString = atRule.toString();
-	}
+    public void addAtRule(AtRule atRule) {
+	this.atRule = atRule;
+	atRuleString = atRule.toString();
+    }
 
-	public String getAtRule() {
-		return atRuleString;
-	}
+    public String getAtRule() {
+	return atRuleString;
+    }
 	
-	public boolean isEmpty() {
-		return rulelist.isEmpty();
-	}
+    public boolean isEmpty() {
+	return rulelist.isEmpty();
+    }
 
-	public String toString() {
-		StringBuffer ret = new StringBuffer();
-		if (null != atRule && atRule.isEmpty()) {
-			if (!atRuleString.equals("")) {
-				ret.append(atRuleString);
-				ret.append("\n\n");
-			}
-		} else {
-			if (!atRuleString.equals("")) {
-				ret.append(atRuleString);
-				ret.append(" {\n\n");
-			}
-			for (int i = 0; i < rulelist.size(); i++) {
-				ret.append((CssStyleRule) rulelist.elementAt(i));
-			}
+    public String toString() {
+	StringBuilder ret = new StringBuilder();
+	if (null != atRule && atRule.isEmpty()) {
+	    if (!atRuleString.equals("")) {
+		ret.append(atRuleString);
+		ret.append("\n\n");
+	    }
+	} else {
+	    if (!atRuleString.equals("")) {
+		ret.append(atRuleString);
+		ret.append(" {\n\n");
+	    }
+	    for (int i = 0; i < rulelist.size(); i++) {
+		ret.append((CssStyleRule) rulelist.elementAt(i));
+	    }
 
-			if (!atRuleString.equals("")) {
-				ret.append("}\n");
-			}
-		}
-		return ret.toString();
+	    if (!atRuleString.equals("")) {
+		ret.append("}\n");
+	    }
 	}
+	return ret.toString();
+    }
 
 }
Received on Tuesday, 24 February 2009 21:45:25 GMT

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