org.xwiki.rendering.wikimodel
Interface IWemListenerInline

All Known Subinterfaces:
IWemListener
All Known Implementing Classes:
AgregatingWemListener, CompositeListener, ConfluenceExtendedWikiParser.EnhancedListener, EmptyWemListener, EventDumpListener, JspWikiSerializer, PrintInlineListener, PrintListener, PrintTextListener, TexSerializer, WemInlineTagNotifier, WemTagNotifier, XWikiSerializer, XWikiSerializer2

public interface IWemListenerInline

This method re-groups all methods used to notify about in-line elements. All inline elements should be "wrapped" in a formats.

 So a normal sequence of notifications is:
  * beginFormat(...)
    - onWord(...)
    - onSpace(...)
    - onReference(...)
    - onWord(...)
    - ...
  * endFormat(...)
  * beginFormat(...)
    - onWord(...)
    - ...
  * endFormat(...)
 
All inline elements can be splitted in the following categories:
Simple text elements
These elements are notified using the following set of methods: onNewLine(), onSpace(String), onWord(String) and onSpecialSymbol(String). This methods cover "simple text" and in sum they are used to represent all types of "natural" elements in the text - words, spaces, new lines and special symbols. Using only these methods it is possible to cover all combinations of all unicode characters. Parsers use these methods to notify about all non-interpreted symbols and their combinations. These methods calls can be considered as the base of any text documents.
Logical in-line elements
These elements require interpretation of some syntax-specific formatting and are notified using the following methods: onEscape(String), onLineBreak(), onReference(String)/ onReference(WikiReference), onVerbatimInline(String, WikiParameters)

Since:
4.0M1
Version:
$Id: b97f8796cf471ac389bcb13ea2475e3a9079e2e7 $

Method Summary
 void beginFormat(WikiFormat format)
          This method is called at the beginning of a sequence of in-line elements having the specified formatting parameters.
 void endFormat(WikiFormat format)
          This method is called to notify about the end of a sequence of in-line elements having common formatting parameters.
 void onEscape(String str)
          Escaped symbols.
 void onImage(String ref)
          This method is called to notify that an free standing image was found in the parsed wiki document.
 void onImage(WikiReference ref)
          This method is called to notify that a structured reference was found in the text
 void onLineBreak()
          This method is called to notify about a forced line break found in the text.
 void onNewLine()
          This method is called to notify that the parsed block contains a new line sequence ("\r\n" or "\r" or "\n" character sequence).
 void onReference(String ref)
          This method is called to notify that an URI (an implicit reference) was found in the parsed wiki document.
 void onReference(WikiReference ref)
          This method is called to notify that a structured reference was found in the text
 void onSpace(String str)
          This method is called to notify about a sequence of space symbols (like " " or "\t" symbols).
 void onSpecialSymbol(String str)
          This method is called to notify about a sequence of special characters.
 void onVerbatimInline(String str, WikiParameters params)
          This method is called to notify about not-interpreted in-line sequence of characters which should be represented in the final text "as is".
 void onWord(String str)
          This method is called to notify about a "word" found in the document.
 

Method Detail

beginFormat

void beginFormat(WikiFormat format)
This method is called at the beginning of a sequence of in-line elements having the specified formatting parameters.

Parameters:
format - the object defining formatting parameters of in-line elements.

endFormat

void endFormat(WikiFormat format)
This method is called to notify about the end of a sequence of in-line elements having common formatting parameters.

Parameters:
format - the formatting object defining how contained in-line elements should be formatted

onEscape

void onEscape(String str)
Escaped symbols. More frequently the given string has just one symbol.

Parameters:
str - the escaped sequence of characters

onImage

void onImage(String ref)
This method is called to notify that an free standing image was found in the parsed wiki document.

Parameters:
ref - the reference the reference

onImage

void onImage(WikiReference ref)
This method is called to notify that a structured reference was found in the text

Parameters:
ref - the reference the reference

onLineBreak

void onLineBreak()
This method is called to notify about a forced line break found in the text. Note that the line break symbol can be found in the middle of a "physical" line so this event is not equals to the onNewLine() notification.

See Also:
onNewLine()

onNewLine

void onNewLine()
This method is called to notify that the parsed block contains a new line sequence ("\r\n" or "\r" or "\n" character sequence). Note that the new line symbols are not the same as a forced line break sequence notified by the onLineBreak() event.

See Also:
onSpace(String), onWord(String), onSpecialSymbol(String), onLineBreak()

onReference

void onReference(String ref)
This method is called to notify that an URI (an implicit reference) was found in the parsed wiki document.

Parameters:
ref - the URI

onReference

void onReference(WikiReference ref)
This method is called to notify that a structured reference was found in the text

Parameters:
ref - the reference the reference

onSpace

void onSpace(String str)
This method is called to notify about a sequence of space symbols (like " " or "\t" symbols).

Parameters:
str - the sequence of space characters
See Also:
onWord(String), onSpecialSymbol(String), onNewLine()

onSpecialSymbol

void onSpecialSymbol(String str)
This method is called to notify about a sequence of special characters. Special symbols are characters which are not interpreted as a part of a word (letters or digits) or as a space. Note that the handling of these symbols requires special attention because these symbols most frequently used to define text formatting. Various wiki syntaxes use combinations of these sequences to define structural elements in wiki documents.
 The full list of possible special symbols:
  "!",     "\"",     "#",     "$",     "%",     "&",     "'",     "(",
  ")",     "*",      "+",     ",",     "-",     ".",     "/",     ":",
  ";",     "<",      "=",     ">",     "?",     "@",     "[",     "\\",
  "]",     "^",      "_",     "`",     "{",     "|",     "}",     "~"
 

Parameters:
str - the sequence of special symbols
See Also:
onSpace(String), onWord(String), onNewLine()

onVerbatimInline

void onVerbatimInline(String str,
                      WikiParameters params)
This method is called to notify about not-interpreted in-line sequence of characters which should be represented in the final text "as is".

Parameters:
str - the sequence of non-interpreted characters
params - TODO

onWord

void onWord(String str)
This method is called to notify about a "word" found in the document. Words are formed by all characters which are not considered as spaces or special symbols.
 Words are formed by the all characters excluding the following ones:

  "\t",    "\n",     "\r",    " ",
  "!",     "\"",     "#",     "$",     "%",     "&",     "'",     "(",
  ")",     "*",      "+",     ",",     "-",     ".",     "/",     ":",
  ";",     "<",      "=",     ">",     "?",     "@",     "[",     "\\",
  "]",     "^",      "_",     "`",     "{",     "|",     "}",     "~"
 

Parameters:
str - the sequence of characters forming a word
See Also:
onSpace(String), onSpecialSymbol(String), onNewLine()


Copyright © 2004–2014 XWiki. All rights reserved.