2006/unicorn/src/org/w3c/unicorn/output OutputFormater.java,1.6,1.7

Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/output
In directory hutz:/tmp/cvs-serv5449/src/org/w3c/unicorn/output

Modified Files:
	OutputFormater.java 
Log Message:
changed to abstract class
+ added lang, format, mimetype variables

Index: OutputFormater.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/output/OutputFormater.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- OutputFormater.java	21 Sep 2009 15:50:19 -0000	1.6
+++ OutputFormater.java	29 Sep 2009 16:03:31 -0000	1.7
@@ -9,6 +9,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.w3c.unicorn.util.Property;
 
 /**
  * SimpleOutputFormater<br />
@@ -16,8 +17,24 @@
  * 
  * @author Jean-Guilhem Rouel
  */
-public interface OutputFormater {
+public abstract class OutputFormater {
 
+	protected String mimeType;
+	
+	protected String format;
+	
+	protected String lang;
+	
+	public OutputFormater(String format, String lang) {
+		logger.trace("Constructor");
+		logger.debug("Output format : " + format + ".");
+		logger.debug("Output language : " + lang + ".");
+		
+		this.mimeType = Property.getProps("output.properties").getProperty(format + ".mimetype");
+		this.format = format;
+		this.lang = lang;
+	}
+	
 	public static final Log logger = LogFactory.getLog(OutputFormater.class);
 	
 	/**
@@ -30,6 +47,18 @@
 	 * @param messages 
 	 * @param aWriter
 	 */
-	public abstract void produceError(Map<String, Object> mapOfStringObject, Writer output);
+	public abstract void produceError(Map<String, Object> mapOfStringObject, Writer output);	
+
+	public String getMimeType() {
+		return mimeType;
+	}
+	
+	public String getLang() {
+		return lang;
+	}
+
+	public String getFormat() {
+		return format;
+	}
 
 }
\ No newline at end of file

Received on Tuesday, 29 September 2009 16:03:43 UTC