xmlgraphics-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r840501 - in /websites/staging/xmlgraphics/trunk/content: ./ fop/trunk/events.html
Date Mon, 03 Dec 2012 10:50:26 GMT
Author: buildbot
Date: Mon Dec  3 10:50:26 2012
New Revision: 840501

Log:
Staging update by buildbot for xmlgraphics

Modified:
    websites/staging/xmlgraphics/trunk/content/   (props changed)
    websites/staging/xmlgraphics/trunk/content/fop/trunk/events.html

Propchange: websites/staging/xmlgraphics/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Mon Dec  3 10:50:26 2012
@@ -1 +1 @@
-1416438
+1416440

Modified: websites/staging/xmlgraphics/trunk/content/fop/trunk/events.html
==============================================================================
--- websites/staging/xmlgraphics/trunk/content/fop/trunk/events.html (original)
+++ websites/staging/xmlgraphics/trunk/content/fop/trunk/events.html Mon Dec  3 10:50:26 2012
@@ -447,7 +447,7 @@ $(document).ready(function () {
 <h2 id="the-producer-side-for-fop-developers-wzxhzdk20wzxhzdk21">The producer side
(for FOP developers) <a id="producer"></a></h2>
 <p>This section is primarily for FOP and FOP plug-in developers. It describes how to
use the event subsystem for producing events.
 The event package has been designed in order to be theoretically useful for use cases outside
FOP. If you think this is interesting independently from FOP, please talk to <a href="mailto:fop-dev@xmlgraphics.apache.org">us</a>.</p>
-<h2 id="producing-and-sending-an-event-wzxhzdk22wzxhzdk23">Producing and sending an
event <a id="basic-event-production"></a></h2>
+<h3 id="producing-and-sending-an-event-wzxhzdk22wzxhzdk23">Producing and sending an
event <a id="basic-event-production"></a></h3>
 <p>The basics are very simple. Just instantiate an <code>Event</code> object
and fill it with the necessary parameters. Then pass it to the <code>EventBroadcaster</code>
which distributes the events to the interested listeneners. Here's a code example:</p>
 <div class="codehilite"><pre><span class="n">Event</span> <span
class="n">ev</span> <span class="o">=</span> <span class="k">new</span>
<span class="n">Event</span><span class="p">(</span><span class="n">this</span><span
class="p">,</span> <span class="s">&quot;complain&quot;</span><span
class="p">,</span> <span class="n">EventSeverity</span><span class="o">.</span><span
class="n">WARN</span><span class="p">,</span>
         <span class="n">Event</span><span class="o">.</span><span
class="n">paramsBuilder</span><span class="p">()</span>
@@ -494,7 +494,7 @@ The event package has been designed in o
 </pre></div>
 
 
-<h2 id="the-event-model-wzxhzdk26wzxhzdk27">The event model <a id="event-model"></a></h2>
+<h3 id="the-event-model-wzxhzdk26wzxhzdk27">The event model <a id="event-model"></a></h3>
 <p>Inside an invocation handler for a dynamic proxy, there's no information about the
names of each parameter. The JVM doesn't provide it. The only thing you know is the interface
and method name. In order to properly fill the <code>Event</code> 's parameter
map we need to know the parameter names. These are retrieved from an event object model. This
is found in the <code>org.apache.fop.events.model</code> package. The data for
the object model is retrieved from an XML representation of the event model that is loaded
as a resource. The XML representation is generated using an Ant task at build time ( <code>ant
resourcegen</code> ). The Ant task (found in <code>src/codegen/java/org/apache/fop/tools/EventProducerCollectorTask.java</code>
) scans FOP's sources for descendants of the <code>EventProducer</code> interface
and uses <a href="http://qdox.codehaus.org/">QDox</a> to parse these interfaces.</p>
 <p>The event model XML files are generated during build by the Ant task mentioned above
when running the "resourcegen" task. So just run <code>"ant resourcegen"</code>
if you receive a <code>MissingResourceException</code> at runtime indicating that
<code>"event-model.xml"</code> is missing.</p>
 <p>Primarily, the QDox-based collector task records the parameters' names and types.
Furthermore, it extracts additional attributes embedded as Javadoc comments from the methods.
At the moment, the only such attribute is "@event.severity" which indicates the default event
severity (which can be changed by event listeners). The example event producer above shows
the Javadocs for an event method.</p>



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org


Mime
View raw message