From 4991b20f3068812f8a1f2dff16f9b9ed745ee403 Mon Sep 17 00:00:00 2001 From: fotis Date: Tue, 1 Aug 2000 22:36:28 +0000 Subject: [PATCH] update: use Messagehandler instead of System.err.println git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193572 13f79535-47bb-0310-9956-ffa450edef68 --- lib/Fop.class | Bin 3980 -> 3926 bytes lib/Fop.java | 29 ++++++++++++++++------------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/lib/Fop.class b/lib/Fop.class index 9fd7c437d41031593b4ebeae558b776af6b07178..bbb65d17bd55ffea9fd2bb8b93245c641b7fc333 100644 GIT binary patch delta 1759 zcmZ9MiC#h3i7Ja~f)+I_QKHtM&Y<38sak)* zV42BsgBML!7`$ZCV6f66nN>=JOjcX0;bn`^8rCZF6&3SUgLMY$Ox7;1(0tWUD20Z!_6$vZEVGykqdLNu$Y5)yR7WyDYL* z7rT|-W3ty`N;dDC>@)blV86v=6@3y16yTr=cSu@~;TNe9-Q#^x;N+(hq$z8XnWf=esQQmcdYsf#MA%TjGV zrO2J`k>@HZ}T}9Y%X%i<_j*{gz0c|^)cQ;zI0dU zMZT|WuF&e<&?kDY^0nJ9VS;xq^V~TJrQUD&);*oD&iftTySct;-XHkU-RR5kUX#3M zeX|D?a^22u(?8U}GH{G0@Ib0aYDybT+Rlz#(7YoZhU5wvD8H0H!X#6V9`6o(F#U@Dx?Kk5{o|FKqVbv_9! z5M*&2A3~x&P%1kGC<5M5$$? z$W8QMGrieDDlX|#_e8b{dWWEQ3i@do6_1)HtxBrSSNv#@ZIAbRH(Fku*K0^PEO^*>_Lp1}Dmxf{aTNYHSoo&&hDc>8*_Sa)?l` zY~8s}R-OBmE6M{Yjf&T78Kw!@da~~1NIerpKN#jAQ4hydJClT_$;DElH^P(%kA%rh z)-zPeQKp8OmaK=#Q{vG>q}>`8XS&p+R%gU(3*AiW8osb9-iO|Y=+Sniu-zLsTv~%o|x9xyD uX~#HEi@abRT;Mt*F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$-`KHWo$5kvSWdttacwaH;Jck@tqVPsE6*h%i!E8|7Ce zHgJCf4}=+=tY@k68yOR3Y_cBaK?R|4HKezlA17A|RGPeNg{r*5h?6fh9FxCjIjdRA zoiYc1@F(MAyqA$8yzdtM9wBqD==U>L8X3m{nVf?%Plu`C2utPaUCwcd5XL31f$egC z?j#~E%^c#Cs7}k*8P3X`c~$T?xi)|2oTNIhIkaerT+mXv$m5bum*j==&XTo<+5Z5V CI*rZ% diff --git a/lib/Fop.java b/lib/Fop.java index 03d7debf6..2b9b7d539 100644 --- a/lib/Fop.java +++ b/lib/Fop.java @@ -52,7 +52,7 @@ // Ant import org.apache.tools.ant.Task; import org.apache.tools.ant.BuildException; -import org.apache.fop.apps.*; + // SAX import org.xml.sax.XMLReader; @@ -69,6 +69,9 @@ import java.io.IOException; import java.io.FileNotFoundException; import java.net.URL; +// FOP +import org.apache.fop.messaging.MessageHandler; +import org.apache.fop.apps.*; /** * extension to Ant which allows usage of Fop in the @@ -110,20 +113,20 @@ public class Fop { if (parserClassName == null) { parserClassName = "org.apache.xerces.parsers.SAXParser"; } - System.out.println("using SAX parser " + parserClassName); + MessageHandler.logln("using SAX parser " + parserClassName); try { return (XMLReader) Class.forName(parserClassName).newInstance(); } catch (ClassNotFoundException e) { - System.err.println("Could not find " + parserClassName); + MessageHandler.errorln("Could not find " + parserClassName); } catch (InstantiationException e) { - System.err.println("Could not instantiate " + MessageHandler.errorln("Could not instantiate " + parserClassName); } catch (IllegalAccessException e) { - System.err.println("Could not access " + parserClassName); + MessageHandler.errorln("Could not access " + parserClassName); } catch (ClassCastException e) { - System.err.println(parserClassName + " is not a SAX driver"); + MessageHandler.errorln(parserClassName + " is not a SAX driver"); } return null; } // end: createParser @@ -160,18 +163,18 @@ public class Fop { public void execute () throws BuildException { boolean errors = false; String version = Version.getVersion(); - System.out.println("=======================\nTask " + version + + MessageHandler.logln("=======================\nTask " + version + "\nconverting file " + fofile + " to " + pdffile); if (!(new File(fofile).exists())) { errors = true; - System.err.println("Task Fop - ERROR: Formatting objects file " + fofile + " missing."); + MessageHandler.errorln("Task Fop - ERROR: Formatting objects file " + fofile + " missing."); } XMLReader parser = createParser(); if (parser == null) { - System.err.println("Task Fop - ERROR: Unable to create SAX parser"); + MessageHandler.errorln("Task Fop - ERROR: Unable to create SAX parser"); errors = true; } @@ -179,8 +182,8 @@ public class Fop { try { parser.setFeature("http://xml.org/sax/features/namespace-prefixes", true); } catch (SAXException e) { - System.err.println("Error in setting up parser feature namespace-prefixes"); - System.err.println("You need a parser which supports SAX version 2"); + MessageHandler.errorln("Error in setting up parser feature namespace-prefixes"); + MessageHandler.errorln("You need a parser which supports SAX version 2"); System.exit(1); } @@ -195,11 +198,11 @@ public class Fop { driver.format(); driver.render(); } catch (Exception e) { - System.err.println("Task Fop - FATAL ERROR: " + e.getMessage()); + MessageHandler.errorln("Task Fop - FATAL ERROR: " + e.getMessage()); System.exit(1); } } - System.out.println("=======================\n"); + MessageHandler.logln("=======================\n"); } // end: execute } -- 2.39.5