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 void
beginFormat(WikiFormat format)
This method is called at the beginning of a sequence of in-line elements having the specified formatting parameters.void
beginPropertyInline(String str)
This method is called to notify about the beginning of a new inline property found in the text of the parsed document.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
endPropertyInline(String inlineProperty)
This method is called to notify about the end of an inline property found in the text of the parsed document.protected String
getSymbolEntity(String str)
Returns an HTML/XML entity corresponding to the specified special symbol.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).protected ReferenceHandler
newReferenceHandler()
void
onEscape(String str)
Escaped symbols.void
onExtensionInline(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.void
onLineBreak()
This method is called to notify about a forced line break found in the text.void
onSpecialSymbol(String str)
This method is called to notify about a sequence of special characters.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, 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:IWemListenerInline
This method is called at the beginning of a sequence of in-line elements having the specified formatting parameters.- Specified by:
beginFormat
in interfaceIWemListenerInline
- Overrides:
beginFormat
in 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:IWemListenerSemantic
This method is called to notify about the beginning of a new inline property found in the text of the parsed document.- Specified by:
beginPropertyInline
in interfaceIWemListenerSemantic
- Overrides:
beginPropertyInline
in 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:IWemListenerInline
This method is called to notify about the end of a sequence of in-line elements having common formatting parameters.- Specified by:
endFormat
in interfaceIWemListenerInline
- Overrides:
endFormat
in 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:IWemListenerSemantic
This method is called to notify about the end of an inline property found in the text of the parsed document.- Specified by:
endPropertyInline
in interfaceIWemListenerSemantic
- Overrides:
endPropertyInline
in 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()
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).
-
newReferenceHandler
protected ReferenceHandler newReferenceHandler()
- Overrides:
newReferenceHandler
in classPrintTextListener
-
onEscape
public void onEscape(String str)
Description copied from interface:IWemListenerInline
Escaped symbols. More frequently the given string has just one symbol.- Specified by:
onEscape
in interfaceIWemListenerInline
- Overrides:
onEscape
in 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:IWemListenerProgramming
This 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:
onExtensionInline
in interfaceIWemListenerProgramming
- Overrides:
onExtensionInline
in classPrintTextListener
- Parameters:
extensionName
- the name of the extensionparams
- parameters for the extension
-
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()
-
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)
-
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)
-
-