public class XWikiSerializer2 extends PrintTextListener
XWikiSerializer
fRefHandler
Constructor and Description |
---|
XWikiSerializer2(IWikiPrinter printer) |
Modifier and Type | Method and Description |
---|---|
void |
beginDefinitionDescription()
This method is used to notify about a definition description.
|
void |
beginDefinitionTerm()
A definition term.
|
void |
beginFormat(WikiFormat format)
This method is called at the beginning of a sequence of in-line elements having the specified formatting
parameters.
|
void |
beginHeader(int headerLevel,
WikiParameters params)
This method is called to notify about a new section header found in the document.
|
void |
beginList(WikiParameters params,
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 (see
IWemListenerList.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 (see
IWemListenerList.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.
|
static String |
clearName(String name)
Clears the name of files; used while uploading attachments within XWiki
RECOMMENDED FOR NAMES OF UPLOADED FILES.
|
static String |
clearName(String name,
boolean stripDots,
boolean ascii) |
protected void |
endBlock()
This method is called at the end of each block element.
|
void |
endDefinitionDescription()
This method is used to notify about the end of a definition description.
|
void |
endDefinitionTerm()
The end of a definition term.
|
void |
endFormat(WikiFormat format)
This method is called to notify about the end of a sequence of in-line elements having common formatting
parameters.
|
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
(see
IWemListenerList.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
(see
IWemListenerList.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 |
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.
|
protected String |
getEol() |
protected String |
getImageThumbwidth() |
Logger |
getLogger() |
protected ReferenceHandler |
newReferenceHandler() |
void |
onImage(String ref)
This method is called to notify that an free standing image was found in the parsed wiki document.
|
void |
onImage(WikiReference ref)
This method is called to notify that a structured reference was found in the text
|
protected void |
onImageThumbnail(WikiReference ref)
Special case when detected, that there are image thumbnail.
|
void |
onLineBreak()
This method is called to notify about a forced line break found in the text.
|
void |
onNewLine()
This method is called to notify that the parsed block contains a new line sequence (
"\r\n" or "\r" or "\n" character sequence). |
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 |
onVerbatimBlock(String str,
WikiParameters params)
This method notifies about a verbatim (pre-formatted) block defined in
the text
|
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".
|
protected void |
print(String str) |
protected void |
println() |
protected void |
println(String str) |
void |
setLogger(Logger logger) |
beginDefinitionList, beginDocument, beginInfoBlock, beginParagraph, beginPropertyBlock, beginPropertyInline, beginQuotation, beginQuotationLine, beginSection, beginSectionContent, endDefinitionList, endDocument, endInfoBlock, endPropertyBlock, endPropertyInline, endQuotation, endQuotationLine, endSection, endSectionContent, isSupportDownload, isSupportImage, onEmptyLines, onEscape, onExtensionBlock, onExtensionInline, onHorizontalLine, onMacroBlock, onMacroInline, onReference, onReference, onSpace, onWord
public XWikiSerializer2(IWikiPrinter printer)
public void beginHeader(int headerLevel, WikiParameters params)
IWemListenerDocument
beginHeader
in interface IWemListenerDocument
beginHeader
in class PrintTextListener
headerLevel
- the level of the found header; valid values: 1-6params
- the list of parameters for this eventIWemListenerDocument.beginHeader(int, WikiParameters)
public void endHeader(int headerLevel, WikiParameters params)
IWemListenerDocument
endHeader
in interface IWemListenerDocument
endHeader
in class PrintTextListener
headerLevel
- the level of the headerparams
- the list of parameters for this eventIWemListenerDocument.endHeader(int, WikiParameters)
public void beginList(WikiParameters params, boolean ordered)
IWemListenerList
IWemListenerList.beginListItem()
/IWemListenerList.endListItem()
method pair. Items of
lists of this type can contain the following sequence of elements:
beginList
in interface IWemListenerList
beginList
in class PrintTextListener
params
- parameters of the listordered
- if this flag is true
then this method
corresponds to a new ordered list ("ol"); otherwise this method
notifies a beginning of an unordered list ("ul")IWemListenerList.beginList(WikiParameters,
boolean)
public void endList(WikiParameters params, boolean ordered)
IWemListenerList
endList
in interface IWemListenerList
endList
in class PrintTextListener
params
- parameters of the listordered
- if this flag is true
then this method
corresponds to a new ordered list ("ol"); otherwise this method
notifies a beginning of an unordered list ("ul")IWemListenerList.endList(WikiParameters,
boolean)
public void beginListItem()
IWemListenerList
IWemListenerList.beginList(WikiParameters, boolean)
/
IWemListenerList.endList(WikiParameters, boolean)
methods).beginListItem
in interface IWemListenerList
beginListItem
in class PrintTextListener
IWemListenerList.beginListItem()
public void beginListItem(WikiParameters params)
IWemListenerList
IWemListenerList.beginList(WikiParameters, boolean)
/
IWemListenerList.endList(WikiParameters, boolean)
methods).beginListItem
in interface IWemListenerList
beginListItem
in class PrintTextListener
IWemListenerList.endListItem(WikiParameters)
public void endListItem()
IWemListenerList
IWemListenerList.beginList(WikiParameters, boolean)
/
IWemListenerList.endList(WikiParameters, boolean)
methods).endListItem
in interface IWemListenerList
endListItem
in class PrintTextListener
IWemListenerList.endListItem()
public void endListItem(WikiParameters params)
IWemListenerList
IWemListenerList.beginList(WikiParameters, boolean)
/
IWemListenerList.endList(WikiParameters, boolean)
methods).endListItem
in interface IWemListenerList
endListItem
in class PrintTextListener
IWemListenerList.beginListItem(WikiParameters)
public void onImage(String ref)
IWemListenerInline
onImage
in interface IWemListenerInline
onImage
in class PrintTextListener
ref
- the reference the referencepublic void onImage(WikiReference ref)
IWemListenerInline
onImage
in interface IWemListenerInline
onImage
in class PrintTextListener
ref
- the reference the referenceprotected void onImageThumbnail(WikiReference ref)
public void onVerbatimBlock(String str, WikiParameters params)
IWemListenerSimpleBlocks
onVerbatimBlock
in interface IWemListenerSimpleBlocks
onVerbatimBlock
in class PrintTextListener
str
- the content of the verbatim (pre-formatted) blockparams
- parameters of the verbatim blockIWemListenerSimpleBlocks.onVerbatimBlock(String,
WikiParameters)
public void onVerbatimInline(String str, WikiParameters params)
IWemListenerInline
onVerbatimInline
in interface IWemListenerInline
onVerbatimInline
in class PrintTextListener
str
- the sequence of non-interpreted charactersparams
- the list of parameters for this eventIWemListenerInline.onVerbatimInline(java.lang.String,
WikiParameters)
public void onTableCaption(String str)
IWemListenerTable
onTableCaption
in interface IWemListenerTable
onTableCaption
in class PrintTextListener
str
- the content of the table captionIWemListenerTable.onTableCaption(java.lang.String)
public void beginTable(WikiParameters params)
IWemListenerTable
beginTable
in interface IWemListenerTable
beginTable
in class PrintTextListener
params
- table parametersIWemListenerTable.beginTable(WikiParameters)
public void endTable(WikiParameters params)
IWemListenerTable
endTable
in interface IWemListenerTable
endTable
in class PrintTextListener
params
- table parametersIWemListenerTable.endTable(WikiParameters)
public void beginTableCell(boolean tableHead, WikiParameters params)
IWemListenerTable
beginTableCell
in interface IWemListenerTable
beginTableCell
in class PrintTextListener
tableHead
- if this flag is true
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 cellIWemListenerTable.beginTableCell(boolean,
WikiParameters)
public void endTableCell(boolean tableHead, WikiParameters params)
IWemListenerTable
endTableCell
in interface IWemListenerTable
endTableCell
in class PrintTextListener
tableHead
- if this flag is true
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 cellIWemListenerTable.endTableCell(boolean, WikiParameters)
public void beginTableRow(WikiParameters params)
IWemListenerTable
beginTableRow
in interface IWemListenerTable
beginTableRow
in class PrintTextListener
params
- parameters of the row.IWemListenerTable.beginTableRow(WikiParameters)
public void endTableRow(WikiParameters params)
IWemListenerTable
endTableRow
in interface IWemListenerTable
endTableRow
in class PrintTextListener
params
- parameters of the row.IWemListenerTable.endTableRow(WikiParameters)
public void beginFormat(WikiFormat format)
IWemListenerInline
beginFormat
in interface IWemListenerInline
beginFormat
in class PrintTextListener
format
- the object defining formatting parameters of in-line elements.IWemListenerInline.beginFormat(WikiFormat)
public void endFormat(WikiFormat format)
IWemListenerInline
endFormat
in interface IWemListenerInline
endFormat
in class PrintTextListener
format
- the formatting object defining how contained in-line elements should be formattedIWemListenerInline.endFormat(WikiFormat)
public void endParagraph(WikiParameters params)
IWemListenerSimpleBlocks
endParagraph
in interface IWemListenerSimpleBlocks
endParagraph
in class PrintTextListener
params
- paragraph parametersIWemListenerSimpleBlocks.endParagraph(WikiParameters)
protected void endBlock()
PrintTextListener
endBlock
in class PrintTextListener
protected String getEol()
public void onLineBreak()
IWemListenerInline
IWemListenerInline.onNewLine()
notification.onLineBreak
in interface IWemListenerInline
onLineBreak
in class PrintTextListener
IWemListenerInline.onLineBreak()
public void onNewLine()
IWemListenerInline
"\r\n"
or "\r"
or "\n"
character sequence). Note that the new line symbols are not the same as a forced line break
sequence notified by the IWemListenerInline.onLineBreak()
event.onNewLine
in interface IWemListenerInline
onNewLine
in class PrintTextListener
IWemListenerInline.onNewLine()
public void onSpecialSymbol(String str)
IWemListenerInline
The full list of possible special symbols:
"!", "\"", "#", "$", "%", "&", "'", "(",
")", "*", "+", ",", "-", ".", "/", ":",
";", "<", "=", ">", "?", "@", "[", "\\",
"]", "^", "_", "`", "{", "|", "}", "~"
onSpecialSymbol
in interface IWemListenerInline
onSpecialSymbol
in class PrintTextListener
str
- the sequence of special symbolsIWemListenerInline.onSpecialSymbol(java.lang.String)
public void beginDefinitionTerm()
IWemListenerList
beginDefinitionTerm
in interface IWemListenerList
beginDefinitionTerm
in class PrintTextListener
IWemListenerList.beginDefinitionTerm()
public void endDefinitionTerm()
IWemListenerList
endDefinitionTerm
in interface IWemListenerList
endDefinitionTerm
in class PrintTextListener
IWemListenerList.endDefinitionTerm()
public void beginDefinitionDescription()
IWemListenerList
beginDefinitionDescription
in interface IWemListenerList
beginDefinitionDescription
in class PrintTextListener
IWemListenerList.beginDefinitionDescription()
public void endDefinitionDescription()
IWemListenerList
endDefinitionDescription
in interface IWemListenerList
endDefinitionDescription
in class PrintTextListener
IWemListenerList.endDefinitionDescription()
protected String getImageThumbwidth()
protected void print(String str)
print
in class PrintTextListener
protected void println()
println
in class PrintTextListener
protected void println(String str)
println
in class PrintTextListener
protected ReferenceHandler newReferenceHandler()
newReferenceHandler
in class PrintTextListener
public Logger getLogger()
public void setLogger(Logger logger)
logger
- the logger to setpublic static final String clearName(String name, boolean stripDots, boolean ascii)
clearName(String)
Copyright © 2004–2021 XWiki. All rights reserved.