Interface FileAnalysisListener

  • All Superinterfaces:
    All Known Implementing Classes:

    public interface FileAnalysisListener
    extends AutoCloseable
    A handler for events occuring during analysis of a single file. Instances are only used on a single thread for their entire lifetime, so don't need to be synchronized to access state they own.

    Listeners are assumed to be ready to receive events as soon as they are constructed.

    • Method Detail

      • onRuleViolation

        void onRuleViolation​(RuleViolation violation)
        Handle a new violation (not suppressed).
      • onSuppressedRuleViolation

        default void onSuppressedRuleViolation​(Report.SuppressedViolation violation)
        Handle a new suppressed violation.
      • onError

        default void onError​(Report.ProcessingError error)
        Handle an error that occurred while processing a file.
      • close

        default void close()
                    throws Exception
        Signals the end of the analysis: no further calls will be made to this listener. This is run in the thread the listener has been used in. This means, if this routine merges some state into some global state of the {@link GlobalAnalysisListener), then that must be synchronized.
        Specified by:
        close in interface AutoCloseable
        Exception - If an exception occurs, eg IOException when writing to a renderer