From: Jeremias Maerki Date: Thu, 3 Sep 2009 07:24:43 +0000 (+0000) Subject: There an easier way to throw exceptions from certain event otherwise not causing... X-Git-Tag: fop-1_0~172 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7389ef5a0f0b8f2059110c5c265a925d6e6240fc;p=xmlgraphics-fop.git There an easier way to throw exceptions from certain event otherwise not causing an exception. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@810792 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/documentation/content/xdocs/trunk/events.xml b/src/documentation/content/xdocs/trunk/events.xml index 51a1bb6cc..4ba6014c8 100644 --- a/src/documentation/content/xdocs/trunk/events.xml +++ b/src/documentation/content/xdocs/trunk/events.xml @@ -152,7 +152,28 @@ foUserAgent.getEventBroadcaster().addEventListener(new SysOutEventListener());]]

By default, FOP continues processing even if an image wasn't found. If you have more strict requirements and want FOP to stop if an image is not available, you can - do something like the following: + do something like the following in the simplest case: +

+ +

+ Increasing the event severity to FATAL will signal the event broadcaster to throw + an exception and stop further processing. In the above case, all resource-related + events will cause FOP to stop processing. +

+

+ You can also customize the exception to throw (you can may throw a RuntimeException + or subclass yourself) and/or which event to respond to: