Class AbstractRenderer

    • Field Detail

      • name

        protected java.lang.String name
      • description

        protected java.lang.String description
      • showSuppressedViolations

        protected boolean showSuppressedViolations
      • writer

        protected java.io.Writer writer
      • inputPathPrefixes

        protected java.util.List<java.lang.String> inputPathPrefixes
    • Constructor Detail

      • AbstractRenderer

        public AbstractRenderer​(java.lang.String name,
                                java.lang.String description)
    • Method Detail

      • getName

        public java.lang.String getName()
        Description copied from interface: Renderer
        Get the name of the Renderer.
        Specified by:
        getName in interface PropertySource
        Specified by:
        getName in interface Renderer
        Returns:
        The name of the Renderer.
      • setName

        public void setName​(java.lang.String name)
        Description copied from interface: Renderer
        Set the name of the Renderer.
        Specified by:
        setName in interface Renderer
        Parameters:
        name - The name of the Renderer.
      • getDescription

        public java.lang.String getDescription()
        Description copied from interface: Renderer
        Get the description of the Renderer.
        Specified by:
        getDescription in interface Renderer
        Returns:
        The description of the Renderer.
      • setDescription

        public void setDescription​(java.lang.String description)
        Description copied from interface: Renderer
        Set the description of the Renderer.
        Specified by:
        setDescription in interface Renderer
        Parameters:
        description - The description of the Renderer.
      • isShowSuppressedViolations

        public boolean isShowSuppressedViolations()
        Description copied from interface: Renderer
        Get the indicator for whether to show suppressed violations.
        Specified by:
        isShowSuppressedViolations in interface Renderer
        Returns:
        true if suppressed violations should show, false otherwise.
      • setShowSuppressedViolations

        public void setShowSuppressedViolations​(boolean showSuppressedViolations)
        Description copied from interface: Renderer
        Set the indicator for whether to show suppressed violations.
        Specified by:
        setShowSuppressedViolations in interface Renderer
        Parameters:
        showSuppressedViolations - Whether to show suppressed violations.
      • setUseShortNames

        public void setUseShortNames​(java.util.List<java.lang.String> inputPaths)
        Description copied from interface: Renderer
        Render the filenames of found violations with short names. That is, any prefix given as inputPaths is removed. By default, the full pathnames are used. If the given list of inputPaths is empty, then the full pathnames are used.
        Specified by:
        setUseShortNames in interface Renderer
      • determineFileName

        protected java.lang.String determineFileName​(java.lang.String inputFileName)
        Determines the filename that should be used in the report depending on the option "shortnames". If the option is enabled, then the filename in the report is without the directory prefix of the directories, that have been analyzed. If the option "shortnames" is not enabled, then the inputFileName is returned as-is.
        Parameters:
        inputFileName -
        Returns:
        See Also:
        PMDConfiguration.isReportShortNames(), PMDParameters.isShortnames()
      • setWriter

        public void setWriter​(java.io.Writer writer)
        Description copied from interface: Renderer
        Set the Writer for the Renderer.
        Specified by:
        setWriter in interface Renderer
        Parameters:
        writer - The Writer.
      • getWriter

        public java.io.Writer getWriter()
        Description copied from interface: Renderer
        Get the Writer for the Renderer.
        Specified by:
        getWriter in interface Renderer
        Returns:
        The Writer.
      • flush

        public void flush()
        Specified by:
        flush in interface Renderer