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

2006/unicorn/src/org/w3c/unicorn/output SimpleOutputModule.java,1.8,1.9

From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
Date: Tue, 29 Sep 2009 16:07:59 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1MsfF9-0001js-JY@lionel-hutz.w3.org>
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/output
In directory hutz:/tmp/cvs-serv6670/src/org/w3c/unicorn/output

Modified Files:
	SimpleOutputModule.java 
Log Message:
refactored with new OutputModule class


Index: SimpleOutputModule.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/output/SimpleOutputModule.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- SimpleOutputModule.java	24 Sep 2009 15:30:49 -0000	1.8
+++ SimpleOutputModule.java	29 Sep 2009 16:07:57 -0000	1.9
@@ -7,38 +7,27 @@
 import java.io.Writer;
 import java.util.Map;
 
-import org.w3c.unicorn.output.OutputFactory;
-
 /**
  * This module allow to generate output in text format.
  * 
  * @author Damien LEROY
  */
 public class SimpleOutputModule extends OutputModule {
-
-	private  OutputFormater aOutputFormater;
 	
 	public SimpleOutputModule(Map<String, String> mapOfOutputParameters, Map<String, String> mapOfSpecificParameters) {
 		super(mapOfOutputParameters, mapOfSpecificParameters);
-		
-		aOutputFormater = OutputFactory.createOutputFormater(mapOfOutputParameters.get("format"),
-				mapOfOutputParameters.get("lang"), mapOfOutputParameters.get("mimetype"));
 	}
 	
 	public void produceOutput(Map<String, Object> mapOfStringObject, final Writer aWriter) {
-		aOutputFormater.produceOutput(mapOfStringObject, aWriter);
+		defaultOutputFormater.produceOutput(mapOfStringObject, aWriter);
 	}
 
 	public void produceError(Map<String, Object> mapOfStringObject, final Writer aWriter) {
-		if (outputParameters.get("mimetype").equals("text/html")) {
+		if (getMimeType().equals("text/html")) {
 			displayOnIndex(mapOfStringObject, aWriter);
 			return;
 		}
-		aOutputFormater.produceError(mapOfStringObject, aWriter);
-	}
-
-	public void produceFirstOutput(Map<String, Object> mapOfStringObject, Writer aWriter) {
-		return;
+		defaultOutputFormater.produceError(mapOfStringObject, aWriter);
 	}
 	
 }
Received on Tuesday, 29 September 2009 16:08:08 GMT

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