|
The Fop API is fine -- as long as it remains stable to the minimal
level I'm using it. I'm just doing: final Class fopClass = Class.forName( "org.apache.fop.apps.Fop" ); final Object fop = fopClass.getConstructor( String.class ).newInstance( "application/pdf" ); // new Fop( "application/pdf" ) fopClass.getMethod( "setOutputStream", OutputStream.class ).invoke( fop, a_outputStream ); // fop.setOutputStream( a_outputStream ) final DefaultHandler defaultHandler = (DefaultHandler) fopClass.getMethod( "getDefaultHandler" ).invoke( fop ); // fop.getDefaultHandler()That's it (catch block omitted, of course). It's always good to keep the simple stuff simple, but in this case having to load just one class and call only 1 constructor and 2 methods makes this approach quite reasonable whereas I'd hate to have a whole lot more of such code to do the same thing. [Note the 0.20.5 code is just slightly longer so 0.91 is a good step in this respect.] -- Jess Holle Jeremias Maerki wrote: Noted, but the fact that the API is not stable has been documented in [1]. We've been pushing finalizing the API before us for a long time. The old 0.20.5 API sadly doesn't fit all the requirements that we have today. Another idea for your situation is a wrapper API that shields you from the actualy API of the FO implementation you use. I've written such a wrapper API [2] although the published version is now a little behind and would need to be updated. Furthermore, I got negative feedback from Sun about my choice of name. But if there is sufficient demand and a little help I can always revive it. I'm actively using it in my private projects. [1] http://xmlgraphics.apache.org/fop/0.91/upgrading.html [2] http://www.jeremias-maerki.ch/dev/jaxg/index.html On 07.02.2006 10:46:48 Jess Holle wrote: |
- Re: Finally finalizing the FOP API Jess Holle
- Re: Finally finalizing the FOP API Simon Pepping
- Re: Finally finalizing the FOP API Jeremias Maerki
- Re: Finally finalizing the FOP API Andreas L Delmelle
- Re: Finally finalizing the FOP API Jeremias Maerki
- Re: Finally finalizing the FOP API Jeremias Maerki
- Re: Finally finalizing the FOP API Jeremias Maerki
- Re: Finally finalizing the FOP API Clay Leeds
- Re: Finally finalizing the FOP API Jeremias Maerki
