Dear Wiki user, You have subscribed to a wiki page or wiki category on "Xmlgraphics-fop Wiki" for change notification.
The following page has been changed by JeremiasMaerki: http://wiki.apache.org/xmlgraphics-fop/ProcessingFeedback The comment on the change is: Adjust to renames ------------------------------------------------------------------------------ = Suggestions = + Following are 3 different possible solutions that were proposed. Implementation for the "Extended Approach" has started on a branch. + == Blammo == I would like to propose using something like [http://blammo.sourceforge.net/ Blammo]. Blammo is extremely simple. You simply define an interface in which all of the operations represent event conditions in which you are interested. I am not aware of the specific conditions that you might want to track, but gathering from the above, I could imagine something like this: @@ -127, +129 @@ {{{ package org.apache.fop.events; - public class FopEvent extends EventObject { + public class Event extends EventObject { [..] - public FopEvent(Object source, String eventID, Map params) { + public Event(Object source, String eventID, Map params) { [..] } - public interface FopEventListener extends EventListener { + public interface EventListener extends java.util.EventListener { - void processEvent(FopEvent event); + void processEvent(Event event); } public interface EventBroadcaster { - void addFopEventListener(FopEventListener listener); + void addEventListener(EventListener listener); - void removeFopEventListener(FopEventListener listener); + void removeEventListener(EventListener listener); int getListenerCount(); - void broadcastEvent(FopEvent event); + void broadcastEvent(Event event); } }}} @@ -155, +157 @@ MyEventListener listener = new MyEventListener(); EventBroadcaster broadcaster = new DefaultEventBroadcaster(); - broadcaster.addFopEventListener(listener); + broadcaster.addEventListener(listener); [..] @@ -163, +165 @@ [..] - FopEvent ev = new FopEvent(this, EventConstants.EVENT_MISSING_CHILD_ERROR, + Event ev = new Event(this, EventConstants.EVENT_MISSING_CHILD_ERROR, - FopEvent.paramsBuilder() + Event.paramsBuilder() .param("element", this) .param("elementName", getName()) .param("contentModel", contentModel) @@ -227, +229 @@ Message production will not be done using java.text.!MessageFormat (which uses parameter indexes). Instead the parameter names defined on the interface can be used directly as message parameters which should make the whole thing more readable and less error-prone. - The implementations for the !EventProducer interfaces will be provided as dynamic proxies which will make Java code generation unnecessary. Since the necessary metadata can be extracted from the XML file created at code generation time it becomes possible to map the individual event parameters into the Map of the !FopEvent object (Reflection doesn't provide the names of the method parameters). + The implementations for the !EventProducer interfaces will be provided as dynamic proxies which will make Java code generation unnecessary. Since the necessary metadata can be extracted from the XML file created at code generation time it becomes possible to map the individual event parameters into the Map of the Event object (Reflection doesn't provide the names of the method parameters). Acquisition of an !EventProducer and event production: {{{ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
