Class ConsecutiveNewLineStateChainingListener
java.lang.Object
org.xwiki.rendering.listener.chaining.AbstractChainingListener
org.xwiki.rendering.listener.chaining.ConsecutiveNewLineStateChainingListener
- All Implemented Interfaces:
ChainingListener,StackableChainingListener,ImageListener,LinkListener,Listener
public class ConsecutiveNewLineStateChainingListener
extends AbstractChainingListener
implements StackableChainingListener
Counts consecutive new lines.
- Since:
- 1.8RC1
- Version:
- $Id; $
-
Field Summary
Fields inherited from interface org.xwiki.rendering.listener.Listener
EMPTY_PARAMETERS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidEnd 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.voidendParagraph(Map<String, String> parameters) End of a paragraph.voidendQuotation(Map<String, String> parameters) End of a quotation.voidEnd of a quotation line.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.intvoidonEmptyLines(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.Methods inherited from class org.xwiki.rendering.listener.chaining.AbstractChainingListener
beginDefinitionDescription, beginDefinitionList, beginDefinitionTerm, beginDocument, beginFigure, beginFigureCaption, beginFormat, beginGroup, beginHeader, beginLink, beginList, beginListItem, beginListItem, beginMacroMarker, beginMetaData, beginParagraph, beginQuotation, beginQuotationLine, beginSection, beginTable, beginTableCell, beginTableHeadCell, beginTableRow, endMetaData, endSection, getListenerChain, setListenerChainMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xwiki.rendering.listener.chaining.ChainingListener
getListenerChainMethods inherited from interface org.xwiki.rendering.listener.LinkListener
beginLinkMethods inherited from interface org.xwiki.rendering.listener.Listener
beginDefinitionDescription, beginDefinitionList, beginDefinitionTerm, beginDocument, beginFigure, beginFigureCaption, beginFormat, beginGroup, beginHeader, beginList, beginListItem, beginListItem, beginMacroMarker, beginMetaData, beginParagraph, beginQuotation, beginQuotationLine, beginSection, beginTable, beginTableCell, beginTableHeadCell, beginTableRow, endMetaData, endSection
-
Constructor Details
-
ConsecutiveNewLineStateChainingListener
- Parameters:
listenerChain- seeAbstractChainingListener.getListenerChain()
-
-
Method Details
-
createChainingListenerInstance
- Specified by:
createChainingListenerInstancein interfaceStackableChainingListener- Returns:
- the new instance of the listener
-
getNewLineCount
public int getNewLineCount()- Returns:
- the number of found new lines.
-
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- Overrides:
endDefinitionDescriptionin classAbstractChainingListener
-
endDefinitionList
End of a definition list. For example in HTML this is the equivalent of </dl>.- Specified by:
endDefinitionListin interfaceListener- Overrides:
endDefinitionListin classAbstractChainingListener- Parameters:
parameters- a generic list of parameters for the list. Example: "style"/"background-color: blue"- Since:
- 2.0RC1
-
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- Overrides:
endDefinitionTermin classAbstractChainingListener
-
endDocument
End of the document.- Specified by:
endDocumentin interfaceListener- Overrides:
endDocumentin classAbstractChainingListener- Parameters:
metadata- the meta data associated with the previous events, seeMetaData- Since:
- 3.0M2
-
endGroup
Description copied from interface:ListenerEnd of the group.- Specified by:
endGroupin interfaceListener- Overrides:
endGroupin classAbstractChainingListener- Parameters:
parameters- a generic list of parameters. Example: style="background-color: blue"
-
endFormat
Description copied from interface:ListenerEnd of a text formatting block.- Specified by:
endFormatin interfaceListener- Overrides:
endFormatin classAbstractChainingListener- Parameters:
format- the formatting type (bold, italic, etc)parameters- a generic list of parameters. Example: style="background-color: blue"- See Also:
-
endLink
public void endLink(ResourceReference reference, boolean freestanding, Map<String, String> parameters) End of a link.- Specified by:
endLinkin interfaceLinkListener- Overrides:
endLinkin classAbstractChainingListener- 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"- Since:
- 2.5RC1
- See Also:
-
endList
Description copied from interface:ListenerEnd of a list.- Specified by:
endListin interfaceListener- Overrides:
endListin classAbstractChainingListener- Parameters:
type- the type of list (bulleted, numbered, etc)parameters- a generic list of parameters for the list. Example: "style"/"background-color: blue"- See Also:
-
endListItem
public void endListItem()Description copied from interface:ListenerEnd of a list item.- Specified by:
endListItemin interfaceListener- Overrides:
endListItemin classAbstractChainingListener
-
endListItem
Description copied from interface:ListenerEnd of a list item.- Specified by:
endListItemin interfaceListener- Overrides:
endListItemin classAbstractChainingListener- 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- Overrides:
endMacroMarkerin classAbstractChainingListener- 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- Overrides:
endParagraphin classAbstractChainingListener- Parameters:
parameters- a generic list of parameters. Example: style="background-color: blue"
-
endQuotation
Description copied from interface:ListenerEnd of a quotation.- Specified by:
endQuotationin interfaceListener- Overrides:
endQuotationin classAbstractChainingListener- Parameters:
parameters- a generic list of parameters for the quotation. Example: "style"/"background-color: blue"
-
endQuotationLine
public void endQuotationLine()Description copied from interface:ListenerEnd of a quotation line.- Specified by:
endQuotationLinein interfaceListener- Overrides:
endQuotationLinein classAbstractChainingListener
-
endHeader
Description copied from interface:ListenerEnd of a header.- Specified by:
endHeaderin interfaceListener- Overrides:
endHeaderin classAbstractChainingListener- 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:
-
endTable
Description copied from interface:ListenerEnd of a table.- Specified by:
endTablein interfaceListener- Overrides:
endTablein classAbstractChainingListener- Parameters:
parameters- a generic list of parameters for the table.
-
endTableCell
Description copied from interface:ListenerEnd of a table cell.- Specified by:
endTableCellin interfaceListener- Overrides:
endTableCellin classAbstractChainingListener- 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- Overrides:
endTableHeadCellin classAbstractChainingListener- 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- Overrides:
endTableRowin classAbstractChainingListener- Parameters:
parameters- a generic list of parameters for the table row.
-
endFigure
Description copied from interface:ListenerEnd of a figure.- Specified by:
endFigurein interfaceListener- Overrides:
endFigurein classAbstractChainingListener- Parameters:
parameters- a generic list of parameters for the figure
-
endFigureCaption
Description copied from interface:ListenerEnd of a figure caption.- Specified by:
endFigureCaptionin interfaceListener- Overrides:
endFigureCaptionin classAbstractChainingListener- Parameters:
parameters- a generic list of parameters for the figure
-
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.- Specified by:
onRawTextin interfaceListener- Overrides:
onRawTextin classAbstractChainingListener- Parameters:
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 syntax
-
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- Overrides:
onEmptyLinesin classAbstractChainingListener- Parameters:
count- the number of empty lines between 2 standalone Blocks
-
onHorizontalLine
Description copied from interface:ListenerRepresents an horizontal line.- Specified by:
onHorizontalLinein interfaceListener- Overrides:
onHorizontalLinein classAbstractChainingListener- Parameters:
parameters- a generic list of parameters. Example: style="background-color: blue"
-
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).- Specified by:
onIdin interfaceListener- Overrides:
onIdin classAbstractChainingListener- Parameters:
name- the location name.
-
onImage
public void onImage(ResourceReference reference, boolean freestanding, Map<String, String> parameters) An image.- Specified by:
onImagein interfaceImageListener- Overrides:
onImagein classAbstractChainingListener- 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"- Since:
- 2.5RC1
-
onImage
public void onImage(ResourceReference reference, boolean freestanding, String id, Map<String, String> parameters) Description copied from interface:ImageListenerAn image.- Specified by:
onImagein interfaceImageListener- Overrides:
onImagein classAbstractChainingListener- 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"
-
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).- Specified by:
onNewLinein interfaceListener- Overrides:
onNewLinein classAbstractChainingListener
-
onSpace
public void onSpace()Description copied from interface:ListenerA space.- Specified by:
onSpacein interfaceListener- Overrides:
onSpacein classAbstractChainingListener
-
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- Overrides:
onSpecialSymbolin classAbstractChainingListener- Parameters:
symbol- the symbol encountered
-
onMacro
Description copied from interface:ListenerA Macro.- Specified by:
onMacroin interfaceListener- Overrides:
onMacroin classAbstractChainingListener- Parameters:
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.)
-
onVerbatim
Description copied from interface:ListenerA portion of text.- Specified by:
onVerbatimin interfaceListener- Overrides:
onVerbatimin classAbstractChainingListener- 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"
-
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.- Specified by:
onWordin interfaceListener- Overrides:
onWordin classAbstractChainingListener- Parameters:
word- the word encountered
-