Package org.xwiki.annotation.renderer
Class AbstractAnnotationRenderer
- java.lang.Object
-
- org.xwiki.rendering.listener.chaining.AbstractChainingListener
-
- org.xwiki.rendering.renderer.AbstractChainingPrintRenderer
-
- org.xwiki.annotation.renderer.AbstractAnnotationRenderer
-
- All Implemented Interfaces:
AnnotationPrintRenderer
,org.xwiki.component.phase.Initializable
,org.xwiki.rendering.listener.chaining.ChainingListener
,org.xwiki.rendering.listener.ImageListener
,org.xwiki.rendering.listener.LinkListener
,org.xwiki.rendering.listener.Listener
,org.xwiki.rendering.renderer.PrintRenderer
,org.xwiki.rendering.renderer.Renderer
public abstract class AbstractAnnotationRenderer extends org.xwiki.rendering.renderer.AbstractChainingPrintRenderer implements org.xwiki.component.phase.Initializable, AnnotationPrintRenderer
Abstract class for annotation renderer, any specific syntax renderer should implement this class and provide the specific annotation listener.- Since:
- 2.3M1
- Version:
- $Id: f4cd22c4f8230e111819e53e6042ebed326f979f $
-
-
Field Summary
Fields Modifier and Type Field Description protected org.xwiki.annotation.internal.renderer.AnnotationGeneratorChainingListener
annotationsGenerator
The annotations generator listener to use in this renderer.protected org.xwiki.rendering.parser.StreamParser
plainTextParser
Plain text parser used to parse generated link labels.protected ContentAlterer
selectionAlterer
Selection cleaner so that the selection can be mapped on the content.protected TextExtractor
textExtractor
-
Constructor Summary
Constructors Constructor Description AbstractAnnotationRenderer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract ChainingPrintRenderer
getAnnotationPrintRenderer(org.xwiki.rendering.listener.chaining.ListenerChain chain)
abstract org.xwiki.rendering.renderer.reference.link.LinkLabelGenerator
getLinkLabelGenerator()
Getter for the link label generator to be used for generating link labels in this mapping and rendering process for links that don't have labels.void
initialize()
void
setAnnotations(Collection<Annotation> annotations)
Sets the annotations to render on the content.-
Methods inherited from class org.xwiki.rendering.renderer.AbstractChainingPrintRenderer
getMainPrinter, getPrinter, popPrinter, pushPrinter, setPrinter
-
Methods inherited from class org.xwiki.rendering.listener.chaining.AbstractChainingListener
beginDefinitionDescription, beginDefinitionList, beginDefinitionTerm, beginDocument, beginFigure, beginFigureCaption, beginFormat, beginGroup, beginHeader, beginLink, beginList, beginListItem, beginListItem, beginMacroMarker, beginMetaData, beginParagraph, beginQuotation, beginQuotationLine, beginSection, beginTable, beginTableCell, beginTableHeadCell, beginTableRow, endDefinitionDescription, endDefinitionList, endDefinitionTerm, endDocument, endFigure, endFigureCaption, endFormat, endGroup, endHeader, endLink, endList, endListItem, endListItem, endMacroMarker, endMetaData, endParagraph, endQuotation, endQuotationLine, endSection, endTable, endTableCell, endTableHeadCell, endTableRow, getListenerChain, onEmptyLines, onHorizontalLine, onId, onImage, onImage, onMacro, onNewLine, onRawText, onSpace, onSpecialSymbol, onVerbatim, onWord, setListenerChain
-
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.listener.Listener
beginDefinitionDescription, beginDefinitionList, beginDefinitionTerm, beginDocument, beginFigure, beginFigureCaption, beginFormat, beginGroup, beginHeader, beginList, beginListItem, beginListItem, beginMacroMarker, beginMetaData, beginParagraph, beginQuotation, beginQuotationLine, beginSection, beginTable, beginTableCell, beginTableHeadCell, beginTableRow, endDefinitionDescription, endDefinitionList, endDefinitionTerm, endDocument, endFigure, endFigureCaption, endFormat, endGroup, endHeader, endList, endListItem, endListItem, endMacroMarker, endMetaData, endParagraph, endQuotation, endQuotationLine, endSection, endTable, endTableCell, endTableHeadCell, endTableRow, onEmptyLines, onHorizontalLine, onId, onMacro, onNewLine, onRawText, onSpace, onSpecialSymbol, onVerbatim, onWord
-
-
-
-
Field Detail
-
selectionAlterer
@Inject @Named("whitespace") protected ContentAlterer selectionAlterer
Selection cleaner so that the selection can be mapped on the content.
TODO: not really sure if this is the right place for this pull, but the annotations generator is not a component so it cannot 'require' it.
-
plainTextParser
@Inject @Named("plain/1.0") protected org.xwiki.rendering.parser.StreamParser plainTextParser
Plain text parser used to parse generated link labels.
-
textExtractor
@Inject protected TextExtractor textExtractor
-
annotationsGenerator
protected org.xwiki.annotation.internal.renderer.AnnotationGeneratorChainingListener annotationsGenerator
The annotations generator listener to use in this renderer.
-
-
Method Detail
-
initialize
public void initialize() throws org.xwiki.component.phase.InitializationException
- Specified by:
initialize
in interfaceorg.xwiki.component.phase.Initializable
- Throws:
org.xwiki.component.phase.InitializationException
-
getAnnotationPrintRenderer
public abstract ChainingPrintRenderer getAnnotationPrintRenderer(org.xwiki.rendering.listener.chaining.ListenerChain chain)
- Parameters:
chain
- the chain in which the renderer needs to be added.- Returns:
- the print renderer which should render the result with annotations on it
-
getLinkLabelGenerator
public abstract org.xwiki.rendering.renderer.reference.link.LinkLabelGenerator getLinkLabelGenerator()
Getter for the link label generator to be used for generating link labels in this mapping and rendering process for links that don't have labels.- Returns:
- the
LinkLabelGenerator
used to generate labels for links without labels by this renderer
-
setAnnotations
public void setAnnotations(Collection<Annotation> annotations)
Description copied from interface:AnnotationPrintRenderer
Sets the annotations to render on the content.- Specified by:
setAnnotations
in interfaceAnnotationPrintRenderer
- Parameters:
annotations
- the collection of annotations to render
-
-