Package org.xwiki.rendering.listener
Class WrappingListener
- java.lang.Object
-
- org.xwiki.rendering.listener.WrappingListener
-
- All Implemented Interfaces:
ImageListener,LinkListener,Listener
- Direct Known Subclasses:
InlineFilterListener,SectionGeneratorListener
public class WrappingListener extends Object implements Listener
A Listener wrapping another Listener.- Version:
- $Id: f47d02b016759f3a6240136d55bcf9a0ed1753ea $
-
-
Field Summary
-
Fields inherited from interface org.xwiki.rendering.listener.Listener
EMPTY_PARAMETERS
-
-
Constructor Summary
Constructors Constructor Description WrappingListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeginDefinitionDescription()Start of a definition list description.voidbeginDefinitionList(Map<String,String> parameters)Start of a definition list.voidbeginDefinitionTerm()Start of a definition list term.voidbeginDocument(MetaData metadata)Start of the document.voidbeginFigure(Map<String,String> parameters)Start of a figure.voidbeginFigureCaption(Map<String,String> parameters)Start of a figure caption.voidbeginFormat(Format format, Map<String,String> parameters)End of a text formatting block.voidbeginGroup(Map<String,String> parameters)Start a group of elements.voidbeginHeader(HeaderLevel level, String id, Map<String,String> parameters)Start of a header.voidbeginLink(ResourceReference reference, boolean freestanding, Map<String,String> parameters)Start of a link.voidbeginList(ListType type, Map<String,String> parameters)Start of a list.voidbeginListItem()Start of a list item.voidbeginListItem(Map<String,String> parameters)Start of a list item.voidbeginMacroMarker(String name, Map<String,String> parameters, String content, boolean isInline)Start of marker containing a macro definition.voidbeginMetaData(MetaData metadata)Start of MetaData (eg saving source from where the content is coming from).voidbeginParagraph(Map<String,String> parameters)Start of a paragraph.voidbeginQuotation(Map<String,String> parameters)Start of a quotation.voidbeginQuotationLine()Start of a quotation line.voidbeginSection(Map<String,String> parameters)Start of a section.voidbeginTable(Map<String,String> parameters)Start of a table.voidbeginTableCell(Map<String,String> parameters)Start of a table cell.voidbeginTableHeadCell(Map<String,String> parameters)Start of a table head cell.voidbeginTableRow(Map<String,String> parameters)Start of a table row.voidendDefinitionDescription()End of a definition list description.voidendDefinitionList(Map<String,String> parameters)End of a definition list.voidendDefinitionTerm()End of a definition list term.voidendDocument(MetaData metadata)End of the document.voidendFigure(Map<String,String> parameters)End of a figure.voidendFigureCaption(Map<String,String> parameters)End of a figure caption.voidendFormat(Format format, Map<String,String> parameters)End of a text formatting block.voidendGroup(Map<String,String> parameters)End of the group.voidendHeader(HeaderLevel level, String id, Map<String,String> parameters)End of a header.voidendLink(ResourceReference reference, boolean freestanding, Map<String,String> parameters)End of a link.voidendList(ListType type, Map<String,String> parameters)End of a list.voidendListItem()End of a list item.voidendListItem(Map<String,String> parameters)End of a list item.voidendMacroMarker(String name, Map<String,String> parameters, String content, boolean isInline)End of marker containing a macro definition.voidendMetaData(MetaData metadata)End of MetaData.voidendParagraph(Map<String,String> parameters)End of a paragraph.voidendQuotation(Map<String,String> parameters)End of a quotation.voidendQuotationLine()End of a quotation line.voidendSection(Map<String,String> parameters)End of a section.voidendTable(Map<String,String> parameters)End of a table.voidendTableCell(Map<String,String> parameters)End of a table cell.voidendTableHeadCell(Map<String,String> parameters)End of a table head cell.voidendTableRow(Map<String,String> parameters)End of a table row.ListenergetWrappedListener()voidonEmptyLines(int count)Represents an empty line between 2 standalone Blocks.voidonHorizontalLine(Map<String,String> parameters)Represents an horizontal line.voidonId(String name)A reference/location in a page.voidonImage(ResourceReference reference, boolean freestanding, String id, Map<String,String> parameters)An image.voidonImage(ResourceReference reference, boolean freestanding, Map<String,String> parameters)An image.voidonMacro(String id, Map<String,String> parameters, String content, boolean inline)A Macro.voidonNewLine()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).voidonRawText(String text, Syntax syntax)Some text to inject directly into the listener output without parsing it.voidonSpace()A space.voidonSpecialSymbol(char symbol)A special symbol (*,<,>,=, quote, etc).voidonVerbatim(String content, boolean inline, Map<String,String> parameters)A portion of text.voidonWord(String word)A word.voidsetWrappedListener(Listener listener)
-
-
-
Method Detail
-
setWrappedListener
public void setWrappedListener(Listener listener)
- Parameters:
listener- the Listener to wrap
-
getWrappedListener
public Listener getWrappedListener()
- Returns:
- the Listener to wrap
-
beginDocument
public void beginDocument(MetaData metadata)
Description copied from interface:ListenerStart of the document.- Specified by:
beginDocumentin interfaceListener- Parameters:
metadata- the meta data to associate to the following events, seeMetaData
-
beginFigure
public void beginFigure(Map<String,String> parameters)
Description copied from interface:ListenerStart of a figure.- Specified by:
beginFigurein interfaceListener- Parameters:
parameters- a generic list of parameters for the figure
-
beginFigureCaption
public void beginFigureCaption(Map<String,String> parameters)
Description copied from interface:ListenerStart of a figure caption.- Specified by:
beginFigureCaptionin interfaceListener- Parameters:
parameters- a generic list of parameters for the figure
-
endDocument
public void endDocument(MetaData metadata)
Description copied from interface:ListenerEnd of the document.- Specified by:
endDocumentin interfaceListener- Parameters:
metadata- the meta data associated with the previous events, seeMetaData
-
endFigure
public void endFigure(Map<String,String> parameters)
Description copied from interface:ListenerEnd of a figure.
-
endFigureCaption
public void endFigureCaption(Map<String,String> parameters)
Description copied from interface:ListenerEnd of a figure caption.- Specified by:
endFigureCaptionin interfaceListener- Parameters:
parameters- a generic list of parameters for the figure
-
beginGroup
public void beginGroup(Map<String,String> parameters)
Description copied from interface:ListenerStart a group of elements. Groups are used to allow using standalone elements in list items, table cells, etc. They can also be used to set parameters on a group of standalone elements.- Specified by:
beginGroupin interfaceListener- Parameters:
parameters- a generic list of parameters. Example: style="background-color: blue"
-
endGroup
public void endGroup(Map<String,String> parameters)
Description copied from interface:ListenerEnd of the group.
-
beginFormat
public void beginFormat(Format format, Map<String,String> parameters)
Description copied from interface:ListenerEnd of a text formatting block.- Specified by:
beginFormatin interfaceListener- Parameters:
format- the formatting type (bold, italic, etc)parameters- a generic list of parameters. Example: style="background-color: blue"- See Also:
Format
-
beginList
public void beginList(ListType type, Map<String,String> parameters)
Description copied from interface:ListenerStart of a list.
-
beginListItem
public void beginListItem()
Description copied from interface:ListenerStart of a list item.- Specified by:
beginListItemin interfaceListener
-
beginListItem
public void beginListItem(Map<String,String> parameters)
Description copied from interface:ListenerStart of a list item.- Specified by:
beginListItemin interfaceListener- Parameters:
parameters- a generic list of parameters for the list item. Example: "style"/"background-color: blue"
-
beginMacroMarker
public void beginMacroMarker(String name, Map<String,String> parameters, String content, boolean isInline)
Description copied from interface:ListenerStart of marker containing a macro definition. This is a special that Macro Blocks emits when they are executed so that it's possible to reconstruct the initial macro syntax even after Macros have been executed. This is used for exemple by the WYSIWYG editor to let use see the result of executing a macro and still let them modify the macro definition.- Specified by:
beginMacroMarkerin interfaceListener- Parameters:
name- the macro nameparameters- the macro parameterscontent- the macro contentisInline- if true the macro is located in a inline content (like paragraph, etc.)- See Also:
Listener.onMacro(String, java.util.Map, String, boolean)
-
beginParagraph
public void beginParagraph(Map<String,String> parameters)
Description copied from interface:ListenerStart of a paragraph.- Specified by:
beginParagraphin interfaceListener- Parameters:
parameters- a generic list of parameters. Example: style="background-color: blue"
-
beginSection
public void beginSection(Map<String,String> parameters)
Description copied from interface:ListenerStart of a section.- Specified by:
beginSectionin interfaceListener- Parameters:
parameters- a generic list of parameters. Example: style="background-color: blue"- See Also:
HeaderLevel
-
beginHeader
public void beginHeader(HeaderLevel level, String id, Map<String,String> parameters)
Description copied from interface:ListenerStart of a header.- Specified by:
beginHeaderin interfaceListener- Parameters:
level- the header level (1, 2, 3, etc)id- the header unique identifierparameters- a generic list of parameters. Example: style="background-color: blue"- See Also:
HeaderLevel
-
endFormat
public void endFormat(Format format, Map<String,String> parameters)
Description copied from interface:ListenerEnd of a text formatting block.
-
endList
public void endList(ListType type, Map<String,String> parameters)
Description copied from interface:ListenerEnd of a list.
-
endListItem
public void endListItem()
Description copied from interface:ListenerEnd of a list item.- Specified by:
endListItemin interfaceListener
-
endListItem
public void endListItem(Map<String,String> parameters)
Description copied from interface:ListenerEnd of a list item.- Specified by:
endListItemin interfaceListener- Parameters:
parameters- a generic list of parameters for the list item. Example: "style"/"background-color: blue"
-
endMacroMarker
public void endMacroMarker(String name, Map<String,String> parameters, String content, boolean isInline)
Description copied from interface:ListenerEnd of marker containing a macro definition.- Specified by:
endMacroMarkerin interfaceListener- Parameters:
name- the macro nameparameters- the macro parameterscontent- the macro contentisInline- if true the macro is located in a inline content (like paragraph, etc.)- See Also:
Listener.beginMacroMarker(String, java.util.Map, String, boolean)
-
endParagraph
public void endParagraph(Map<String,String> parameters)
Description copied from interface:ListenerEnd of a paragraph.- Specified by:
endParagraphin interfaceListener- Parameters:
parameters- a generic list of parameters. Example: style="background-color: blue"
-
endSection
public void endSection(Map<String,String> parameters)
Description copied from interface:ListenerEnd of a section.- Specified by:
endSectionin interfaceListener- Parameters:
parameters- a generic list of parameters. Example: style="background-color: blue"- See Also:
HeaderLevel
-
endHeader
public void endHeader(HeaderLevel level, String id, Map<String,String> parameters)
Description copied from interface:ListenerEnd of a header.- Specified by:
endHeaderin interfaceListener- Parameters:
level- the header level (1, 2, 3, etc)id- the header unique identifierparameters- a generic list of parameters. Example: style="background-color: blue"- See Also:
HeaderLevel
-
beginLink
public void beginLink(ResourceReference reference, boolean freestanding, Map<String,String> parameters)
Description copied from interface:LinkListenerStart of a link.- Specified by:
beginLinkin interfaceLinkListener- Parameters:
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"- See Also:
ResourceReference
-
endLink
public void endLink(ResourceReference reference, boolean freestanding, Map<String,String> parameters)
Description copied from interface:LinkListenerEnd of a link.- Specified by:
endLinkin interfaceLinkListener- Parameters:
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"- See Also:
ResourceReference
-
onMacro
public void onMacro(String id, Map<String,String> parameters, String content, boolean inline)
Description copied from interface:ListenerA Macro.
-
onNewLine
public void onNewLine()
Description copied from interface:ListenerA 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).
-
onSpace
public void onSpace()
Description copied from interface:ListenerA space.
-
onSpecialSymbol
public void onSpecialSymbol(char symbol)
Description copied from interface:ListenerA special symbol (*,<,>,=, quote, etc). Any non alpha numeric character is a special symbol.- Specified by:
onSpecialSymbolin interfaceListener- Parameters:
symbol- the symbol encountered
-
onWord
public void onWord(String word)
Description copied from interface:ListenerA word. Note that sentences ar broken into different events: word events, special symbols events, space events, etc. This allows fine-grained actions for listeners.
-
onId
public void onId(String name)
Description copied from interface:ListenerA reference/location in a page. In HTML for example this is called an Anchor. It allows pointing to that location, for example in links. Note that there is no wiki syntax for this in general and it's often generated by Macros (such as the TOC Macro).
-
onHorizontalLine
public void onHorizontalLine(Map<String,String> parameters)
Description copied from interface:ListenerRepresents an horizontal line.- Specified by:
onHorizontalLinein interfaceListener- Parameters:
parameters- a generic list of parameters. Example: style="background-color: blue"
-
onEmptyLines
public void onEmptyLines(int count)
Description copied from interface:ListenerRepresents an empty line between 2 standalone Blocks. A standalone block is block that is not included in another block. Standalone blocks are Paragraph, Standalone Macro, Lists, Table, etc.- Specified by:
onEmptyLinesin interfaceListener- Parameters:
count- the number of empty lines between 2 standalone Blocks
-
onVerbatim
public void onVerbatim(String content, boolean inline, Map<String,String> parameters)
Description copied from interface:ListenerA portion of text.- Specified by:
onVerbatimin interfaceListener- Parameters:
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"
-
onRawText
public void onRawText(String text, Syntax syntax)
Description copied from interface:ListenerSome text to inject directly into the listener output without parsing it. For example a HTML macro could inject directly some HTML entered by the user into the rendered HTML output. Note that it's not recommended to use this event in most cases since it can lead to invalid content being generated and in addition most listener implementations will not understand the injected text and will just ignore it.
-
beginDefinitionList
public void beginDefinitionList(Map<String,String> parameters)
Description copied from interface:ListenerStart of a definition list. For example in HTML this is the equivalent of <dl>.- Specified by:
beginDefinitionListin interfaceListener- Parameters:
parameters- a generic list of parameters for the list. Example: "style"/"background-color: blue"
-
endDefinitionList
public void endDefinitionList(Map<String,String> parameters)
Description copied from interface:ListenerEnd of a definition list. For example in HTML this is the equivalent of </dl>.- Specified by:
endDefinitionListin interfaceListener- Parameters:
parameters- a generic list of parameters for the list. Example: "style"/"background-color: blue"
-
beginDefinitionTerm
public void beginDefinitionTerm()
Description copied from interface:ListenerStart of a definition list term. For example in HTML this is the equivalent of <dt>.- Specified by:
beginDefinitionTermin interfaceListener
-
beginDefinitionDescription
public void beginDefinitionDescription()
Description copied from interface:ListenerStart of a definition list description. For example in HTML this is the equivalent of <dd>.- Specified by:
beginDefinitionDescriptionin interfaceListener
-
endDefinitionTerm
public void endDefinitionTerm()
Description copied from interface:ListenerEnd of a definition list term. For example in HTML this is the equivalent of </dt>.- Specified by:
endDefinitionTermin interfaceListener
-
endDefinitionDescription
public void endDefinitionDescription()
Description copied from interface:ListenerEnd of a definition list description. For example in HTML this is the equivalent of </dd>.- Specified by:
endDefinitionDescriptionin interfaceListener
-
beginQuotation
public void beginQuotation(Map<String,String> parameters)
Description copied from interface:ListenerStart of a quotation. There are one or several quotation lines inside a quotation block.- Specified by:
beginQuotationin interfaceListener- Parameters:
parameters- a generic list of parameters for the quotation. Example: "style"/"background-color: blue"
-
endQuotation
public void endQuotation(Map<String,String> parameters)
Description copied from interface:ListenerEnd of a quotation.- Specified by:
endQuotationin interfaceListener- Parameters:
parameters- a generic list of parameters for the quotation. Example: "style"/"background-color: blue"
-
beginQuotationLine
public void beginQuotationLine()
Description copied from interface:ListenerStart of a quotation line. There can be several quotation lines in a quotation block.- Specified by:
beginQuotationLinein interfaceListener
-
endQuotationLine
public void endQuotationLine()
Description copied from interface:ListenerEnd of a quotation line.- Specified by:
endQuotationLinein interfaceListener
-
beginTable
public void beginTable(Map<String,String> parameters)
Description copied from interface:ListenerStart of a table.- Specified by:
beginTablein interfaceListener- Parameters:
parameters- a generic list of parameters for the table.
-
beginTableCell
public void beginTableCell(Map<String,String> parameters)
Description copied from interface:ListenerStart of a table cell.- Specified by:
beginTableCellin interfaceListener- Parameters:
parameters- a generic list of parameters for the table cell.
-
beginTableHeadCell
public void beginTableHeadCell(Map<String,String> parameters)
Description copied from interface:ListenerStart of a table head cell.- Specified by:
beginTableHeadCellin interfaceListener- Parameters:
parameters- a generic list of parameters for the table head cell.
-
beginTableRow
public void beginTableRow(Map<String,String> parameters)
Description copied from interface:ListenerStart of a table row.- Specified by:
beginTableRowin interfaceListener- Parameters:
parameters- a generic list of parameters for the table row.
-
endTable
public void endTable(Map<String,String> parameters)
Description copied from interface:ListenerEnd of a table.
-
endTableCell
public void endTableCell(Map<String,String> parameters)
Description copied from interface:ListenerEnd of a table cell.- Specified by:
endTableCellin interfaceListener- Parameters:
parameters- a generic list of parameters for the table cell.
-
endTableHeadCell
public void endTableHeadCell(Map<String,String> parameters)
Description copied from interface:ListenerEnd of a table head cell.- Specified by:
endTableHeadCellin interfaceListener- Parameters:
parameters- a generic list of parameters for the table head cell.
-
endTableRow
public void endTableRow(Map<String,String> parameters)
Description copied from interface:ListenerEnd of a table row.- Specified by:
endTableRowin interfaceListener- Parameters:
parameters- a generic list of parameters for the table row.
-
onImage
public void onImage(ResourceReference reference, boolean freestanding, Map<String,String> parameters)
Description copied from interface:ImageListenerAn image.- Specified by:
onImagein interfaceImageListener- Parameters:
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"
-
onImage
public void onImage(ResourceReference reference, boolean freestanding, String id, Map<String,String> parameters)
Description copied from interface:ImageListenerAn image.- Specified by:
onImagein interfaceImageListener- Parameters:
reference- the image referencefreestanding- if true then the image is defined directly as a URI in the textid- the (generated) id of the imageparameters- a generic list of parameters. Example: style="background-color: blue"
-
beginMetaData
public void beginMetaData(MetaData metadata)
Description copied from interface:ListenerStart of MetaData (eg saving source from where the content is coming from).- Specified by:
beginMetaDatain interfaceListener- Parameters:
metadata- the metadata
-
endMetaData
public void endMetaData(MetaData metadata)
Description copied from interface:ListenerEnd of MetaData.- Specified by:
endMetaDatain interfaceListener- Parameters:
metadata- the metadata
-
-