2002/css-validator/org/w3c/css/css StyleReportFactory.java,1.9,1.10

Update of /sources/public/2002/css-validator/org/w3c/css/css
In directory hutz:/tmp/cvs-serv10979/org/w3c/css/css

Modified Files:
	StyleReportFactory.java 
Log Message:
We are now using StyleSheetGenerator for all the outputs (using Velocity)
The StyleReportFactory is now only checking if the output is available
If yes, it displays the desired output
Otherwise, it displays the XHTML output

Index: StyleReportFactory.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/css/StyleReportFactory.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- StyleReportFactory.java	13 Jul 2007 13:32:19 -0000	1.9
+++ StyleReportFactory.java	30 Jul 2007 11:40:04 -0000	1.10
@@ -13,12 +13,9 @@
 	 * Give back a "StyleReport" object based on various parameters, but mainly
 	 * output"
 	 */
-	public static StyleReport getStyleReport(ApplContext ac, String title,
-			StyleSheet style, String document, int warningLevel) {
-		if (document.equals("text"))
-			return new StyleSheetGenerator(title, style, document, warningLevel);
-		if (document.equals("soap12") || document.equals("ucn") || document.equals("xml"))
-			return new StyleSheetGeneratorHTML(ac, title, style, document, warningLevel);
-		return new StyleSheetGeneratorHTML(ac, title, style, "xhtml", warningLevel);
+	public static StyleReport getStyleReport(ApplContext ac, String title, StyleSheet style, String document,
+			int warningLevel) {
+		String output = (StyleSheetGenerator.isAvailableFormat(document)) ? document : "xhtml";
+		return new StyleSheetGenerator(ac, title, style, output, warningLevel);
 	}
 }

Received on Monday, 30 July 2007 11:40:19 UTC