Class XWikiSerializer
- java.lang.Object
-
- org.xwiki.rendering.wikimodel.PrintTextListener
-
- org.xwiki.rendering.wikimodel.xwiki.xwiki10.XWikiSerializer
-
- All Implemented Interfaces:
IWemListener
,IWemListenerDocument
,IWemListenerFigure
,IWemListenerInline
,IWemListenerList
,IWemListenerProgramming
,IWemListenerSemantic
,IWemListenerSimpleBlocks
,IWemListenerTable
public class XWikiSerializer extends PrintTextListener
Serializing XWiki 1.0 syntax ...- Since:
- 4.0M1
- Version:
- $Id: fe5b795f2d40177b22ab566c1d67c0bbebd804fc $
- See Also:
XWikiSerializer2
-
-
Field Summary
-
Fields inherited from class org.xwiki.rendering.wikimodel.PrintTextListener
fRefHandler
-
-
Constructor Summary
Constructors Constructor Description XWikiSerializer(IWikiPrinter printer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
beginHeader(int headerLevel, WikiParameters params)
This method is called to notify about a new section header found in the document.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
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
endHeader(int headerLevel, WikiParameters params)
This method is called to notify about the end of a section-level header.void
endList(WikiParameters params, 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
endTable(WikiParameters params)
This method notifies about the end of a table in the document.void
endTableRow(WikiParameters params)
This method is used to notify about the end of a table row.protected String
getEol()
void
onHorizontalLine()
void
onLineBreak()
This method is called to notify about a forced line break found in the text.void
onReference(String ref)
This method is called to notify that an URI (an implicit reference) was found in the parsed wiki document.void
onSpecialSymbol(String str)
This method is called to notify about a sequence of special characters.void
onTableCaption(String str)
Notifies the table caption.void
onVerbatimInline(String str, WikiParameters params)
This method is called to notify about not-interpreted in-line sequence of characters which should be represented in the final text "as is".-
Methods inherited from class org.xwiki.rendering.wikimodel.PrintTextListener
beginDefinitionDescription, beginDefinitionList, beginDefinitionTerm, beginDocument, beginFormat, beginInfoBlock, beginList, beginParagraph, beginPropertyBlock, beginPropertyInline, beginQuotation, beginQuotationLine, beginSection, beginSectionContent, endBlock, endDefinitionDescription, endDefinitionList, endDefinitionTerm, endDocument, endFormat, endInfoBlock, endPropertyBlock, endPropertyInline, endQuotation, endQuotationLine, endSection, endSectionContent, endTableCell, isSupportDownload, isSupportImage, newReferenceHandler, onEmptyLines, onEscape, onExtensionBlock, onExtensionInline, onHorizontalLine, onImage, onImage, onMacroBlock, onMacroInline, onNewLine, onReference, onSpace, onVerbatimBlock, 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
-
XWikiSerializer
public XWikiSerializer(IWikiPrinter printer)
-
-
Method Detail
-
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)
-
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)
-
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)
-
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)
-
endList
public void endList(WikiParameters params, 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:
params
- 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)
-
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)
-
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)
-
getEol
protected String getEol()
-
onHorizontalLine
public void onHorizontalLine()
-
onLineBreak
public void onLineBreak()
Description copied from interface:IWemListenerInline
This method is called to notify about a forced line break found in the text. Note that the line break symbol can be found in the middle of a "physical" line so this event is not equals to theIWemListenerInline.onNewLine()
notification.- Specified by:
onLineBreak
in interfaceIWemListenerInline
- Overrides:
onLineBreak
in classPrintTextListener
- See Also:
IWemListenerInline.onLineBreak()
-
onReference
public void onReference(String ref)
Description copied from interface:IWemListenerInline
This method is called to notify that an URI (an implicit reference) was found in the parsed wiki document.- Specified by:
onReference
in interfaceIWemListenerInline
- Overrides:
onReference
in classPrintTextListener
- Parameters:
ref
- the URI- See Also:
IWemListenerInline.onReference(java.lang.String)
-
onSpecialSymbol
public void onSpecialSymbol(String str)
Description copied from interface:IWemListenerInline
This method is called to notify about a sequence of special characters. Special symbols are characters which are not interpreted as a part of a word (letters or digits) or as a space. Note that the handling of these symbols requires special attention because these symbols most frequently used to define text formatting. Various wiki syntaxes use combinations of these sequences to define structural elements in wiki documents.The full list of possible special symbols:
"!", "\"", "#", "$", "%", "&", "'", "(", ")", "*", "+", ",", "-", ".", "/", ":", ";", "<", "=", ">", "?", "@", "[", "\\", "]", "^", "_", "`", "{", "|", "}", "~"
- Specified by:
onSpecialSymbol
in interfaceIWemListenerInline
- Overrides:
onSpecialSymbol
in classPrintTextListener
- Parameters:
str
- the sequence of special symbols- See Also:
IWemListenerInline.onSpecialSymbol(java.lang.String)
-
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)
-
onVerbatimInline
public void onVerbatimInline(String str, WikiParameters params)
Description copied from interface:IWemListenerInline
This method is called to notify about not-interpreted in-line sequence of characters which should be represented in the final text "as is".- Specified by:
onVerbatimInline
in interfaceIWemListenerInline
- Overrides:
onVerbatimInline
in classPrintTextListener
- Parameters:
str
- the sequence of non-interpreted charactersparams
- the list of parameters for this event- See Also:
IWemListenerInline.onVerbatimInline(java.lang.String, WikiParameters)
-
-