Re: svn commit: r379883 - /xmlgraphics/fop/branches/Temp_API_Finalization/examples/embedding/java/embedding/ExampleFO2PDF.java

2006-03-06 Thread Jeremias Maerki

On 05.03.2006 21:55:44 Simon Pepping wrote:
 On Thu, Feb 23, 2006 at 10:03:29PM +0100, Simon Pepping wrote:
  On Wed, Feb 22, 2006 at 10:22:39PM +0100, Jeremias Maerki wrote:
   
   On 22.02.2006 21:55:36 Simon Pepping wrote:
Would it not be nicer to have a constructor that takes the output
stream as an argument?
   
   If this is preferred, no objections. However, not all output formats take
   an OutputStream which means an increase of factory methods.
  
  For those formats that do require an OutputStream the created object
  is inconsistent, and one is only notified at runtime. The presence of
  another factory method at least suggests that it under some
  circumstances it may be necessary to create the object with an
  OutputStream.
 
 Added the methods. As you see from my example, I prefer early testing
 of the consistency of the Fop object.

OK. However, I don't like your catching the IllegalStateException in the
example code. An IllegalStateException is a descendant of
RuntimeException and normally indicates a programmer error. It's not
something that is usually caught. The example code should be instructive
to the normal Java developer and should not distract with that try/catch
around the getDefaultHandler() method IMO.

Jeremias Maerki



Re: svn commit: r379883 - /xmlgraphics/fop/branches/Temp_API_Finalization/examples/embedding/java/embedding/ExampleFO2PDF.java

2006-03-05 Thread Simon Pepping
On Thu, Feb 23, 2006 at 10:03:29PM +0100, Simon Pepping wrote:
 On Wed, Feb 22, 2006 at 10:22:39PM +0100, Jeremias Maerki wrote:
  
  On 22.02.2006 21:55:36 Simon Pepping wrote:
   Would it not be nicer to have a constructor that takes the output
   stream as an argument?
  
  If this is preferred, no objections. However, not all output formats take
  an OutputStream which means an increase of factory methods.
 
 For those formats that do require an OutputStream the created object
 is inconsistent, and one is only notified at runtime. The presence of
 another factory method at least suggests that it under some
 circumstances it may be necessary to create the object with an
 OutputStream.

Added the methods. As you see from my example, I prefer early testing
of the consistency of the Fop object.

Regards, Simon

-- 
Simon Pepping
home page: http://www.leverkruid.nl



Re: svn commit: r379883 - /xmlgraphics/fop/branches/Temp_API_Finalization/examples/embedding/java/embedding/ExampleFO2PDF.java

2006-02-23 Thread Simon Pepping
On Wed, Feb 22, 2006 at 10:22:39PM +0100, Jeremias Maerki wrote:
 
 On 22.02.2006 21:55:36 Simon Pepping wrote:
  Would it not be nicer to have a constructor that takes the output
  stream as an argument?
 
 If this is preferred, no objections. However, not all output formats take
 an OutputStream which means an increase of factory methods.

For those formats that do require an OutputStream the created object
is inconsistent, and one is only notified at runtime. The presence of
another factory method at least suggests that it under some
circumstances it may be necessary to create the object with an
OutputStream.

Regards, Simon

-- 
Simon Pepping
home page: http://www.leverkruid.nl



Re: svn commit: r379883 - /xmlgraphics/fop/branches/Temp_API_Finalization/examples/embedding/java/embedding/ExampleFO2PDF.java

2006-02-22 Thread Simon Pepping
On Wed, Feb 22, 2006 at 08:50:57PM -, [EMAIL PROTECTED] wrote:
 Author: spepping
 Date: Wed Feb 22 12:50:56 2006
 New Revision: 379883
 
 URL: http://svn.apache.org/viewcvs?rev=379883view=rev
 Log:
 Adapted this example to the new API.
 
 Modified:
 
 xmlgraphics/fop/branches/Temp_API_Finalization/examples/embedding/java/embedding/ExampleFO2PDF.java
 
I did this to get a feel for the API. Does this reflect the intention?

Would it not be nicer to have a constructor that takes the output
stream as an argument?

Regards, Simon

-- 
Simon Pepping
home page: http://www.leverkruid.nl