java.lang.Object
edu.hm.hafner.analysis.Report
- Alle implementierten Schnittstellen:
Serializable,Iterable<Issue>
A report contains a set of unique
issues: it contains no duplicate elements, i.e. it models the
mathematical set abstraction. This report provides a total ordering on its elements. I.e., the issues
in this report are ordered by their index: the first added issue is at position 0, the second added issues is at
position 1, and so on.
Additionally, this report provides methods to find and filter issues based on different properties. In order to
create issues use the provided builder class.
- Autor:
- Ullrich Hafner
- Siehe auch:
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic classBuilds a combined filter based on several include and exclude filters.static interfacePrints a summary of anIssue.static classPrints issues to the "standard" output stream. -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungAppends the specified issue to the end of this report.Appends all the specified issues to the end of this report, preserving the order of the array elements.Appends the specifiedreportsto this report.addAll(Collection<? extends Issue> issues) Appends all of the specified issues to the end of this report, preserving the order of the array elements.copy()Returns a shallow copy of this issue container.Returns a new empty issue container with the same properties as this container.booleanFinds all issues that match the specified criterion.Returns the issue with the specified ID.findByProperty(Predicate<? super Issue> criterion) Finds all issues that match the specified criterion.get()Returns the issues in this report.get(int index) Returns the issue with the specified index.Returns the absolute paths of the affected files for all issues.Returns the used categories for all issues.intgetCounter(String key) Returns the specified custom counter of this report.intReturns the number of duplicates.Returns the effective ID of this report.Returns the effective ID of this report.Returns the error messages that have been reported since the creation of this set of issues.getFiles()Returns the affected files for all issues.Returns the folders for all affected files of the issues.getId()Returns the info messages that have been reported since the creation of this set of issues.Returns the affected modules for all issues.getName()getNameOfOrigin(String origin) Returns a human-readable name for the specifiedoriginof this report.Returns the names of all report files that are the origin for the issues of thisReport(and all contained sub-reports).Returns the affected packages for all issues.<T> Set<T> getProperties(Function<? super Issue, T> propertiesMapper) Returns the different values for a given property for all issues.getPropertyCount(Function<? super Issue, T> propertiesMapper) Returns the number of occurrences for every existing value of a given property for all issues.Returns the severities of all issues.intgetSize()Returns the number of issues in this report.intReturns the number of issues with the specifiedSeverity.intReturns the number of issues with the specifiedseverity.getTools()Returns the names of the tools that did report the issues.getTypes()Returns the used types for all issues.groupByProperty(String propertyName) Groups issues by a specified property.booleanReturns whether this report contains issues with different categories.booleanhasCounter(String key) Returns whether the specified custom counter of this report is defined.booleanReturns whether error messages have been reported.booleanhasFiles()Returns whether this report contains more than one affected file.booleanReturns whether this report contains more than one folder with affected files.inthashCode()booleanReturns whether this report contains affected files from more than one module.booleanReturns whether this report contains affected files from more than one package.booleanReturns whether this report contains issues of different severities.booleanhasTools()Returns whether this report contains issues created by different tools.booleanhasTypes()Returns whether this report contains issues with different types.booleanisEmpty()Returns whether this report is empty.booleanReturns whether this report is not empty.iterator()voidLogs the specified error message.voidlogException(Exception exception, String format, Object... args) Logs the specified exception.voidLogs the specified information message.voidmergeLogMessages(edu.hm.hafner.util.FilteredLog log) Merge all log messages from the specified log into the log of this report.voidprint(Report.IssuePrinter issuePrinter) Prints all issues of the report.protected ObjectCalled after de-serialization to improve the memory usage and to initialize fields that have been introduced after the first release.voidsetCounter(String key, int value) Sets the specified custom counter for this report.voidSets the origin of all issues in this report.voidsetOriginReportFile(String originReportFile) intsize()Returns the number of issues in this container.stream()Creates a new sequentialStreamofIssueinstances.toString()Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitVon Schnittstelle geerbte Methoden java.lang.Iterable
forEach, spliterator
-
Konstruktordetails
-
Report
public Report()Creates an emptyReport. -
Report
Creates an emptyReportwith the specified ID and name.- Parameter:
id- the ID of the reportname- a human-readable name for the report
-
Report
Creates an emptyReportwith the specified ID and name. Link the report with the specified source file that is the origin of the issues.- Parameter:
id- the ID of the reportname- a human-readable name for the reportoriginReportFile- the specified source file * that is the origin of the issues.
-
Report
Creates a newReportthat is an aggregation of the specifiedreports. The created report will contain the issues of all specified reports, in the same order. The properties of the specified reports will also be copied.- Parameter:
reports- the reports to append- Siehe auch:
-
Report
Creates a newReportthat is an aggregation of the specifiedreports. The created report will contain the issues of all specified reports, in the same order. The properties of the specified reports will also be copied.- Parameter:
reports- the initial set of issues- Siehe auch:
-
-
Methodendetails
-
getId
-
getEffectiveId
Returns the effective ID of this report. This ID is the unique ID of all containing sub-reports. If this ID is not unique, then theDEFAULT_IDwill be returned.- Gibt zurück:
- the effective ID of all sub-reports
-
getName
-
setOrigin
Sets the origin of all issues in this report. Calling this method will associate all containing issues and issues in sub-reports using the specified ID and name.- Parameter:
originId- the ID of the reportoriginName- a human-readable name for the report
-
getEffectiveName
Returns the effective ID of this report. This ID is the unique ID of all containing sub-reports. If this ID is not unique, then theDEFAULT_IDwill be returned.- Gibt zurück:
- the effective ID of all sub-reports
-
getOriginReportFile
-
setOriginReportFile
-
getOriginReportFiles
Returns the names of all report files that are the origin for the issues of thisReport(and all contained sub-reports).- Gibt zurück:
- the names of all report files
-
add
Appends the specified issue to the end of this report. Duplicates will be skipped (the number of skipped elements is available using the methodgetDuplicatesSize().- Parameter:
issue- the issue to append- Gibt zurück:
- this
-
addAll
Appends all the specified issues to the end of this report, preserving the order of the array elements. Duplicates will be skipped (the number of skipped elements is available using the methodgetDuplicatesSize()).- Parameter:
issue- the first issue to appendadditionalIssues- the additional issue to append- Gibt zurück:
- this
- Siehe auch:
-
addAll
Appends all of the specified issues to the end of this report, preserving the order of the array elements. Duplicates will be skipped (the number of skipped elements is available using the methodgetDuplicatesSize().- Parameter:
issues- the issues to append- Gibt zurück:
- this
- Siehe auch:
-
addAll
Appends the specifiedreportsto this report. This report will then contain the issues of all specified reports, in the same order. The properties of the specified reports will also be copied.- Parameter:
reports- the reports to append- Gibt zurück:
- this
- Siehe auch:
-
readResolve
Called after de-serialization to improve the memory usage and to initialize fields that have been introduced after the first release.- Gibt zurück:
- this
-
findById
Returns the issue with the specified ID.- Parameter:
issueId- the ID of the issue- Gibt zurück:
- the found issue
- Löst aus:
NoSuchElementException- if there is no such issue found
-
findByProperty
Finds all issues that match the specified criterion.- Parameter:
criterion- the filter criterion- Gibt zurück:
- the found issues
-
filter
Finds all issues that match the specified criterion.- Parameter:
criterion- the filter criterion- Gibt zurück:
- the found issues
-
iterator
-
stream
Creates a new sequentialStreamofIssueinstances.- Gibt zurück:
- a new
Stream
-
get
Returns the issues in this report. This will include the issues of any sub-reports.- Gibt zurück:
- all issues in this report
-
get
Returns the issue with the specified index.- Parameter:
index- the index- Gibt zurück:
- the issue at the specified index
- Löst aus:
IndexOutOfBoundsException- if there is no element for the given index
-
size
public int size()Returns the number of issues in this container.- Gibt zurück:
- total number of issues
-
isEmpty
public boolean isEmpty()Returns whether this report is empty.- Gibt zurück:
trueif this report is empty,falseotherwise- Siehe auch:
-
isNotEmpty
public boolean isNotEmpty()Returns whether this report is not empty.- Gibt zurück:
trueif this report is not empty,falseotherwise- Siehe auch:
-
getSize
public int getSize()Returns the number of issues in this report.- Gibt zurück:
- total number of issues
-
getDuplicatesSize
public int getDuplicatesSize()Returns the number of duplicates. Every issue that has been added to this report, but already is part of this report (based onequals(Object)) is counted as a duplicate. Duplicates are not stored in this report.- Gibt zurück:
- total number of duplicates
-
getSizeOf
Returns the number of issues with the specifiedseverity.- Parameter:
severity- the severity of the issues- Gibt zurück:
- total number of issues
-
getSizeOf
Returns the number of issues with the specifiedSeverity.- Parameter:
severity- the severity of the issues- Gibt zurück:
- total number of issues
-
toString
-
print
Prints all issues of the report.- Parameter:
issuePrinter- prints a summary of anIssue
-
getModules
Returns the affected modules for all issues.- Gibt zurück:
- the affected modules
-
hasModules
public boolean hasModules()Returns whether this report contains affected files from more than one module.- Gibt zurück:
trueif the number of modules is greater than 1,falseotherwise
-
getPackages
Returns the affected packages for all issues.- Gibt zurück:
- the affected packages
-
hasPackages
public boolean hasPackages()Returns whether this report contains affected files from more than one package.- Gibt zurück:
trueif the number of packages is greater than 1,falseotherwise
-
getFolders
Returns the folders for all affected files of the issues.- Gibt zurück:
- the affected packages
-
hasFolders
public boolean hasFolders()Returns whether this report contains more than one folder with affected files.- Gibt zurück:
trueif the number of folders is greater than 1,falseotherwise
-
getAbsolutePaths
Returns the absolute paths of the affected files for all issues.- Gibt zurück:
- the affected files
-
getFiles
Returns the affected files for all issues.- Gibt zurück:
- the affected files
-
hasFiles
public boolean hasFiles()Returns whether this report contains more than one affected file.- Gibt zurück:
trueif the number of affected files is greater than 1,falseotherwise
-
getCategories
Returns the used categories for all issues.- Gibt zurück:
- the used categories
-
hasCategories
public boolean hasCategories()Returns whether this report contains issues with different categories.- Gibt zurück:
trueif the number of categories is greater than 1,falseotherwise
-
getTypes
Returns the used types for all issues.- Gibt zurück:
- the used types
-
hasTypes
public boolean hasTypes()Returns whether this report contains issues with different types.- Gibt zurück:
trueif the number of types is greater than 1,falseotherwise
-
getTools
Returns the names of the tools that did report the issues.- Gibt zurück:
- the tools
-
hasTools
public boolean hasTools()Returns whether this report contains issues created by different tools.- Gibt zurück:
trueif the number of tools is greater than 1,falseotherwise
-
getSeverities
Returns the severities of all issues.- Gibt zurück:
- the severities
-
hasSeverities
public boolean hasSeverities()Returns whether this report contains issues of different severities.- Gibt zurück:
trueif the number of severities is greater than 1,falseotherwise
-
getProperties
Returns the different values for a given property for all issues.- Typparameter:
T- type of the property- Parameter:
propertiesMapper- the properties mapper that selects the property- Gibt zurück:
- the set of different values
- Siehe auch:
-
getPropertyCount
Returns the number of occurrences for every existing value of a given property for all issues.- Typparameter:
T- type of the property- Parameter:
propertiesMapper- the properties mapper that selects the property to evaluate- Gibt zurück:
- a mapping of: property value to the number of issues for that value
- Siehe auch:
-
groupByProperty
Groups issues by a specified property. Returns the results as a mapping of property values to a new set ofReportfor this value.- Parameter:
propertyName- the property to that selects the property to evaluate- Gibt zurück:
- a mapping of: property value to the number of issues for that value
- Siehe auch:
-
copy
Returns a shallow copy of this issue container.- Gibt zurück:
- a new issue container that contains the same elements in the same order
-
copyEmptyInstance
Returns a new empty issue container with the same properties as this container. The new issue container is empty and does not contain issues.- Gibt zurück:
- a new issue container that contains the same properties but no issues
-
mergeLogMessages
public void mergeLogMessages(edu.hm.hafner.util.FilteredLog log) Merge all log messages from the specified log into the log of this report.- Parameter:
log- the log messages to merge
-
logInfo
Logs the specified information message. Use this method to log any useful information when composing this report.- Parameter:
format- A format stringargs- Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero.- Siehe auch:
-
logError
Logs the specified error message. Use this method to log any error when composing this report.- Parameter:
format- A format stringargs- Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero.- Siehe auch:
-
logException
Logs the specified exception. Use this method to log any exception when composing this report.- Parameter:
exception- the exception to logformat- A format stringargs- Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero.- Siehe auch:
-
getInfoMessages
Returns the info messages that have been reported since the creation of this set of issues.- Gibt zurück:
- the info messages
-
getErrorMessages
Returns the error messages that have been reported since the creation of this set of issues.- Gibt zurück:
- the error messages
-
hasErrors
public boolean hasErrors()Returns whether error messages have been reported.- Gibt zurück:
trueif there are error messages,falseotherwise
-
equals
-
hashCode
public int hashCode() -
getNameOfOrigin
Returns a human-readable name for the specifiedoriginof this report.- Parameter:
origin- the origin to get the human-readable name for- Gibt zurück:
- the name, or an empty string if no such name has been set
-
setCounter
Sets the specified custom counter for this report.- Parameter:
key- the unique key for this countervalue- the value to set
-
getCounter
Returns the specified custom counter of this report.- Parameter:
key- the unique key for this counter- Gibt zurück:
- the value of the specified counter, or 0 if the counter has not been set or is undefined
-
hasCounter
Returns whether the specified custom counter of this report is defined.- Parameter:
key- the unique key for this counter- Gibt zurück:
trueif the counter has been set,falseotherwise
-