|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Listener
Contains callback events called when a document has been parsed and when it needs to be modified or rendered. More
specifically when a document is parsed it generates an XDOM object. That object has
a AbstractBlock.traverse(Listener) method that accepts a Listener object. For each
Block element found in the document its
Block.traverse(org.xwiki.rendering.listener.Listener) method is called leading to the generation of events from this
interface.
Here's an example of usage:
<code> XDOM dom = parser.parse(source); MyListener listener = new MyListener(...); dom.traverse(listener); // At this stage all events have been sent to MyListener. </code>
| Field Summary | |
|---|---|
static Map<String,String> |
EMPTY_PARAMETERS
To use when there is no parameters. |
| Method Summary | |
|---|---|
void |
beginDefinitionDescription()
Start of a definition list description. |
void |
beginDefinitionList(Map<String,String> parameters)
Start of a definition list. |
void |
beginDefinitionTerm()
Start of a definition list term. |
void |
beginDocument(MetaData metaData)
Start of the document. |
void |
beginFormat(Format format,
Map<String,String> parameters)
End of a text formatting block. |
void |
beginGroup(Map<String,String> parameters)
Start a group of elements. |
void |
beginHeader(HeaderLevel level,
String id,
Map<String,String> parameters)
Start of a header. |
void |
beginList(ListType listType,
Map<String,String> parameters)
Start of a list. |
void |
beginListItem()
Start of a list item. |
void |
beginMacroMarker(String name,
Map<String,String> macroParameters,
String content,
boolean isInline)
Start of marker containing a macro definition. |
void |
beginMetaData(MetaData metadata)
Start of MetaData (eg saving source from where the content is coming from). |
void |
beginParagraph(Map<String,String> parameters)
Start of a paragraph. |
void |
beginQuotation(Map<String,String> parameters)
Start of a quotation. |
void |
beginQuotationLine()
Start of a quotation line. |
void |
beginSection(Map<String,String> parameters)
Start of a section. |
void |
beginTable(Map<String,String> parameters)
Start of a table. |
void |
beginTableCell(Map<String,String> parameters)
Start of a table cell. |
void |
beginTableHeadCell(Map<String,String> parameters)
Start of a table head cell. |
void |
beginTableRow(Map<String,String> parameters)
Start of a table row. |
void |
endDefinitionDescription()
End of a definition list description. |
void |
endDefinitionList(Map<String,String> parameters)
End of a definition list. |
void |
endDefinitionTerm()
End of a definition list term. |
void |
endDocument(MetaData metaData)
End of the document. |
void |
endFormat(Format format,
Map<String,String> parameters)
End of a text formatting block. |
void |
endGroup(Map<String,String> parameters)
End of the group. |
void |
endHeader(HeaderLevel level,
String id,
Map<String,String> parameters)
End of a header. |
void |
endList(ListType listType,
Map<String,String> parameters)
End of a list. |
void |
endListItem()
End of a list item. |
void |
endMacroMarker(String name,
Map<String,String> macroParameters,
String content,
boolean isInline)
End of marker containing a macro definition. |
void |
endMetaData(MetaData metadata)
End of MetaData. |
void |
endParagraph(Map<String,String> parameters)
End of a paragraph. |
void |
endQuotation(Map<String,String> parameters)
End of a quotation. |
void |
endQuotationLine()
End of a quotation line. |
void |
endSection(Map<String,String> parameters)
End of a section. |
void |
endTable(Map<String,String> parameters)
End of a table. |
void |
endTableCell(Map<String,String> parameters)
End of a table cell. |
void |
endTableHeadCell(Map<String,String> parameters)
End of a table head cell. |
void |
endTableRow(Map<String,String> parameters)
End of a table row. |
void |
onEmptyLines(int count)
Represents an empty line between 2 standalone Blocks. |
void |
onHorizontalLine(Map<String,String> parameters)
Represents an horizontal line. |
void |
onId(String name)
A reference/location in a page. |
void |
onMacro(String id,
Map<String,String> macroParameters,
String content,
boolean isInline)
A Macro. |
void |
onNewLine()
A new line or line break (it's up to the renderers to decide if it should be outputted as a new line or as a line break in the given syntax). |
void |
onRawText(String rawContent,
Syntax syntax)
Some text to inject directly into the listener output without parsing it. |
void |
onSpace()
A space. |
void |
onSpecialSymbol(char symbol)
A special symbol ("*", "<", ">", "=", quote, etc). |
void |
onVerbatim(String protectedString,
boolean isInline,
Map<String,String> parameters)
A portion of text. |
void |
onWord(String word)
A word. |
| Methods inherited from interface org.xwiki.rendering.listener.LinkListener |
|---|
beginLink, endLink |
| Methods inherited from interface org.xwiki.rendering.listener.ImageListener |
|---|
onImage |
| Field Detail |
|---|
static final Map<String,String> EMPTY_PARAMETERS
| Method Detail |
|---|
void beginDocument(MetaData metaData)
metaData - the meta data to associate to the following events, see MetaDatavoid endDocument(MetaData metaData)
metaData - the meta data associated with the previous events, see MetaDatavoid beginMetaData(MetaData metadata)
metadata - the metadatavoid endMetaData(MetaData metadata)
metadata - the metadatavoid beginGroup(Map<String,String> parameters)
parameters - a generic list of parameters. Example: style="background-color: blue"void endGroup(Map<String,String> parameters)
parameters - a generic list of parameters. Example: style="background-color: blue"
void beginFormat(Format format,
Map<String,String> parameters)
format - the formatting type (bold, italic, etc)parameters - a generic list of parameters. Example: style="background-color: blue"Format
void endFormat(Format format,
Map<String,String> parameters)
format - the formatting type (bold, italic, etc)parameters - a generic list of parameters. Example: style="background-color: blue"Formatvoid beginParagraph(Map<String,String> parameters)
parameters - a generic list of parameters. Example: style="background-color: blue"void endParagraph(Map<String,String> parameters)
parameters - a generic list of parameters. Example: style="background-color: blue"
void beginList(ListType listType,
Map<String,String> parameters)
listType - the type of list (bulleted, numbered, etc)parameters - a generic list of parameters for the list. Example: "style"/"background-color: blue"ListTypevoid beginDefinitionList(Map<String,String> parameters)
parameters - a generic list of parameters for the list. Example: "style"/"background-color: blue"
void endList(ListType listType,
Map<String,String> parameters)
listType - the type of list (bulleted, numbered, etc)parameters - a generic list of parameters for the list. Example: "style"/"background-color: blue"ListTypevoid endDefinitionList(Map<String,String> parameters)
parameters - a generic list of parameters for the list. Example: "style"/"background-color: blue"void beginListItem()
void beginDefinitionTerm()
void beginDefinitionDescription()
void endListItem()
void endDefinitionTerm()
void endDefinitionDescription()
void beginTable(Map<String,String> parameters)
parameters - a generic list of parameters for the table.void beginTableRow(Map<String,String> parameters)
parameters - a generic list of parameters for the table row.void beginTableCell(Map<String,String> parameters)
parameters - a generic list of parameters for the table cell.void beginTableHeadCell(Map<String,String> parameters)
parameters - a generic list of parameters for the table head cell.void endTable(Map<String,String> parameters)
parameters - a generic list of parameters for the table.void endTableRow(Map<String,String> parameters)
parameters - a generic list of parameters for the table row.void endTableCell(Map<String,String> parameters)
parameters - a generic list of parameters for the table cell.void endTableHeadCell(Map<String,String> parameters)
parameters - a generic list of parameters for the table head cell.void beginSection(Map<String,String> parameters)
parameters - a generic list of parameters. Example: style="background-color: blue"HeaderLevelvoid endSection(Map<String,String> parameters)
parameters - a generic list of parameters. Example: style="background-color: blue"HeaderLevel
void beginHeader(HeaderLevel level,
String id,
Map<String,String> parameters)
level - the header level (1, 2, 3, etc)id - the header unique identifierparameters - a generic list of parameters. Example: style="background-color: blue"HeaderLevel
void endHeader(HeaderLevel level,
String id,
Map<String,String> parameters)
level - the header level (1, 2, 3, etc)id - the header unique identifierparameters - a generic list of parameters. Example: style="background-color: blue"HeaderLevel
void beginMacroMarker(String name,
Map<String,String> macroParameters,
String content,
boolean isInline)
name - the macro namemacroParameters - the macro parameterscontent - the macro contentisInline - if true the macro is located in a inline content (like paragraph, etc.)onMacro(String, java.util.Map, String, boolean)
void endMacroMarker(String name,
Map<String,String> macroParameters,
String content,
boolean isInline)
name - the macro namemacroParameters - the macro parameterscontent - the macro contentisInline - if true the macro is located in a inline content (like paragraph, etc.)beginMacroMarker(String, java.util.Map, String, boolean)void beginQuotation(Map<String,String> parameters)
parameters - a generic list of parameters for the quotation. Example: "style"/"background-color: blue"void endQuotation(Map<String,String> parameters)
parameters - a generic list of parameters for the quotation. Example: "style"/"background-color: blue"void beginQuotationLine()
void endQuotationLine()
void onNewLine()
void onMacro(String id,
Map<String,String> macroParameters,
String content,
boolean isInline)
id - the macro id (eg "toc" for the TOC macro)macroParameters - the macro parameterscontent - the macro contentisInline - if true the macro is located in a inline content (like paragraph, etc.)void onWord(String word)
word - the word encounteredvoid onSpace()
void onSpecialSymbol(char symbol)
symbol - the symbol encounteredvoid onId(String name)
name - the location name.void onHorizontalLine(Map<String,String> parameters)
parameters - a generic list of parameters. Example: style="background-color: blue"void onEmptyLines(int count)
count - the number of empty lines between 2 standalone Blocks
void onVerbatim(String protectedString,
boolean isInline,
Map<String,String> parameters)
protectedString - the string to protected from renderingisInline - if true the text content is located in a inline content (like paragraph, etc.)parameters - a generic list of parameters. Example: style="background-color: blue"
void onRawText(String rawContent,
Syntax syntax)
rawContent - the text to injectsyntax - the syntax in which the text is written. This is useful so that listener implementations can decide
whether they can handle direct inject for that syntax
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||