Interface Renderer

    • Method Detail

      • getName

        String getName()
        Get the name of the Renderer.
        Specified by:
        getName in interface PropertySource
        The name of the Renderer.
      • setName

        void setName​(String name)
        Set the name of the Renderer.
        name - The name of the Renderer.
      • getDescription

        String getDescription()
        Get the description of the Renderer.
        The description of the Renderer.
      • defaultFileExtension

        String defaultFileExtension()
        Return the default filename extension to use.
      • setDescription

        void setDescription​(String description)
        Set the description of the Renderer.
        description - The description of the Renderer.
      • isShowSuppressedViolations

        boolean isShowSuppressedViolations()
        Get the indicator for whether to show suppressed violations.
        true if suppressed violations should show, false otherwise.
      • setShowSuppressedViolations

        void setShowSuppressedViolations​(boolean showSuppressedViolations)
        Set the indicator for whether to show suppressed violations.
        showSuppressedViolations - Whether to show suppressed violations.
      • getWriter

        Writer getWriter()
        Get the Writer for the Renderer.
        The Writer.
      • setFileNameRenderer

        void setFileNameRenderer​(FileNameRenderer fileNameRenderer)
        Set the FileNameRenderer used to render file paths to the report. Note that this renderer does not have to use the parameter to output paths. Some report formats require a specific format for paths (eg a URI), and are allowed to circumvent the provided strategy.
        fileNameRenderer - a non-null file name renderer
      • setWriter

        void setWriter​(Writer writer)
        Set the Writer for the Renderer.
        writer - The Writer.
      • start

        void start()
            throws IOException
        This method is called before any source files are processed. The Renderer will have been fully initialized by the time this method is called, so the Writer and other state will be available.
      • startFileAnalysis

        void startFileAnalysis​(TextFile dataSource)
        This method is called each time a source file is processed. It is called after start(), but before renderFileReport(Report) and end(). This method may be invoked by different threads which are processing files independently. Therefore, any non-trivial implementation of this method needs to be thread-safe.
        dataSource - The source file.
      • setReportFile

        void setReportFile​(String reportFilename)
        Sets the filename where the report should be written to. If no filename is provided, the renderer should write to stdout.

        Implementations must initialize the writer of the renderer.

        See AbstractRenderer.setReportFile(String) for the default impl.

        reportFilename - the filename (optional).