info.bliki.wiki.model
Class DefaultEventListener

java.lang.Object
  extended by info.bliki.wiki.model.DefaultEventListener
All Implemented Interfaces:
IEventListener

public class DefaultEventListener
extends java.lang.Object
implements IEventListener

A default wiki event listener implementation which will trigger the on.... event methods during the parsing process. This listener does nothing useful, but implementing wrappers for the interface methods.


Field Summary
static IEventListener CONST
           
 
Constructor Summary
DefaultEventListener()
           
 
Method Summary
 void onHeader(char[] src, int rawStart, int rawEnd, int level)
          Notify the listener about a parsed header.
 void onHeader(char[] src, int startPosition, int endPosition, int rawStart, int rawEnd, int level)
          Notify the listener about a parsed header.
 void onTemplate(char[] src, int rawStart, int rawEnd)
          Notify the listener about a parsed template.
 void onWikiLink(char[] src, int rawStart, int rawEnd, java.lang.String suffix)
          Notify the listener about a parsed wiki link.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONST

public static final IEventListener CONST
Constructor Detail

DefaultEventListener

public DefaultEventListener()
Method Detail

onHeader

public void onHeader(char[] src,
                     int rawStart,
                     int rawEnd,
                     int level)
Description copied from interface: IEventListener
Notify the listener about a parsed header.

Specified by:
onHeader in interface IEventListener
Parameters:
src - the currently parsed raw wikitext character array
rawStart - the start offset of the wiki head excluding the wiki head start
rawEnd - the end offset of the wiki head excluding the wiki head end tags
level - the header level (i.e. == gives level 2; === gives level 3;==== gives level 4...)

onHeader

public void onHeader(char[] src,
                     int startPosition,
                     int endPosition,
                     int rawStart,
                     int rawEnd,
                     int level)
Description copied from interface: IEventListener
Notify the listener about a parsed header.

Specified by:
onHeader in interface IEventListener
Parameters:
src - the currently parsed raw wikitext character array
startPosition - the start offset of the wiki head including the wiki head start
endPosition - the end offset of the wiki head including the wiki head end tags + 1.
rawStart - the start offset of the wiki head excluding the wiki head start
rawEnd - the end offset of the wiki head excluding the wiki head end tags
level - the header level (i.e. == gives level 2; === gives level 3;==== gives level 4...)

onWikiLink

public void onWikiLink(char[] src,
                       int rawStart,
                       int rawEnd,
                       java.lang.String suffix)
Description copied from interface: IEventListener
Notify the listener about a parsed wiki link.

Specified by:
onWikiLink in interface IEventListener
Parameters:
src - the currently parsed raw wikitext character array
rawStart - the start offset of the wiki link excluding the wiki link start tags '[['
rawEnd - the end offset of the wiki link excluding the wiki link end tags ']]'
suffix - a suffix string eventually written directly behind the wiki link (useful for plurals). Example:
 Dolphins are [[aquatic mammal]]s that are closely related to [[whale]]s and [[porpoise]]s.
 

onTemplate

public void onTemplate(char[] src,
                       int rawStart,
                       int rawEnd)
Description copied from interface: IEventListener
Notify the listener about a parsed template.

Specified by:
onTemplate in interface IEventListener
Parameters:
src - the currently parsed raw wikitext character array
rawStart - the start offset of the wiki link excluding the wiki template start tags '{{'
rawEnd - the end offset of the wiki link excluding the wiki template end tags '}}'


Copyright © 2012 Java Wikipedia API (Bliki engine). All Rights Reserved.