public class LookaheadChainingListener extends AbstractChainingListener
EMPTY_PARAMETERS
Constructor and Description |
---|
LookaheadChainingListener(ListenerChain listenerChain,
int lookaheadDepth) |
Modifier and Type | Method and Description |
---|---|
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 |
beginFigure(Map<String,String> parameters)
Start of a figure.
|
void |
beginFigureCaption(Map<String,String> parameters)
Start of a figure caption.
|
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 |
beginLink(ResourceReference reference,
boolean freestanding,
Map<String,String> parameters)
Start of a link.
|
void |
beginList(ListType type,
Map<String,String> parameters)
Start of a list.
|
void |
beginListItem()
Start of a list item.
|
void |
beginListItem(Map<String,String> parameters)
Start of a list item.
|
void |
beginMacroMarker(String name,
Map<String,String> parameters,
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 |
endFigure(Map<String,String> parameters)
End of a figure.
|
void |
endFigureCaption(Map<String,String> parameters)
End of a figure caption.
|
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 |
endLink(ResourceReference reference,
boolean freestanding,
Map<String,String> parameters)
End of a link.
|
void |
endList(ListType type,
Map<String,String> parameters)
End of a list.
|
void |
endListItem()
End of a list item.
|
void |
endListItem(Map<String,String> parameters)
End of a list item.
|
void |
endMacroMarker(String name,
Map<String,String> parameters,
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.
|
QueueListener.Event |
getNextEvent() |
QueueListener.Event |
getNextEvent(int depth) |
protected QueueListener |
getPreviousEvents() |
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 |
onImage(ResourceReference reference,
boolean freestanding,
Map<String,String> parameters)
An image.
|
void |
onMacro(String id,
Map<String,String> parameters,
String content,
boolean inline)
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 text,
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 content,
boolean inline,
Map<String,String> parameters)
A portion of text.
|
void |
onWord(String word)
A word.
|
protected void |
setLookaheadDepth(int lookaheadDepth)
Redefine the stacking depth.
|
void |
transferStart(QueueListener eventsToTransfer)
Transfer all passed events by removing the from the passed parameter and moving them to the beginning of the
event stack.
|
getListenerChain, setListenerChain
public LookaheadChainingListener(ListenerChain listenerChain, int lookaheadDepth)
protected void setLookaheadDepth(int lookaheadDepth)
lookaheadDepth
- the new depth to setprotected QueueListener getPreviousEvents()
public QueueListener.Event getNextEvent()
public QueueListener.Event getNextEvent(int depth)
public void beginDefinitionDescription()
Listener
beginDefinitionDescription
in interface Listener
beginDefinitionDescription
in class AbstractChainingListener
public void beginDefinitionList(Map<String,String> parameters)
beginDefinitionList
in interface Listener
beginDefinitionList
in class AbstractChainingListener
parameters
- a generic list of parameters for the list. Example: "style"/"background-color: blue"public void beginDefinitionTerm()
Listener
beginDefinitionTerm
in interface Listener
beginDefinitionTerm
in class AbstractChainingListener
public void beginDocument(MetaData metadata)
beginDocument
in interface Listener
beginDocument
in class AbstractChainingListener
metadata
- the meta data to associate to the following events, see MetaData
public void beginGroup(Map<String,String> parameters)
Listener
beginGroup
in interface Listener
beginGroup
in class AbstractChainingListener
parameters
- a generic list of parameters. Example: style="background-color: blue"public void beginFormat(Format format, Map<String,String> parameters)
Listener
beginFormat
in interface Listener
beginFormat
in class AbstractChainingListener
format
- the formatting type (bold, italic, etc)parameters
- a generic list of parameters. Example: style="background-color: blue"Format
public void beginHeader(HeaderLevel level, String id, Map<String,String> parameters)
Listener
beginHeader
in interface Listener
beginHeader
in class AbstractChainingListener
level
- the header level (1, 2, 3, etc)id
- the header unique identifierparameters
- a generic list of parameters. Example: style="background-color: blue"HeaderLevel
public void beginLink(ResourceReference reference, boolean freestanding, Map<String,String> parameters)
beginLink
in interface LinkListener
beginLink
in class AbstractChainingListener
reference
- the link referencefreestanding
- if true then the link is a free standing URI directly in the textparameters
- a generic list of parameters. Example: style="background-color: blue"ResourceReference
public void beginList(ListType type, Map<String,String> parameters)
Listener
beginList
in interface Listener
beginList
in class AbstractChainingListener
type
- the type of list (bulleted, numbered, etc)parameters
- a generic list of parameters for the list. Example: "style"/"background-color: blue"ListType
public void beginListItem()
Listener
beginListItem
in interface Listener
beginListItem
in class AbstractChainingListener
public void beginListItem(Map<String,String> parameters)
Listener
beginListItem
in interface Listener
beginListItem
in class AbstractChainingListener
parameters
- a generic list of parameters for the list item. Example: "style"/"background-color: blue"public void beginMacroMarker(String name, Map<String,String> parameters, String content, boolean isInline)
Listener
beginMacroMarker
in interface Listener
beginMacroMarker
in class AbstractChainingListener
name
- the macro nameparameters
- the macro parameterscontent
- the macro contentisInline
- if true the macro is located in a inline content (like paragraph, etc.)Listener.onMacro(String, java.util.Map, String, boolean)
public void beginMetaData(MetaData metadata)
beginMetaData
in interface Listener
beginMetaData
in class AbstractChainingListener
metadata
- the metadatapublic void beginParagraph(Map<String,String> parameters)
Listener
beginParagraph
in interface Listener
beginParagraph
in class AbstractChainingListener
parameters
- a generic list of parameters. Example: style="background-color: blue"public void beginQuotation(Map<String,String> parameters)
Listener
beginQuotation
in interface Listener
beginQuotation
in class AbstractChainingListener
parameters
- a generic list of parameters for the quotation. Example: "style"/"background-color: blue"public void beginQuotationLine()
Listener
beginQuotationLine
in interface Listener
beginQuotationLine
in class AbstractChainingListener
public void beginSection(Map<String,String> parameters)
Listener
beginSection
in interface Listener
beginSection
in class AbstractChainingListener
parameters
- a generic list of parameters. Example: style="background-color: blue"HeaderLevel
public void beginTable(Map<String,String> parameters)
Listener
beginTable
in interface Listener
beginTable
in class AbstractChainingListener
parameters
- a generic list of parameters for the table.public void beginTableCell(Map<String,String> parameters)
Listener
beginTableCell
in interface Listener
beginTableCell
in class AbstractChainingListener
parameters
- a generic list of parameters for the table cell.public void beginTableHeadCell(Map<String,String> parameters)
Listener
beginTableHeadCell
in interface Listener
beginTableHeadCell
in class AbstractChainingListener
parameters
- a generic list of parameters for the table head cell.public void beginTableRow(Map<String,String> parameters)
Listener
beginTableRow
in interface Listener
beginTableRow
in class AbstractChainingListener
parameters
- a generic list of parameters for the table row.public void beginFigure(Map<String,String> parameters)
Listener
beginFigure
in interface Listener
beginFigure
in class AbstractChainingListener
parameters
- a generic list of parameters for the figurepublic void beginFigureCaption(Map<String,String> parameters)
Listener
beginFigureCaption
in interface Listener
beginFigureCaption
in class AbstractChainingListener
parameters
- a generic list of parameters for the figurepublic void endDefinitionDescription()
Listener
endDefinitionDescription
in interface Listener
endDefinitionDescription
in class AbstractChainingListener
public void endDefinitionList(Map<String,String> parameters)
endDefinitionList
in interface Listener
endDefinitionList
in class AbstractChainingListener
parameters
- a generic list of parameters for the list. Example: "style"/"background-color: blue"public void endDefinitionTerm()
Listener
endDefinitionTerm
in interface Listener
endDefinitionTerm
in class AbstractChainingListener
public void endDocument(MetaData metadata)
endDocument
in interface Listener
endDocument
in class AbstractChainingListener
metadata
- the meta data associated with the previous events, see MetaData
public void endGroup(Map<String,String> parameters)
Listener
endGroup
in interface Listener
endGroup
in class AbstractChainingListener
parameters
- a generic list of parameters. Example: style="background-color: blue"public void endFormat(Format format, Map<String,String> parameters)
Listener
endFormat
in interface Listener
endFormat
in class AbstractChainingListener
format
- the formatting type (bold, italic, etc)parameters
- a generic list of parameters. Example: style="background-color: blue"Format
public void endHeader(HeaderLevel level, String id, Map<String,String> parameters)
Listener
endHeader
in interface Listener
endHeader
in class AbstractChainingListener
level
- the header level (1, 2, 3, etc)id
- the header unique identifierparameters
- a generic list of parameters. Example: style="background-color: blue"HeaderLevel
public void endLink(ResourceReference reference, boolean freestanding, Map<String,String> parameters)
endLink
in interface LinkListener
endLink
in class AbstractChainingListener
reference
- the link referencefreestanding
- if true then the link is a free standing URI directly in the textparameters
- a generic list of parameters. Example: style="background-color: blue"ResourceReference
public void endList(ListType type, Map<String,String> parameters)
Listener
endList
in interface Listener
endList
in class AbstractChainingListener
type
- the type of list (bulleted, numbered, etc)parameters
- a generic list of parameters for the list. Example: "style"/"background-color: blue"ListType
public void endListItem()
Listener
endListItem
in interface Listener
endListItem
in class AbstractChainingListener
public void endListItem(Map<String,String> parameters)
Listener
endListItem
in interface Listener
endListItem
in class AbstractChainingListener
parameters
- a generic list of parameters for the list item. Example: "style"/"background-color: blue"public void endMacroMarker(String name, Map<String,String> parameters, String content, boolean isInline)
Listener
endMacroMarker
in interface Listener
endMacroMarker
in class AbstractChainingListener
name
- the macro nameparameters
- the macro parameterscontent
- the macro contentisInline
- if true the macro is located in a inline content (like paragraph, etc.)Listener.beginMacroMarker(String, java.util.Map, String, boolean)
public void endMetaData(MetaData metadata)
endMetaData
in interface Listener
endMetaData
in class AbstractChainingListener
metadata
- the metadatapublic void endParagraph(Map<String,String> parameters)
Listener
endParagraph
in interface Listener
endParagraph
in class AbstractChainingListener
parameters
- a generic list of parameters. Example: style="background-color: blue"public void endQuotation(Map<String,String> parameters)
Listener
endQuotation
in interface Listener
endQuotation
in class AbstractChainingListener
parameters
- a generic list of parameters for the quotation. Example: "style"/"background-color: blue"public void endQuotationLine()
Listener
endQuotationLine
in interface Listener
endQuotationLine
in class AbstractChainingListener
public void endSection(Map<String,String> parameters)
Listener
endSection
in interface Listener
endSection
in class AbstractChainingListener
parameters
- a generic list of parameters. Example: style="background-color: blue"HeaderLevel
public void endTable(Map<String,String> parameters)
Listener
endTable
in interface Listener
endTable
in class AbstractChainingListener
parameters
- a generic list of parameters for the table.public void endTableCell(Map<String,String> parameters)
Listener
endTableCell
in interface Listener
endTableCell
in class AbstractChainingListener
parameters
- a generic list of parameters for the table cell.public void endTableHeadCell(Map<String,String> parameters)
Listener
endTableHeadCell
in interface Listener
endTableHeadCell
in class AbstractChainingListener
parameters
- a generic list of parameters for the table head cell.public void endTableRow(Map<String,String> parameters)
Listener
endTableRow
in interface Listener
endTableRow
in class AbstractChainingListener
parameters
- a generic list of parameters for the table row.public void endFigure(Map<String,String> parameters)
Listener
endFigure
in interface Listener
endFigure
in class AbstractChainingListener
parameters
- a generic list of parameters for the figurepublic void endFigureCaption(Map<String,String> parameters)
Listener
endFigureCaption
in interface Listener
endFigureCaption
in class AbstractChainingListener
parameters
- a generic list of parameters for the figurepublic void onRawText(String text, Syntax syntax)
Listener
onRawText
in interface Listener
onRawText
in class AbstractChainingListener
text
- 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 syntaxpublic void onEmptyLines(int count)
Listener
onEmptyLines
in interface Listener
onEmptyLines
in class AbstractChainingListener
count
- the number of empty lines between 2 standalone Blockspublic void onHorizontalLine(Map<String,String> parameters)
Listener
onHorizontalLine
in interface Listener
onHorizontalLine
in class AbstractChainingListener
parameters
- a generic list of parameters. Example: style="background-color: blue"public void onId(String name)
Listener
onId
in interface Listener
onId
in class AbstractChainingListener
name
- the location name.public void onImage(ResourceReference reference, boolean freestanding, Map<String,String> parameters)
onImage
in interface ImageListener
onImage
in class AbstractChainingListener
reference
- the image referencefreestanding
- if true then the image is defined directly as a URI in the textparameters
- a generic list of parameters. Example: style="background-color: blue"public void onMacro(String id, Map<String,String> parameters, String content, boolean inline)
Listener
onMacro
in interface Listener
onMacro
in class AbstractChainingListener
id
- the macro id (eg "toc" for the TOC macro)parameters
- the macro parameterscontent
- the macro contentinline
- if true the macro is located in a inline content (like paragraph, etc.)public void onNewLine()
Listener
onNewLine
in interface Listener
onNewLine
in class AbstractChainingListener
public void onSpace()
Listener
onSpace
in interface Listener
onSpace
in class AbstractChainingListener
public void onSpecialSymbol(char symbol)
Listener
*
, <
, >
, =
, quote, etc). Any non alpha numeric character is a
special symbol.onSpecialSymbol
in interface Listener
onSpecialSymbol
in class AbstractChainingListener
symbol
- the symbol encounteredpublic void onVerbatim(String content, boolean inline, Map<String,String> parameters)
Listener
onVerbatim
in interface Listener
onVerbatim
in class AbstractChainingListener
content
- the string to protected from renderinginline
- 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"public void onWord(String word)
Listener
onWord
in interface Listener
onWord
in class AbstractChainingListener
word
- the word encounteredpublic void transferStart(QueueListener eventsToTransfer)
eventsToTransfer
- the collection of events to moveCopyright © 2004–2021 XWiki. All rights reserved.