This is an automated email from the ASF dual-hosted git repository.
kinow pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena-site.git
The following commit(s) were added to refs/heads/main by this push:
new 71dbf25b4 Fix formatting for event handler page
71dbf25b4 is described below
commit 71dbf25b4a601b5dbbe199abddfc33c098dfd6e3
Author: Bruno P. Kinoshita <[email protected]>
AuthorDate: Tue Jun 6 21:08:29 2023 +0200
Fix formatting for event handler page
---
source/documentation/notes/event-handler-howto.md | 38 +++++++++++++----------
1 file changed, 21 insertions(+), 17 deletions(-)
diff --git a/source/documentation/notes/event-handler-howto.md
b/source/documentation/notes/event-handler-howto.md
index c79b02c59..e5e87cd9c 100644
--- a/source/documentation/notes/event-handler-howto.md
+++ b/source/documentation/notes/event-handler-howto.md
@@ -15,27 +15,31 @@ it.
To monitor a Model, you must *register* a *ModelChangedListener*
with that Model:
- Model m = ModelFactory.createDefaultModel();
- ModelChangedListener L = new MyListener();
- m.register( L );
+```java
+Model m = ModelFactory.createDefaultModel();
+ModelChangedListener L = new MyListener();
+m.register( L );
+```
*MyListener* must be an implementation of *ModelChangedListener*,
for example:
- class MyListener implements ModelChangedListener
- {
- public void addedStatement( Statement s )
- { System.out.println( ">> added statement " + s ); }
- public void addedStatements( Statement [] statements ) {}
- public void addedStatements( List statements ) {}
- public void addedStatements( StmtIterator statements ) {}
- public void addedStatements( Model m ) {}
- public void removedStatement( Statement s ) {}
- public void removedStatements( Statement [] statements ) {}
- public void removedStatements( List statements ) {}
- public void removedStatements( StmtIterator statements ) {}
- public void removedStatements( Model m ) {}
- }
+```java
+class MyListener implements ModelChangedListener
+{
+ public void addedStatement( Statement s )
+ { System.out.println( ">> added statement " + s ); }
+ public void addedStatements( Statement [] statements ) {}
+ public void addedStatements( List statements ) {}
+ public void addedStatements( StmtIterator statements ) {}
+ public void addedStatements( Model m ) {}
+ public void removedStatement( Statement s ) {}
+ public void removedStatements( Statement [] statements ) {}
+ public void removedStatements( List statements ) {}
+ public void removedStatements( StmtIterator statements ) {}
+ public void removedStatements( Model m ) {}
+}
+```
This listener ignores everything except the addition of single
statements to *m*; those it prints out. The listener has a method