public class TexSerializer extends PrintTextListener
fRefHandler| Constructor and Description |
|---|
TexSerializer(IWikiPrinter printer,
String documentName,
String wikiFileDownloadBaseUrl,
String imageTargetFolderPath) |
| Modifier and Type | Method and Description |
|---|---|
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 |
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 (see
IWemListenerList.beginList(WikiParameters, boolean)/
IWemListenerList.endList(WikiParameters, boolean) methods). |
void |
beginParagraph(WikiParameters params)
Begin of a simple paragraph.
|
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 |
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 |
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
(see
IWemListenerList.beginList(WikiParameters, boolean)/
IWemListenerList.endList(WikiParameters, boolean) methods). |
void |
endParagraph(WikiParameters params)
End of a simple paragraph.
|
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.
|
protected InputStream |
getImageInput(String ref)
Returns an input stream with an image corresponding to the specified
reference.
|
protected int[] |
getImageSize(String ref)
Returns a two-value array with the size of the image defined by the given
url
|
protected int |
getMaxImageHeight()
Returns maximal possible image height.
|
protected int |
getMaxImageWidth()
Returns maximal possible image width.
|
protected ReferenceHandler |
newReferenceHandler() |
void |
onEscape(String str)
Escaped symbols.
|
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 |
onSpace(String str)
This method is called to notify about a sequence of space symbols (like
" " or "\t" symbols).
|
void |
onSpecialSymbol(String str)
This method is called to notify about a sequence of special characters.
|
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".
|
void |
onWord(String str)
This method is called to notify about a "word" found in the document.
|
static String |
processString(String g,
boolean flag) |
String |
texClean(String str) |
beginDefinitionDescription, beginDefinitionList, beginDefinitionTerm, beginFormat, beginInfoBlock, beginPropertyBlock, beginPropertyInline, beginQuotation, beginQuotationLine, beginSection, beginSectionContent, endBlock, endDefinitionDescription, endDefinitionList, endDefinitionTerm, endFormat, endInfoBlock, endPropertyBlock, endPropertyInline, endQuotation, endSection, endSectionContent, isSupportDownload, isSupportImage, onEmptyLines, onExtensionBlock, onExtensionInline, onHorizontalLine, onImage, onImage, onMacroBlock, onMacroInline, onReference, onReference, onTableCaption, print, println, printlnpublic TexSerializer(IWikiPrinter printer, String documentName, String wikiFileDownloadBaseUrl, String imageTargetFolderPath)
printer - public void beginDocument(WikiParameters params)
IWemListenerDocumentbeginDocument in interface IWemListenerDocumentbeginDocument in class PrintTextListenerIWemListenerDocument.beginDocument(WikiParameters)public void beginHeader(int headerLevel,
WikiParameters params)
IWemListenerDocumentbeginHeader in interface IWemListenerDocumentbeginHeader in class PrintTextListenerheaderLevel - the level of the found header; valid values: 1-6params - wiki parameters associated with theIWemListenerDocument.beginHeader(int, WikiParameters)public void beginList(WikiParameters parameters, boolean ordered)
IWemListenerListIWemListenerList.beginListItem()/IWemListenerList.endListItem() method pair. Items of
lists of this type can contain the following sequence of elements:
beginList in interface IWemListenerListbeginList in class PrintTextListenerparameters - 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 beginListItem()
IWemListenerListIWemListenerList.beginList(WikiParameters, boolean)/
IWemListenerList.endList(WikiParameters, boolean) methods).beginListItem in interface IWemListenerListbeginListItem in class PrintTextListenerIWemListenerList.beginListItem()public void beginParagraph(WikiParameters params)
IWemListenerSimpleBlocksbeginParagraph in interface IWemListenerSimpleBlocksbeginParagraph in class PrintTextListenerparams - paragraph parametersIWemListenerSimpleBlocks.beginParagraph(WikiParameters)public void beginTable(WikiParameters params)
IWemListenerTablebeginTable in interface IWemListenerTablebeginTable in class PrintTextListenerparams - table parametersIWemListenerTable.beginTable(WikiParameters)public void beginTableCell(boolean tableHead,
WikiParameters params)
IWemListenerTablebeginTableCell in interface IWemListenerTablebeginTableCell in class PrintTextListenertableHead - 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 beginTableRow(WikiParameters params)
IWemListenerTablebeginTableRow in interface IWemListenerTablebeginTableRow in class PrintTextListenerparams - parameters of the row.IWemListenerTable.beginTableRow(WikiParameters)public void endDocument(WikiParameters params)
IWemListenerDocumentendDocument in interface IWemListenerDocumentendDocument in class PrintTextListenerIWemListenerDocument.endDocument(WikiParameters)public void endHeader(int headerLevel,
WikiParameters params)
IWemListenerDocumentendHeader in interface IWemListenerDocumentendHeader in class PrintTextListenerheaderLevel - the level of the headerparams - wiki parameters of the headerIWemListenerDocument.endHeader(int, WikiParameters)public void endList(WikiParameters parameters, boolean ordered)
IWemListenerListendList in interface IWemListenerListendList in class PrintTextListenerparameters - 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 endListItem()
IWemListenerListIWemListenerList.beginList(WikiParameters, boolean)/
IWemListenerList.endList(WikiParameters, boolean) methods).endListItem in interface IWemListenerListendListItem in class PrintTextListenerIWemListenerList.endListItem()public void endParagraph(WikiParameters params)
IWemListenerSimpleBlocksendParagraph in interface IWemListenerSimpleBlocksendParagraph in class PrintTextListenerparams - paragraph parametersIWemListenerSimpleBlocks.endParagraph(WikiParameters)public void endQuotationLine()
IWemListenerListendQuotationLine in interface IWemListenerListendQuotationLine in class PrintTextListenerIWemListenerList.endQuotationLine()public void endTable(WikiParameters params)
IWemListenerTableendTable in interface IWemListenerTableendTable in class PrintTextListenerparams - table parametersIWemListenerTable.endTable(WikiParameters)public void endTableCell(boolean tableHead,
WikiParameters params)
IWemListenerTableendTableCell in interface IWemListenerTableendTableCell in class PrintTextListenertableHead - 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 endTableRow(WikiParameters params)
IWemListenerTableendTableRow in interface IWemListenerTableendTableRow in class PrintTextListenerparams - parameters of the row.IWemListenerTable.endTableRow(WikiParameters)protected InputStream getImageInput(String ref) throws IOException
ref - the image referenceIOExceptionprotected int[] getImageSize(String ref)
ref - the reference to the imageprotected int getMaxImageHeight()
protected int getMaxImageWidth()
protected ReferenceHandler newReferenceHandler()
newReferenceHandler in class PrintTextListenerpublic void onEscape(String str)
IWemListenerInlineonEscape in interface IWemListenerInlineonEscape in class PrintTextListenerstr - the escaped sequence of charactersIWemListenerInline.onEscape(java.lang.String)public void onLineBreak()
IWemListenerInlineIWemListenerInline.onNewLine()
notification.onLineBreak in interface IWemListenerInlineonLineBreak in class PrintTextListenerIWemListenerInline.onLineBreak()public void onNewLine()
IWemListenerInlineIWemListenerInline.onLineBreak() event.onNewLine in interface IWemListenerInlineonNewLine in class PrintTextListenerIWemListenerInline.onNewLine()public void onSpace(String str)
IWemListenerInlineonSpace in interface IWemListenerInlineonSpace in class PrintTextListenerstr - the sequence of space charactersIWemListenerInline.onSpace(java.lang.String)public void onSpecialSymbol(String str)
IWemListenerInline
The full list of possible special symbols:
"!", "\"", "#", "$", "%", "&", "'", "(",
")", "*", "+", ",", "-", ".", "/", ":",
";", "<", "=", ">", "?", "@", "[", "\\",
"]", "^", "_", "`", "{", "|", "}", "~"
onSpecialSymbol in interface IWemListenerInlineonSpecialSymbol in class PrintTextListenerstr - the sequence of special symbolsIWemListenerInline.onSpecialSymbol(java.lang.String)public void onWord(String str)
IWemListenerInline
Words are formed by the all characters excluding the following ones:
"\t", "\n", "\r", " ",
"!", "\"", "#", "$", "%", "&", "'", "(",
")", "*", "+", ",", "-", ".", "/", ":",
";", "<", "=", ">", "?", "@", "[", "\\",
"]", "^", "_", "`", "{", "|", "}", "~"
onWord in interface IWemListenerInlineonWord in class PrintTextListenerstr - the sequence of characters forming a wordIWemListenerInline.onWord(java.lang.String)public void onVerbatimInline(String str, WikiParameters params)
IWemListenerInlineonVerbatimInline in interface IWemListenerInlineonVerbatimInline in class PrintTextListenerstr - the sequence of non-interpreted charactersparams - TODOIWemListenerInline.onVerbatimInline(java.lang.String,
WikiParameters)public void onVerbatimBlock(String str, WikiParameters params)
IWemListenerSimpleBlocksonVerbatimBlock in interface IWemListenerSimpleBlocksonVerbatimBlock in class PrintTextListenerstr - the content of the verbatim (pre-formatted) blockparams - parameters of the verbatim blockIWemListenerSimpleBlocks.onVerbatimBlock(String,
WikiParameters)Copyright © 2004–2015 XWiki. All rights reserved.