Class 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  
      • Fields inherited from interface org.xwiki.rendering.listener.Listener

        EMPTY_PARAMETERS
    • 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 interface org.xwiki.rendering.listener.ImageListener

        onImage, onImage
      • Methods inherited from interface org.xwiki.rendering.listener.LinkListener

        beginLink, endLink
      • 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
      • Methods inherited from interface org.xwiki.rendering.renderer.PrintRenderer

        getPrinter, setPrinter
    • 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.
      • annotationsGenerator

        protected org.xwiki.annotation.internal.renderer.AnnotationGeneratorChainingListener annotationsGenerator
        The annotations generator listener to use in this renderer.
    • Constructor Detail

      • AbstractAnnotationRenderer

        public AbstractAnnotationRenderer()
    • Method Detail

      • initialize

        public void initialize()
                        throws org.xwiki.component.phase.InitializationException
        Specified by:
        initialize in interface org.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