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
A Listener wrapping another Listener.
- Version:
- $Id: f47d02b016759f3a6240136d55bcf9a0ed1753ea $
-
Field Summary
Fields inherited from interface org.xwiki.rendering.listener.Listener
EMPTY_PARAMETERS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidStart of a definition list description.voidbeginDefinitionList(Map<String, String> parameters) Start of a definition list.voidStart 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.voidStart of a list.voidStart of a list item.voidbeginListItem(Map<String, String> parameters) Start of a list item.voidStart 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.voidStart 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.voidEnd of a definition list description.voidendDefinitionList(Map<String, String> parameters) End of a definition list.voidEnd of a definition list term.voidendDocument(MetaData metadata) End of the document.voidEnd of a figure.voidendFigureCaption(Map<String, String> parameters) End of a figure caption.voidEnd of a text formatting block.voidEnd of the group.voidEnd of a header.voidendLink(ResourceReference reference, boolean freestanding, Map<String, String> parameters) End of a link.voidEnd of a list.voidEnd of a list item.voidendListItem(Map<String, String> parameters) End of a list item.voidEnd 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.voidEnd of a quotation line.voidendSection(Map<String, String> parameters) End of a section.voidEnd 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.voidonEmptyLines(int count) Represents an empty line between 2 standalone Blocks.voidonHorizontalLine(Map<String, String> parameters) Represents an horizontal line.voidA 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.voidA Macro.voidA 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).voidSome 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.voidA word.voidsetWrappedListener(Listener listener)
-
Constructor Details
-
WrappingListener
public WrappingListener()
-
-
Method Details
-
setWrappedListener
- Parameters:
listener- the Listener to wrap
-
getWrappedListener
- Returns:
- the Listener to wrap
-
beginDocument
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
Description copied from interface:ListenerStart of a figure.- Specified by:
beginFigurein interfaceListener- Parameters:
parameters- a generic list of parameters for the figure
-
beginFigureCaption
Description copied from interface:ListenerStart of a figure caption.- Specified by:
beginFigureCaptionin interfaceListener- Parameters:
parameters- a generic list of parameters for the figure
-
endDocument
Description copied from interface:ListenerEnd of the document.- Specified by:
endDocumentin interfaceListener- Parameters:
metadata- the meta data associated with the previous events, seeMetaData
-
endFigure
Description copied from interface:ListenerEnd of a figure. -
endFigureCaption
Description copied from interface:ListenerEnd of a figure caption.- Specified by:
endFigureCaptionin interfaceListener- Parameters:
parameters- a generic list of parameters for the figure
-
beginGroup
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
Description copied from interface:ListenerEnd of the group. -
beginFormat
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:
-
beginList
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
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:
-
beginParagraph
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
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:
-
beginHeader
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:
-
endFormat
Description copied from interface:ListenerEnd of a text formatting block. -
endList
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
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:
-
endParagraph
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
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:
-
endHeader
Description copied from interface:ListenerEnd of a header. -
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:
-
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:
-
onMacro
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
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
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
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
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
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
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
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
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
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
Description copied from interface:ListenerStart of a table.- Specified by:
beginTablein interfaceListener- Parameters:
parameters- a generic list of parameters for the table.
-
beginTableCell
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
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
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
Description copied from interface:ListenerEnd of a table. -
endTableCell
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
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
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
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
Description copied from interface:ListenerEnd of MetaData.- Specified by:
endMetaDatain interfaceListener- Parameters:
metadata- the metadata
-