Class WikiSerializerHandler
java.lang.Object
org.wikimodel.wem.PrintTextListener
org.wikimodel.wem.PrintInlineListener
org.wikimodel.wem.PrintListener
org.nuxeo.ecm.platform.rendering.wiki.WikiSerializerHandler
- All Implemented Interfaces:
org.wikimodel.wem.IWemListener
public class WikiSerializerHandler
extends org.wikimodel.wem.PrintListener
- Author:
- Bogdan Stefanescu
-
Field Summary
Modifier and TypeFieldDescriptionprotected final WikiSerializer
protected freemarker.core.Environment
protected static final String
protected int
protected Toc
protected final StringBuilder
protected WikiWriter
Fields inherited from class org.wikimodel.wem.PrintTextListener
fRefHandler
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
beginDefinitionList
(org.wikimodel.wem.WikiParameters parameters) void
void
protected void
void
beginFormat
(org.wikimodel.wem.WikiFormat format) void
beginHeader
(int level, org.wikimodel.wem.WikiParameters params) void
beginInfoBlock
(char infoType, org.wikimodel.wem.WikiParameters params) void
beginList
(org.wikimodel.wem.WikiParameters parameters, boolean ordered) void
void
beginParagraph
(org.wikimodel.wem.WikiParameters params) void
beginPropertyBlock
(String propertyUri, boolean doc) void
void
beginQuotation
(org.wikimodel.wem.WikiParameters params) void
void
beginTable
(org.wikimodel.wem.WikiParameters params) void
beginTableCell
(boolean tableHead, org.wikimodel.wem.WikiParameters params) void
beginTableRow
(org.wikimodel.wem.WikiParameters params) void
void
endDefinitionList
(org.wikimodel.wem.WikiParameters parameters) void
void
protected void
void
endFormat
(org.wikimodel.wem.WikiFormat format) void
endHeader
(int level, org.wikimodel.wem.WikiParameters params) void
endInfoBlock
(char infoType, org.wikimodel.wem.WikiParameters params) void
endList
(org.wikimodel.wem.WikiParameters parameters, boolean ordered) void
void
endParagraph
(org.wikimodel.wem.WikiParameters params) void
endPropertyBlock
(String propertyUri, boolean doc) void
endPropertyInline
(String inlineProperty) void
endQuotation
(org.wikimodel.wem.WikiParameters params) void
void
endTable
(org.wikimodel.wem.WikiParameters params) void
endTableCell
(boolean tableHead, org.wikimodel.wem.WikiParameters params) void
endTableRow
(org.wikimodel.wem.WikiParameters params) protected void
freemarker.core.Environment
protected String
getSymbolEntity
(String str) Returns an HTML/XML entity corresponding to the specified special symbol.protected boolean
Returnstrue
if special Wiki entities should be represented as the corresponding HTML entities or they should be visualized using the corresponding XHTML codes (like & and so on).void
onEmptyLines
(int count) void
void
onExtensionBlock
(String extensionName, org.wikimodel.wem.WikiParameters params) void
onExtensionInline
(String extensionName, org.wikimodel.wem.WikiParameters params) void
void
void
onMacroBlock
(String macroName, org.wikimodel.wem.WikiParameters params, String content) void
onMacroInline
(String macroName, org.wikimodel.wem.WikiParameters params, String content) void
void
onReference
(String ref, boolean explicitLink) void
void
onSpecialSymbol
(String str) void
onTableCaption
(String str) void
onVerbatimBlock
(String str) void
onVerbatimInline
(String str) void
protected void
protected void
println()
protected void
protected void
Methods inherited from class org.wikimodel.wem.PrintInlineListener
newReferenceHandler
Methods inherited from class org.wikimodel.wem.PrintTextListener
endBlock
-
Field Details
-
LINE_SEP
-
engine
-
words
-
env
protected freemarker.core.Environment env -
writer
-
mark
protected int mark -
toc
-
-
Constructor Details
-
WikiSerializerHandler
-
-
Method Details
-
print
- Overrides:
print
in classorg.wikimodel.wem.PrintTextListener
-
println
protected void println()- Overrides:
println
in classorg.wikimodel.wem.PrintTextListener
-
println
- Overrides:
println
in classorg.wikimodel.wem.PrintTextListener
-
getWriter
-
getEnvironment
public freemarker.core.Environment getEnvironment() -
beginElement
protected void beginElement() -
endElement
protected void endElement() -
flushWords
protected void flushWords() -
beginDefinitionDescription
public void beginDefinitionDescription()- Specified by:
beginDefinitionDescription
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
beginDefinitionDescription
in classorg.wikimodel.wem.PrintListener
-
beginDefinitionList
public void beginDefinitionList(org.wikimodel.wem.WikiParameters parameters) - Specified by:
beginDefinitionList
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
beginDefinitionList
in classorg.wikimodel.wem.PrintListener
-
beginDefinitionTerm
public void beginDefinitionTerm()- Specified by:
beginDefinitionTerm
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
beginDefinitionTerm
in classorg.wikimodel.wem.PrintListener
-
beginDocument
public void beginDocument()- Specified by:
beginDocument
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
beginDocument
in classorg.wikimodel.wem.PrintListener
-
beginFormat
public void beginFormat(org.wikimodel.wem.WikiFormat format) - Specified by:
beginFormat
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
beginFormat
in classorg.wikimodel.wem.PrintInlineListener
-
beginHeader
public void beginHeader(int level, org.wikimodel.wem.WikiParameters params) - Specified by:
beginHeader
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
beginHeader
in classorg.wikimodel.wem.PrintListener
-
beginInfoBlock
public void beginInfoBlock(char infoType, org.wikimodel.wem.WikiParameters params) - Specified by:
beginInfoBlock
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
beginInfoBlock
in classorg.wikimodel.wem.PrintListener
-
beginList
public void beginList(org.wikimodel.wem.WikiParameters parameters, boolean ordered) - Specified by:
beginList
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
beginList
in classorg.wikimodel.wem.PrintListener
-
beginListItem
public void beginListItem()- Specified by:
beginListItem
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
beginListItem
in classorg.wikimodel.wem.PrintListener
-
beginParagraph
public void beginParagraph(org.wikimodel.wem.WikiParameters params) - Specified by:
beginParagraph
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
beginParagraph
in classorg.wikimodel.wem.PrintListener
-
beginPropertyBlock
- Specified by:
beginPropertyBlock
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
beginPropertyBlock
in classorg.wikimodel.wem.PrintListener
-
beginPropertyInline
- Specified by:
beginPropertyInline
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
beginPropertyInline
in classorg.wikimodel.wem.PrintInlineListener
-
beginQuotation
public void beginQuotation(org.wikimodel.wem.WikiParameters params) - Specified by:
beginQuotation
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
beginQuotation
in classorg.wikimodel.wem.PrintListener
-
beginQuotationLine
public void beginQuotationLine()- Specified by:
beginQuotationLine
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
beginQuotationLine
in classorg.wikimodel.wem.PrintListener
-
beginTable
public void beginTable(org.wikimodel.wem.WikiParameters params) - Specified by:
beginTable
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
beginTable
in classorg.wikimodel.wem.PrintListener
-
beginTableCell
public void beginTableCell(boolean tableHead, org.wikimodel.wem.WikiParameters params) - Specified by:
beginTableCell
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
beginTableCell
in classorg.wikimodel.wem.PrintListener
-
beginTableRow
public void beginTableRow(org.wikimodel.wem.WikiParameters params) - Specified by:
beginTableRow
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
beginTableRow
in classorg.wikimodel.wem.PrintListener
-
endDefinitionDescription
public void endDefinitionDescription()- Specified by:
endDefinitionDescription
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
endDefinitionDescription
in classorg.wikimodel.wem.PrintListener
-
endDefinitionList
public void endDefinitionList(org.wikimodel.wem.WikiParameters parameters) - Specified by:
endDefinitionList
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
endDefinitionList
in classorg.wikimodel.wem.PrintListener
-
endDefinitionTerm
public void endDefinitionTerm()- Specified by:
endDefinitionTerm
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
endDefinitionTerm
in classorg.wikimodel.wem.PrintListener
-
endDocument
public void endDocument()- Specified by:
endDocument
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
endDocument
in classorg.wikimodel.wem.PrintListener
-
endFormat
public void endFormat(org.wikimodel.wem.WikiFormat format) - Specified by:
endFormat
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
endFormat
in classorg.wikimodel.wem.PrintInlineListener
-
endHeader
public void endHeader(int level, org.wikimodel.wem.WikiParameters params) - Specified by:
endHeader
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
endHeader
in classorg.wikimodel.wem.PrintListener
-
endInfoBlock
public void endInfoBlock(char infoType, org.wikimodel.wem.WikiParameters params) - Specified by:
endInfoBlock
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
endInfoBlock
in classorg.wikimodel.wem.PrintListener
-
endList
public void endList(org.wikimodel.wem.WikiParameters parameters, boolean ordered) - Specified by:
endList
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
endList
in classorg.wikimodel.wem.PrintListener
-
endListItem
public void endListItem()- Specified by:
endListItem
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
endListItem
in classorg.wikimodel.wem.PrintListener
-
endParagraph
public void endParagraph(org.wikimodel.wem.WikiParameters params) - Specified by:
endParagraph
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
endParagraph
in classorg.wikimodel.wem.PrintListener
-
endPropertyBlock
- Specified by:
endPropertyBlock
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
endPropertyBlock
in classorg.wikimodel.wem.PrintListener
-
endPropertyInline
- Specified by:
endPropertyInline
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
endPropertyInline
in classorg.wikimodel.wem.PrintInlineListener
-
endQuotation
public void endQuotation(org.wikimodel.wem.WikiParameters params) - Specified by:
endQuotation
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
endQuotation
in classorg.wikimodel.wem.PrintListener
-
endQuotationLine
public void endQuotationLine()- Specified by:
endQuotationLine
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
endQuotationLine
in classorg.wikimodel.wem.PrintListener
-
endTable
public void endTable(org.wikimodel.wem.WikiParameters params) - Specified by:
endTable
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
endTable
in classorg.wikimodel.wem.PrintListener
-
endTableCell
public void endTableCell(boolean tableHead, org.wikimodel.wem.WikiParameters params) - Specified by:
endTableCell
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
endTableCell
in classorg.wikimodel.wem.PrintListener
-
endTableRow
public void endTableRow(org.wikimodel.wem.WikiParameters params) - Specified by:
endTableRow
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
endTableRow
in classorg.wikimodel.wem.PrintListener
-
onEmptyLines
public void onEmptyLines(int count) - Specified by:
onEmptyLines
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
onEmptyLines
in classorg.wikimodel.wem.PrintListener
-
onHorizontalLine
public void onHorizontalLine()- Specified by:
onHorizontalLine
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
onHorizontalLine
in classorg.wikimodel.wem.PrintListener
-
onLineBreak
public void onLineBreak()- Specified by:
onLineBreak
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
onLineBreak
in classorg.wikimodel.wem.PrintInlineListener
-
onReference
- Specified by:
onReference
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
onReference
in classorg.wikimodel.wem.PrintTextListener
-
onTableCaption
- Specified by:
onTableCaption
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
onTableCaption
in classorg.wikimodel.wem.PrintListener
-
onVerbatimBlock
- Specified by:
onVerbatimBlock
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
onVerbatimBlock
in classorg.wikimodel.wem.PrintListener
-
onVerbatimInline
- Specified by:
onVerbatimInline
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
onVerbatimInline
in classorg.wikimodel.wem.PrintInlineListener
-
onMacroBlock
- Specified by:
onMacroBlock
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
onMacroBlock
in classorg.wikimodel.wem.PrintListener
-
onMacroInline
public void onMacroInline(String macroName, org.wikimodel.wem.WikiParameters params, String content) - Specified by:
onMacroInline
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
onMacroInline
in classorg.wikimodel.wem.PrintListener
-
onExtensionBlock
- Specified by:
onExtensionBlock
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
onExtensionBlock
in classorg.wikimodel.wem.PrintListener
-
onExtensionInline
- Specified by:
onExtensionInline
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
onExtensionInline
in classorg.wikimodel.wem.PrintInlineListener
-
onSpecialSymbol
- Specified by:
onSpecialSymbol
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
onSpecialSymbol
in classorg.wikimodel.wem.PrintInlineListener
-
onSpace
- Specified by:
onSpace
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
onSpace
in classorg.wikimodel.wem.PrintTextListener
-
onNewLine
public void onNewLine()- Specified by:
onNewLine
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
onNewLine
in classorg.wikimodel.wem.PrintTextListener
-
onEscape
- Specified by:
onEscape
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
onEscape
in classorg.wikimodel.wem.PrintInlineListener
-
onWord
- Specified by:
onWord
in interfaceorg.wikimodel.wem.IWemListener
- Overrides:
onWord
in classorg.wikimodel.wem.PrintTextListener
-
writeWord
-
getSymbolEntity
Returns an HTML/XML entity corresponding to the specified special symbol. Depending on implementation it can be real entities (like & < > or the corresponding digital codes (like &, &#& or ›). Digital entity representation is better for generation of XML files.- Parameters:
str
- the special string to convert to an HTML/XML entity- Returns:
- an HTML/XML entity corresponding to the specified special symbol.
-
isHtmlEntities
protected boolean isHtmlEntities()Returnstrue
if special Wiki entities should be represented as the corresponding HTML entities or they should be visualized using the corresponding XHTML codes (like & and so on). This method can be overloaded in subclasses to re-define the visualization style.- Returns:
true
if special Wiki entities should be represented as the corresponding HTML entities or they should be visualized using the corresponding XHTML codes (like & and so on).
-