Class PrintListener
- java.lang.Object
-
- org.xwiki.rendering.wikimodel.PrintTextListener
-
- org.xwiki.rendering.wikimodel.xhtml.PrintInlineListener
-
- org.xwiki.rendering.wikimodel.xhtml.PrintListener
-
- All Implemented Interfaces:
IWemListener
,IWemListenerDocument
,IWemListenerFigure
,IWemListenerInline
,IWemListenerList
,IWemListenerProgramming
,IWemListenerSemantic
,IWemListenerSimpleBlocks
,IWemListenerTable
public class PrintListener extends PrintInlineListener
- Since:
- 4.0M1
- Version:
- $Id: f6917623f945a4eb1fd51f960e92e647d81c0380 $
-
-
Field Summary
-
Fields inherited from class org.xwiki.rendering.wikimodel.PrintTextListener
fRefHandler
-
-
Constructor Summary
Constructors Constructor Description PrintListener(IWikiPrinter printer)
PrintListener(IWikiPrinter printer, boolean supportImage, boolean supportDownload)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
beginDefinitionDescription()
This method is used to notify about a definition description.void
beginDefinitionList(WikiParameters parameters)
This method is used to notify about a new definition list.void
beginDefinitionTerm()
A definition term.void
beginDocument(WikiParameters params)
This method is called to notify about the beginning of the top-level parsed document or about the beginning of an embedded document (contained in the main one).void
beginHeader(int headerLevel, WikiParameters params)
This method is called to notify about a new section header found in the document.void
beginInfoBlock(String infoType, WikiParameters params)
This method is used to notify about the beginning of a "typed" paragraph.void
beginList(WikiParameters parameters, boolean ordered)
This method is used to notify about a new list.void
beginListItem()
This method is used to notify about the beginning of a new item of a simple list (seeIWemListenerList.beginList(WikiParameters, boolean)
/IWemListenerList.endList(WikiParameters, boolean)
methods).void
beginListItem(WikiParameters params)
This method is used to notify about the beginning of a new item of a simple list (seeIWemListenerList.beginList(WikiParameters, boolean)
/IWemListenerList.endList(WikiParameters, boolean)
methods).void
beginParagraph(WikiParameters params)
Begin of a simple paragraph.void
beginPropertyBlock(String propertyUri, boolean doc)
This method is called to notify about the beginning of a new property found in the parsed document.void
beginQuotation(WikiParameters params)
Notifies about the beginning of a quotation elements.void
beginQuotationLine()
A list containing quotation.void
beginTable(WikiParameters params)
This method notifies about the beginning of a new table in the document.void
beginTableCell(boolean tableHead, WikiParameters params)
This method is used to notify about the beginning of a new table cell.void
beginTableRow(WikiParameters params)
This method is used to notify about the beginning of a new table row.void
endDefinitionDescription()
This method is used to notify about the end of a definition description.void
endDefinitionList(WikiParameters parameters)
This method is used to notify about the end of a definition list.void
endDefinitionTerm()
The end of a definition term.void
endDocument(WikiParameters params)
This method is used to notify about the end of a top-level or an internal document.void
endHeader(int headerLevel, WikiParameters params)
This method is called to notify about the end of a section-level header.void
endInfoBlock(String infoType, WikiParameters params)
This method is used to notify about the end of a "typed" paragraph.void
endList(WikiParameters parameters, boolean ordered)
This method is used to notify about the end of a list.void
endListItem()
This method is used to notify about the end of an item of a simple list (seeIWemListenerList.beginList(WikiParameters, boolean)
/IWemListenerList.endList(WikiParameters, boolean)
methods).void
endListItem(WikiParameters params)
This method is used to notify about the end of an item of a simple list (seeIWemListenerList.beginList(WikiParameters, boolean)
/IWemListenerList.endList(WikiParameters, boolean)
methods).void
endParagraph(WikiParameters params)
End of a simple paragraph.void
endPropertyBlock(String propertyUri, boolean doc)
This method is called to notify about the end of a block property found in the parsed document.void
endQuotation(WikiParameters params)
Notifies about the end of a quotation element sequence.void
endQuotationLine()
This method is used to notify about the end of a quotation line.void
endTable(WikiParameters params)
This method notifies about the end of a table in the document.void
endTableCell(boolean tableHead, WikiParameters params)
This method is used to notify about the end of a table cell.void
endTableRow(WikiParameters params)
This method is used to notify about the end of a table row.void
onEmptyLines(int count)
This method is used to notify about a sequence of empty lines.void
onExtensionBlock(String extensionName, WikiParameters params)
This method is used to notify about a new extension which CAN generate block elements as a result of its interpretation.void
onHorizontalLine(WikiParameters params)
This method notifies horizontal lines defined in the text.void
onMacroBlock(String macroName, WikiParameters params, String content)
This method is used to notify about a new in-line macro which CAN generate block elements as a result of its interpretation.void
onMacroInline(String macroName, WikiParameters params, String content)
This method is used to notify about a new in-line macro which CAN generate only in-line elements as a result of its interpretation.void
onTableCaption(String str)
Notifies the table caption.void
onVerbatimBlock(String str, WikiParameters params)
This method notifies about a verbatim (pre-formatted) block defined in the text-
Methods inherited from class org.xwiki.rendering.wikimodel.xhtml.PrintInlineListener
beginFormat, beginPropertyInline, endFormat, endPropertyInline, getSymbolEntity, isHtmlEntities, newReferenceHandler, onEscape, onExtensionInline, onLineBreak, onSpecialSymbol, onVerbatimInline
-
Methods inherited from class org.xwiki.rendering.wikimodel.PrintTextListener
beginSection, beginSectionContent, endBlock, endSection, endSectionContent, isSupportDownload, isSupportImage, onImage, onImage, onNewLine, onReference, onReference, onSpace, onWord, print, println, println
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.xwiki.rendering.wikimodel.IWemListenerFigure
beginFigure, beginFigureCaption, endFigure, endFigureCaption
-
-
-
-
Constructor Detail
-
PrintListener
public PrintListener(IWikiPrinter printer)
- Parameters:
printer
-
-
PrintListener
public PrintListener(IWikiPrinter printer, boolean supportImage, boolean supportDownload)
-
-
Method Detail
-
beginDefinitionDescription
public void beginDefinitionDescription()
Description copied from interface:IWemListenerList
This method is used to notify about a definition description. All definition descriptions are contained in definition lists and can contain text, embedded lists or an embedded document.- Specified by:
beginDefinitionDescription
in interfaceIWemListenerList
- Overrides:
beginDefinitionDescription
in classPrintTextListener
- See Also:
IWemListenerList.beginDefinitionDescription()
-
beginDefinitionList
public void beginDefinitionList(WikiParameters parameters)
Description copied from interface:IWemListenerList
This method is used to notify about a new definition list.- Specified by:
beginDefinitionList
in interfaceIWemListenerList
- Overrides:
beginDefinitionList
in classPrintTextListener
- Parameters:
parameters
- list of parameters for the list- See Also:
IWemListenerList.beginDefinitionList(WikiParameters)
-
beginDefinitionTerm
public void beginDefinitionTerm()
Description copied from interface:IWemListenerList
A definition term. Definition terms can contain only formatted texts. Note that it is impossible to have an embedded list or a document inside of definition terms.- Specified by:
beginDefinitionTerm
in interfaceIWemListenerList
- Overrides:
beginDefinitionTerm
in classPrintTextListener
- See Also:
IWemListenerList.beginDefinitionTerm()
-
beginDocument
public void beginDocument(WikiParameters params)
Description copied from interface:IWemListenerDocument
This method is called to notify about the beginning of the top-level parsed document or about the beginning of an embedded document (contained in the main one).- Specified by:
beginDocument
in interfaceIWemListenerDocument
- Overrides:
beginDocument
in classPrintTextListener
- Parameters:
params
- the list of parameters for this event- See Also:
IWemListenerDocument.beginDocument(WikiParameters)
-
beginHeader
public void beginHeader(int headerLevel, WikiParameters params)
Description copied from interface:IWemListenerDocument
This method is called to notify about a new section header found in the document.- Specified by:
beginHeader
in interfaceIWemListenerDocument
- Overrides:
beginHeader
in classPrintTextListener
- Parameters:
headerLevel
- the level of the found header; valid values: 1-6params
- the list of parameters for this event- See Also:
IWemListenerDocument.beginHeader(int, WikiParameters)
-
beginInfoBlock
public void beginInfoBlock(String infoType, WikiParameters params)
Description copied from interface:IWemListenerSimpleBlocks
This method is used to notify about the beginning of a "typed" paragraph. Some wiki syntaxes have special markups to define simple block elements corresponding to "warnings", "info blocks" and so on. Blocks of this type can have formatted inline elements.- Specified by:
beginInfoBlock
in interfaceIWemListenerSimpleBlocks
- Overrides:
beginInfoBlock
in classPrintTextListener
- Parameters:
infoType
- the "type" of the special blockparams
- parameters of this block- See Also:
IWemListenerSimpleBlocks.beginInfoBlock(String, WikiParameters)
-
beginList
public void beginList(WikiParameters parameters, boolean ordered)
Description copied from interface:IWemListenerList
This method is used to notify about a new list. Each list contain at least one list item. All list items are notified using theIWemListenerList.beginListItem()
/IWemListenerList.endListItem()
method pair. Items of lists of this type can contain the following sequence of elements:- formatted text - the text can be empty; in this case it is not notified
- Just after the text the list item can have:
- an embedded list - in this way it is possible to build hierarchical structures
- an embedded document - it should be defined explicitly and it can have all valid elements of the top-level document
- Specified by:
beginList
in interfaceIWemListenerList
- Overrides:
beginList
in classPrintTextListener
- Parameters:
parameters
- parameters of the listordered
- if this flag istrue
then this method corresponds to a new ordered list ("ol"); otherwise this method notifies a beginning of an unordered list ("ul")- See Also:
IWemListenerList.beginList(WikiParameters, boolean)
-
beginListItem
public void beginListItem()
Description copied from interface:IWemListenerList
This method is used to notify about the beginning of a new item of a simple list (seeIWemListenerList.beginList(WikiParameters, boolean)
/IWemListenerList.endList(WikiParameters, boolean)
methods).- Specified by:
beginListItem
in interfaceIWemListenerList
- Overrides:
beginListItem
in classPrintTextListener
- See Also:
IWemListenerList.beginListItem()
-
beginListItem
public void beginListItem(WikiParameters params)
Description copied from interface:IWemListenerList
This method is used to notify about the beginning of a new item of a simple list (seeIWemListenerList.beginList(WikiParameters, boolean)
/IWemListenerList.endList(WikiParameters, boolean)
methods).- Specified by:
beginListItem
in interfaceIWemListenerList
- Overrides:
beginListItem
in classPrintTextListener
- See Also:
IWemListenerList.endListItem(WikiParameters)
-
beginParagraph
public void beginParagraph(WikiParameters params)
Description copied from interface:IWemListenerSimpleBlocks
Begin of a simple paragraph. Paragraphs can contain only formatted inline elements.- Specified by:
beginParagraph
in interfaceIWemListenerSimpleBlocks
- Overrides:
beginParagraph
in classPrintTextListener
- Parameters:
params
- paragraph parameters- See Also:
IWemListenerSimpleBlocks.beginParagraph(WikiParameters)
-
beginPropertyBlock
public void beginPropertyBlock(String propertyUri, boolean doc)
Description copied from interface:IWemListenerSemantic
This method is called to notify about the beginning of a new property found in the parsed document.- Specified by:
beginPropertyBlock
in interfaceIWemListenerSemantic
- Overrides:
beginPropertyBlock
in classPrintTextListener
- Parameters:
propertyUri
- the URI of the semantic block property found in the documentdoc
- this flag istrue
if the found property contains a whole document; if this flag isfalse
then expected property value contains a paragraph- See Also:
IWemListenerSemantic.beginPropertyBlock(java.lang.String, boolean)
-
beginQuotation
public void beginQuotation(WikiParameters params)
Description copied from interface:IWemListenerList
Notifies about the beginning of a quotation elements.- Specified by:
beginQuotation
in interfaceIWemListenerList
- Overrides:
beginQuotation
in classPrintTextListener
- Parameters:
params
- parameters of the list- See Also:
IWemListenerList.beginQuotation(WikiParameters)
-
beginQuotationLine
public void beginQuotationLine()
Description copied from interface:IWemListenerList
A list containing quotation. This is a part of quotation lists. Each quotation item can have other quotation lists.- Specified by:
beginQuotationLine
in interfaceIWemListenerList
- Overrides:
beginQuotationLine
in classPrintTextListener
- See Also:
IWemListenerList.beginQuotationLine()
-
beginTable
public void beginTable(WikiParameters params)
Description copied from interface:IWemListenerTable
This method notifies about the beginning of a new table in the document.- Specified by:
beginTable
in interfaceIWemListenerTable
- Overrides:
beginTable
in classPrintTextListener
- Parameters:
params
- table parameters- See Also:
IWemListenerTable.beginTable(WikiParameters)
-
beginTableCell
public void beginTableCell(boolean tableHead, WikiParameters params)
Description copied from interface:IWemListenerTable
This method is used to notify about the beginning of a new table cell.- Specified by:
beginTableCell
in interfaceIWemListenerTable
- Overrides:
beginTableCell
in classPrintTextListener
- Parameters:
tableHead
- if this flag istrue
then the reported cell corresponds to the table head ("th" element); otherwise it should be considered as a normal table cell ("td" element).params
- parameters of this cell- See Also:
IWemListenerTable.beginTableCell(boolean, WikiParameters)
-
beginTableRow
public void beginTableRow(WikiParameters params)
Description copied from interface:IWemListenerTable
This method is used to notify about the beginning of a new table row.- Specified by:
beginTableRow
in interfaceIWemListenerTable
- Overrides:
beginTableRow
in classPrintTextListener
- Parameters:
params
- parameters of the row.- See Also:
IWemListenerTable.beginTableRow(WikiParameters)
-
endDefinitionDescription
public void endDefinitionDescription()
Description copied from interface:IWemListenerList
This method is used to notify about the end of a definition description.- Specified by:
endDefinitionDescription
in interfaceIWemListenerList
- Overrides:
endDefinitionDescription
in classPrintTextListener
- See Also:
IWemListenerList.endDefinitionDescription()
-
endDefinitionList
public void endDefinitionList(WikiParameters parameters)
Description copied from interface:IWemListenerList
This method is used to notify about the end of a definition list.- Specified by:
endDefinitionList
in interfaceIWemListenerList
- Overrides:
endDefinitionList
in classPrintTextListener
- Parameters:
parameters
- list of parameters for the list- See Also:
IWemListenerList.endDefinitionList(WikiParameters)
-
endDefinitionTerm
public void endDefinitionTerm()
Description copied from interface:IWemListenerList
The end of a definition term.- Specified by:
endDefinitionTerm
in interfaceIWemListenerList
- Overrides:
endDefinitionTerm
in classPrintTextListener
- See Also:
IWemListenerList.endDefinitionTerm()
-
endDocument
public void endDocument(WikiParameters params)
Description copied from interface:IWemListenerDocument
This method is used to notify about the end of a top-level or an internal document.- Specified by:
endDocument
in interfaceIWemListenerDocument
- Overrides:
endDocument
in classPrintTextListener
- Parameters:
params
- the list of parameters for this event- See Also:
IWemListenerDocument.endDocument(WikiParameters)
-
endHeader
public void endHeader(int headerLevel, WikiParameters params)
Description copied from interface:IWemListenerDocument
This method is called to notify about the end of a section-level header.- Specified by:
endHeader
in interfaceIWemListenerDocument
- Overrides:
endHeader
in classPrintTextListener
- Parameters:
headerLevel
- the level of the headerparams
- the list of parameters for this event- See Also:
IWemListenerDocument.endHeader(int, WikiParameters)
-
endInfoBlock
public void endInfoBlock(String infoType, WikiParameters params)
Description copied from interface:IWemListenerSimpleBlocks
This method is used to notify about the end of a "typed" paragraph.- Specified by:
endInfoBlock
in interfaceIWemListenerSimpleBlocks
- Overrides:
endInfoBlock
in classPrintTextListener
- Parameters:
infoType
- the "type" of the special blockparams
- parameters of this block- See Also:
IWemListenerSimpleBlocks.endInfoBlock(String, WikiParameters)
-
endList
public void endList(WikiParameters parameters, boolean ordered)
Description copied from interface:IWemListenerList
This method is used to notify about the end of a list.- Specified by:
endList
in interfaceIWemListenerList
- Overrides:
endList
in classPrintTextListener
- Parameters:
parameters
- parameters of the listordered
- if this flag istrue
then this method corresponds to a new ordered list ("ol"); otherwise this method notifies a beginning of an unordered list ("ul")- See Also:
IWemListenerList.endList(WikiParameters, boolean)
-
endListItem
public void endListItem()
Description copied from interface:IWemListenerList
This method is used to notify about the end of an item of a simple list (seeIWemListenerList.beginList(WikiParameters, boolean)
/IWemListenerList.endList(WikiParameters, boolean)
methods).- Specified by:
endListItem
in interfaceIWemListenerList
- Overrides:
endListItem
in classPrintTextListener
- See Also:
IWemListenerList.endListItem()
-
endListItem
public void endListItem(WikiParameters params)
Description copied from interface:IWemListenerList
This method is used to notify about the end of an item of a simple list (seeIWemListenerList.beginList(WikiParameters, boolean)
/IWemListenerList.endList(WikiParameters, boolean)
methods).- Specified by:
endListItem
in interfaceIWemListenerList
- Overrides:
endListItem
in classPrintTextListener
- See Also:
IWemListenerList.beginListItem(WikiParameters)
-
endParagraph
public void endParagraph(WikiParameters params)
Description copied from interface:IWemListenerSimpleBlocks
End of a simple paragraph.- Specified by:
endParagraph
in interfaceIWemListenerSimpleBlocks
- Overrides:
endParagraph
in classPrintTextListener
- Parameters:
params
- paragraph parameters- See Also:
IWemListenerSimpleBlocks.endParagraph(WikiParameters)
-
endPropertyBlock
public void endPropertyBlock(String propertyUri, boolean doc)
Description copied from interface:IWemListenerSemantic
This method is called to notify about the end of a block property found in the parsed document.- Specified by:
endPropertyBlock
in interfaceIWemListenerSemantic
- Overrides:
endPropertyBlock
in classPrintTextListener
- Parameters:
propertyUri
- the URI of the semantic block property found in the documentdoc
- this flag istrue
if the found property contains a whole document; otherwise (if this flag isfalse
) the value of the property is a simple paragraph- See Also:
IWemListenerSemantic.endPropertyBlock(java.lang.String, boolean)
-
endQuotation
public void endQuotation(WikiParameters params)
Description copied from interface:IWemListenerList
Notifies about the end of a quotation element sequence.- Specified by:
endQuotation
in interfaceIWemListenerList
- Overrides:
endQuotation
in classPrintTextListener
- Parameters:
params
- parameters of the list- See Also:
IWemListenerList.endQuotation(WikiParameters)
-
endQuotationLine
public void endQuotationLine()
Description copied from interface:IWemListenerList
This method is used to notify about the end of a quotation line.- Specified by:
endQuotationLine
in interfaceIWemListenerList
- Overrides:
endQuotationLine
in classPrintTextListener
- See Also:
IWemListenerList.endQuotationLine()
-
endTable
public void endTable(WikiParameters params)
Description copied from interface:IWemListenerTable
This method notifies about the end of a table in the document.- Specified by:
endTable
in interfaceIWemListenerTable
- Overrides:
endTable
in classPrintTextListener
- Parameters:
params
- table parameters- See Also:
IWemListenerTable.endTable(WikiParameters)
-
endTableCell
public void endTableCell(boolean tableHead, WikiParameters params)
Description copied from interface:IWemListenerTable
This method is used to notify about the end of a table cell.- Specified by:
endTableCell
in interfaceIWemListenerTable
- Overrides:
endTableCell
in classPrintTextListener
- Parameters:
tableHead
- if this flag istrue
then the reported cell corresponds to the table head ("th" element); otherwise it should be considered as a normal table cell ("td" element).params
- parameters of this cell- See Also:
IWemListenerTable.endTableCell(boolean, WikiParameters)
-
endTableRow
public void endTableRow(WikiParameters params)
Description copied from interface:IWemListenerTable
This method is used to notify about the end of a table row.- Specified by:
endTableRow
in interfaceIWemListenerTable
- Overrides:
endTableRow
in classPrintTextListener
- Parameters:
params
- parameters of the row.- See Also:
IWemListenerTable.endTableRow(WikiParameters)
-
onEmptyLines
public void onEmptyLines(int count)
Description copied from interface:IWemListenerSimpleBlocks
This method is used to notify about a sequence of empty lines. This event can be interpreted as an "empty paragraph".- Specified by:
onEmptyLines
in interfaceIWemListenerSimpleBlocks
- Overrides:
onEmptyLines
in classPrintTextListener
- Parameters:
count
- the number of empty lines found in the text
-
onExtensionBlock
public void onExtensionBlock(String extensionName, WikiParameters params)
Description copied from interface:IWemListenerProgramming
This method is used to notify about a new extension which CAN generate block elements as a result of its interpretation.- Specified by:
onExtensionBlock
in interfaceIWemListenerProgramming
- Overrides:
onExtensionBlock
in classPrintTextListener
- Parameters:
extensionName
- the name of the extensionparams
- parameters for the extension- See Also:
PrintTextListener.onExtensionBlock(java.lang.String, org.xwiki.rendering.wikimodel.WikiParameters)
-
onHorizontalLine
public void onHorizontalLine(WikiParameters params)
Description copied from interface:IWemListenerSimpleBlocks
This method notifies horizontal lines defined in the text.- Specified by:
onHorizontalLine
in interfaceIWemListenerSimpleBlocks
- Overrides:
onHorizontalLine
in classPrintTextListener
- Parameters:
params
- parameters of the horizontal line- See Also:
IWemListenerSimpleBlocks.onHorizontalLine(WikiParameters params)
-
onMacroBlock
public void onMacroBlock(String macroName, WikiParameters params, String content)
Description copied from interface:IWemListenerProgramming
This method is used to notify about a new in-line macro which CAN generate block elements as a result of its interpretation.- Specified by:
onMacroBlock
in interfaceIWemListenerProgramming
- Overrides:
onMacroBlock
in classPrintTextListener
- Parameters:
macroName
- the name of the macroparams
- parameters of the macrocontent
- the content of the macro
-
onMacroInline
public void onMacroInline(String macroName, WikiParameters params, String content)
Description copied from interface:IWemListenerProgramming
This method is used to notify about a new in-line macro which CAN generate only in-line elements as a result of its interpretation. This method CAN NOT generate block elements.- Specified by:
onMacroInline
in interfaceIWemListenerProgramming
- Overrides:
onMacroInline
in classPrintTextListener
- Parameters:
macroName
- the name of the macroparams
- parameters of the macrocontent
- the content of the macro
-
onTableCaption
public void onTableCaption(String str)
Description copied from interface:IWemListenerTable
Notifies the table caption.- Specified by:
onTableCaption
in interfaceIWemListenerTable
- Overrides:
onTableCaption
in classPrintTextListener
- Parameters:
str
- the content of the table caption- See Also:
IWemListenerTable.onTableCaption(java.lang.String)
-
onVerbatimBlock
public void onVerbatimBlock(String str, WikiParameters params)
Description copied from interface:IWemListenerSimpleBlocks
This method notifies about a verbatim (pre-formatted) block defined in the text- Specified by:
onVerbatimBlock
in interfaceIWemListenerSimpleBlocks
- Overrides:
onVerbatimBlock
in classPrintTextListener
- Parameters:
str
- the content of the verbatim (pre-formatted) blockparams
- parameters of the verbatim block- See Also:
IWemListenerSimpleBlocks.onVerbatimBlock(String, WikiParameters)
-
-