Package aQute.libg.reporter
Class ReporterAdapter
java.lang.Object
aQute.libg.reporter.ReporterAdapter
- Direct Known Subclasses:
Env
,LogToReporterAdapter
,ReplacerAdapter
,Slf4jReporter
Mainly used for testing where reporters are needed.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface aQute.service.reporter.Report
Report.Location
Nested classes/interfaces inherited from interface aQute.service.reporter.Reporter
Reporter.SetLocation
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) boolean
(package private) final List<ReporterAdapter.LocationImpl>
(package private) final Formatter
(package private) boolean
(package private) boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addErrors
(String prefix, Collection<String> errors) Add a number of errorsvoid
addWarnings
(String prefix, Collection<String> warnings) Add a number of warningsboolean
Create an error.Dedicated message for an exception.Return the errors.boolean
boolean
getLocation
(String msg) Return the errors for the given error or warning.<T> T
getMessages
(Class<T> c) Return a messages object bound to this adaptergetOut()
Return the warnings.boolean
boolean
isOk()
Check if this report has any relevant errors that should make the run associated with this report invalid.boolean
The provider of the reporter wants pedantic reporting, meaning every possible warning should be reported.boolean
boolean
isTrace()
private Reporter.SetLocation
void
Deprecated.Use SLF4J Logger.info(aQute.libg.slf4j.GradleLogging.LIFECYCLE) instead.void
report
(Appendable out) Report the errors and warnings(package private) void
report
(String title, Collection<String> list, Formatter f) void
run()
Handy routine that can be extended by subclasses so they can run inside the contextvoid
setExceptions
(boolean exceptions) void
setPedantic
(boolean pedantic) void
setTrace
(boolean b) private String
void
Create a warning.Create a warning.
-
Field Details
-
errors
-
warnings
-
locations
-
out
-
trace
boolean trace -
pedantic
boolean pedantic -
exceptions
boolean exceptions
-
-
Constructor Details
-
ReporterAdapter
public ReporterAdapter() -
ReporterAdapter
-
-
Method Details
-
isExceptions
public boolean isExceptions()- Returns:
- the exceptions
-
setExceptions
public void setExceptions(boolean exceptions) - Parameters:
exceptions
- the exceptions to set
-
getOut
- Returns:
- the out
-
isTrace
public boolean isTrace()- Returns:
- the trace
-
setPedantic
public void setPedantic(boolean pedantic) - Parameters:
pedantic
- the pedantic to set
-
error
Description copied from interface:Reporter
Create an error. Implementations must ensure that the given args are not prevented from garbage collecting. The args must have a proper toString method. -
exception
Description copied from interface:Reporter
Dedicated message for an exception. -
shorten
-
warning
Description copied from interface:Reporter
Create a warning. Implementations must ensure that the given args are not prevented from garbage collecting. The args must have a proper toString method. -
location
-
progress
Deprecated.Use SLF4J Logger.info(aQute.libg.slf4j.GradleLogging.LIFECYCLE) instead.Description copied from interface:Reporter
Create a warning. Implementations must ensure that the given args are not prevented from garbage collecting. The args must have a proper toString method. -
trace
Description copied from interface:Reporter
Create a warning. Implementations must ensure that the given args are not prevented from garbage collecting. The args must have a proper toString method. -
getWarnings
Description copied from interface:Report
Return the warnings. This list must not be changed and may be immutable.- Specified by:
getWarnings
in interfaceReport
- Returns:
- the warnings
-
getErrors
Description copied from interface:Report
Return the errors. This list must not be changed and may be immutable. -
isPedantic
public boolean isPedantic()Description copied from interface:Reporter
The provider of the reporter wants pedantic reporting, meaning every possible warning should be reported.- Specified by:
isPedantic
in interfaceReporter
- Returns:
- if this is a pedantic reporter.
-
setTrace
public void setTrace(boolean b) -
isOk
public boolean isOk()Description copied from interface:Report
Check if this report has any relevant errors that should make the run associated with this report invalid. I.e. if this returns false then the run should be disregarded. -
isPerfect
public boolean isPerfect() -
check
-
report
Report the errors and warnings -
report
-
getInfo
-
getInfo
-
getLocation
Description copied from interface:Report
Return the errors for the given error or warning. Can return null.- Specified by:
getLocation
in interfaceReport
- Parameters:
msg
- The message- Returns:
- null or the location of the message
-
run
public void run()Handy routine that can be extended by subclasses so they can run inside the context -
getMessages
Return a messages object bound to this adapter -
addErrors
Add a number of errors -
addWarnings
Add a number of warnings
-