/* * Created on 30 nov. 2004 * */ package fr.lifl.stc.stan.tools; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; import fr.lifl.stc.stan.analyser.Config; //import fr.lifl.rd2p.jits.tools.ea.analyser.Config; /** * @author ryl * */ public class HTMLOutput { static private PrintWriter file; public static void openHTMLOutput (String className) throws IOException { if (!Config.htmlEnabled()) return; file = new PrintWriter (new FileWriter(""+className + "-dump.html")); file.print(head(className)); } private static String head (String name){ return "\n\n" +name +"\n\n\n\n

" +name+"

\n"; } public static void appendln(String s){ if (!Config.htmlEnabled()) return; file.println(s); } public static void append(String s){ if (!Config.htmlEnabled()) return; file.print(s); } public static void newMethod(String methodName,String methodSignature) { if (!Config.htmlEnabled()) return; if (methodName.equals("")) file.println("

" + "<init>" + "

"+methodSignature+"

\n"); else file.println("

" + methodName + "

"+methodSignature+"

\n"); } public static void newMethod (String methodName){ if (!Config.htmlEnabled()) return; if (methodName.equals("")) file.println("

" + "<init>" + "

\n

\n"); else file.println("

" + methodName + "

\n

\n"); } public static void closeHTMLOutput(){ if (!Config.htmlEnabled()) return; file.print("\n\n"); file.close(); } }