org.xwiki.rendering.wikimodel.xhtml
Class PrintInlineListener

java.lang.Object
  extended by org.xwiki.rendering.wikimodel.PrintTextListener
      extended by org.xwiki.rendering.wikimodel.xhtml.PrintInlineListener
All Implemented Interfaces:
IWemListener, IWemListenerDocument, IWemListenerInline, IWemListenerList, IWemListenerProgramming, IWemListenerSemantic, IWemListenerSimpleBlocks, IWemListenerTable
Direct Known Subclasses:
PrintListener

public class PrintInlineListener
extends PrintTextListener

Since:
4.0M1

Field Summary
 
Fields inherited from class org.xwiki.rendering.wikimodel.PrintTextListener
fRefHandler
 
Constructor Summary
PrintInlineListener(IWikiPrinter printer)
           
PrintInlineListener(IWikiPrinter printer, boolean supportImage, boolean supportDownload)
           
 
Method Summary
 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()
          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).
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, beginParagraph, beginPropertyBlock, beginQuotation, beginQuotationLine, beginSection, beginSectionContent, beginTable, beginTableCell, beginTableRow, endBlock, endDefinitionDescription, endDefinitionList, endDefinitionTerm, endDocument, endHeader, endInfoBlock, endList, 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
 

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 interface IWemListenerInline
Overrides:
beginFormat in class PrintTextListener
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 interface IWemListenerSemantic
Overrides:
beginPropertyInline in class PrintTextListener
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 interface IWemListenerInline
Overrides:
endFormat in class PrintTextListener
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 interface IWemListenerSemantic
Overrides:
endPropertyInline in class PrintTextListener
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()
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). 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 class PrintTextListener

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 interface IWemListenerInline
Overrides:
onEscape in class PrintTextListener
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 interface IWemListenerProgramming
Overrides:
onExtensionInline in class PrintTextListener
Parameters:
extensionName - the name of the extension
params - 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 the IWemListenerInline.onNewLine() notification.

Specified by:
onLineBreak in interface IWemListenerInline
Overrides:
onLineBreak in class PrintTextListener
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 interface IWemListenerInline
Overrides:
onSpecialSymbol in class PrintTextListener
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 interface IWemListenerInline
Overrides:
onVerbatimInline in class PrintTextListener
Parameters:
str - the sequence of non-interpreted characters
params - TODO
See Also:
IWemListenerInline.onVerbatimInline(java.lang.String, WikiParameters)