Package org.revapi.maven
Class BuildTimeReporter
- java.lang.Object
-
- org.revapi.maven.BuildTimeReporter
-
- All Implemented Interfaces:
AutoCloseable,org.revapi.configuration.Configurable,org.revapi.Reporter
public final class BuildTimeReporter extends Object implements org.revapi.Reporter
Build-time reporter is aReporterextension for Revapi that is used by theCheckMojoto output the found problems and also to provide the suggestions to the user how to ignore the problems if deemed ok.Even though this is a normal Revapi extension, it doesn't use the normal configuration mechanisms provided by Revapi (i.e. it doesn't define a configuration schema and doesn't accept any configuration from the configuration in the analysis context during the
initialize(AnalysisContext)method). Instead, it is configured through theAnalysisContext.getData(String). This is to make it easier to pass complex objects to the reporter and also to amplify the fact that this is no "normal" extension but is tightly bound to theCheckMojoand the Maven build.- Since:
- 0.1
- Author:
- Lukas Krejci
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classBuildTimeReporter.SuggestionBuilderContextThe context that can be used by theBuildTimeReporter.SuggestionsBuilderto get information about the differences and the configured output options.static interfaceBuildTimeReporter.SuggestionsBuilderA suggestion builder is an object that theBuildTimeReporteruses to render suggestions for ignoring the found problems.
-
Field Summary
Fields Modifier and Type Field Description static StringBREAKING_CRITICALITY_KEYstatic StringOUTPUT_NON_IDENTIFYING_ATTACHMENTSstatic StringSUGGESTIONS_BUILDER_KEY
-
Constructor Summary
Constructors Constructor Description BuildTimeReporter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()StringgetAllProblemsMessage()StringgetExtensionId()StringgetIgnoreSuggestion()ReadergetJSONSchema()booleanhasBreakingProblems()voidinitialize(org.revapi.AnalysisContext context)voidreport(org.revapi.Report report)
-
-
-
Field Detail
-
BREAKING_CRITICALITY_KEY
public static final String BREAKING_CRITICALITY_KEY
- See Also:
- Constant Field Values
-
OUTPUT_NON_IDENTIFYING_ATTACHMENTS
public static final String OUTPUT_NON_IDENTIFYING_ATTACHMENTS
- See Also:
- Constant Field Values
-
SUGGESTIONS_BUILDER_KEY
public static final String SUGGESTIONS_BUILDER_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
hasBreakingProblems
public boolean hasBreakingProblems()
-
getAllProblemsMessage
public String getAllProblemsMessage()
-
getIgnoreSuggestion
public String getIgnoreSuggestion()
-
getExtensionId
@Nullable public String getExtensionId()
- Specified by:
getExtensionIdin interfaceorg.revapi.configuration.Configurable
-
getJSONSchema
@Nullable public Reader getJSONSchema()
- Specified by:
getJSONSchemain interfaceorg.revapi.configuration.Configurable
-
initialize
public void initialize(@Nonnull org.revapi.AnalysisContext context)
- Specified by:
initializein interfaceorg.revapi.configuration.Configurable
-
report
public void report(@Nonnull org.revapi.Report report)
- Specified by:
reportin interfaceorg.revapi.Reporter
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
-