Class PrintInlineListener
- java.lang.Object
-
- org.xwiki.rendering.wikimodel.PrintTextListener
-
- org.xwiki.rendering.wikimodel.xhtml.PrintInlineListener
-
- All Implemented Interfaces:
IWemListener,IWemListenerDocument,IWemListenerFigure,IWemListenerInline,IWemListenerList,IWemListenerProgramming,IWemListenerSemantic,IWemListenerSimpleBlocks,IWemListenerTable
- Direct Known Subclasses:
PrintListener
public class PrintInlineListener extends PrintTextListener
- Since:
- 4.0M1
- Version:
- $Id: e09ee63f427e3ca9184e3ce49a6aae3990341b6d $
-
-
Field Summary
-
Fields inherited from class org.xwiki.rendering.wikimodel.PrintTextListener
fRefHandler
-
-
Constructor Summary
Constructors Constructor Description PrintInlineListener(IWikiPrinter printer)PrintInlineListener(IWikiPrinter printer, boolean supportImage, boolean supportDownload)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeginFormat(WikiFormat format)This method is called at the beginning of a sequence of in-line elements having the specified formatting parameters.voidbeginPropertyInline(String str)This method is called to notify about the beginning of a new inline property found in the text of the parsed document.voidendFormat(WikiFormat format)This method is called to notify about the end of a sequence of in-line elements having common formatting parameters.voidendPropertyInline(String inlineProperty)This method is called to notify about the end of an inline property found in the text of the parsed document.protected StringgetSymbolEntity(String str)Returns an HTML/XML entity corresponding to the specified special symbol.protected booleanisHtmlEntities()Returnstrueif 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).protected ReferenceHandlernewReferenceHandler()voidonEscape(String str)Escaped symbols.voidonExtensionInline(String extensionName, WikiParameters params)This method is used to notify about a new extension which CAN generate in-line elements as a result of its interpretation.voidonLineBreak()This method is called to notify about a forced line break found in the text.voidonSpecialSymbol(String str)This method is called to notify about a sequence of special characters.voidonVerbatimInline(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, beginHeader, beginInfoBlock, beginList, beginListItem, beginListItem, beginParagraph, beginPropertyBlock, beginQuotation, beginQuotationLine, beginSection, beginSectionContent, beginTable, beginTableCell, beginTableRow, endBlock, endDefinitionDescription, endDefinitionList, endDefinitionTerm, endDocument, endHeader, endInfoBlock, endList, endListItem, endListItem, endParagraph, endPropertyBlock, endQuotation, endQuotationLine, endSection, endSectionContent, endTable, endTableCell, endTableRow, isSupportDownload, isSupportImage, onEmptyLines, onExtensionBlock, onHorizontalLine, onImage, onImage, onMacroBlock, onMacroInline, onNewLine, onReference, onReference, onSpace, onTableCaption, 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
-
PrintInlineListener
public PrintInlineListener(IWikiPrinter printer)
-
PrintInlineListener
public PrintInlineListener(IWikiPrinter printer, boolean supportImage, boolean supportDownload)
-
-
Method Detail
-
beginFormat
public void beginFormat(WikiFormat format)
Description copied from interface:IWemListenerInlineThis method is called at the beginning of a sequence of in-line elements having the specified formatting parameters.- Specified by:
beginFormatin interfaceIWemListenerInline- Overrides:
beginFormatin classPrintTextListener- Parameters:
format- the object defining formatting parameters of in-line elements.- See Also:
IWemListenerInline.beginFormat(org.xwiki.rendering.wikimodel.WikiFormat)
-
beginPropertyInline
public void beginPropertyInline(String str)
Description copied from interface:IWemListenerSemanticThis method is called to notify about the beginning of a new inline property found in the text of the parsed document.- Specified by:
beginPropertyInlinein interfaceIWemListenerSemantic- Overrides:
beginPropertyInlinein classPrintTextListener- Parameters:
str- the URI of the semantic inline property found in the document- See Also:
IWemListenerSemantic.beginPropertyInline(java.lang.String)
-
endFormat
public void endFormat(WikiFormat format)
Description copied from interface:IWemListenerInlineThis method is called to notify about the end of a sequence of in-line elements having common formatting parameters.- Specified by:
endFormatin interfaceIWemListenerInline- Overrides:
endFormatin classPrintTextListener- Parameters:
format- the formatting object defining how contained in-line elements should be formatted- See Also:
IWemListenerInline.endFormat(org.xwiki.rendering.wikimodel.WikiFormat)
-
endPropertyInline
public void endPropertyInline(String inlineProperty)
Description copied from interface:IWemListenerSemanticThis method is called to notify about the end of an inline property found in the text of the parsed document.- Specified by:
endPropertyInlinein interfaceIWemListenerSemantic- Overrides:
endPropertyInlinein classPrintTextListener- Parameters:
inlineProperty- the URI of the semantic inline property found in the document- See Also:
IWemListenerSemantic.endPropertyInline(java.lang.String)
-
getSymbolEntity
protected String getSymbolEntity(String str)
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()
Returnstrueif 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:
trueif 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).
-
newReferenceHandler
protected ReferenceHandler newReferenceHandler()
- Overrides:
newReferenceHandlerin classPrintTextListener
-
onEscape
public void onEscape(String str)
Description copied from interface:IWemListenerInlineEscaped symbols. More frequently the given string has just one symbol.- Specified by:
onEscapein interfaceIWemListenerInline- Overrides:
onEscapein classPrintTextListener- Parameters:
str- the escaped sequence of characters- See Also:
IWemListenerInline.onEscape(java.lang.String)
-
onExtensionInline
public void onExtensionInline(String extensionName, WikiParameters params)
Description copied from interface:IWemListenerProgrammingThis method is used to notify about a new extension which CAN generate in-line elements as a result of its interpretation. This method CAN NOT generate block elements.- Specified by:
onExtensionInlinein interfaceIWemListenerProgramming- Overrides:
onExtensionInlinein classPrintTextListener- Parameters:
extensionName- the name of the extensionparams- parameters for the extension
-
onLineBreak
public void onLineBreak()
Description copied from interface:IWemListenerInlineThis 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:
onLineBreakin interfaceIWemListenerInline- Overrides:
onLineBreakin classPrintTextListener- See Also:
IWemListenerInline.onLineBreak()
-
onSpecialSymbol
public void onSpecialSymbol(String str)
Description copied from interface:IWemListenerInlineThis 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:
onSpecialSymbolin interfaceIWemListenerInline- Overrides:
onSpecialSymbolin classPrintTextListener- Parameters:
str- the sequence of special symbols- See Also:
IWemListenerInline.onSpecialSymbol(java.lang.String)
-
onVerbatimInline
public void onVerbatimInline(String str, WikiParameters params)
Description copied from interface:IWemListenerInlineThis 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:
onVerbatimInlinein interfaceIWemListenerInline- Overrides:
onVerbatimInlinein classPrintTextListener- Parameters:
str- the sequence of non-interpreted charactersparams- the list of parameters for this event- See Also:
IWemListenerInline.onVerbatimInline(java.lang.String, WikiParameters)
-
-