Package org.gephi.io.importer.api
Class Report
- java.lang.Object
-
- org.gephi.io.importer.api.Report
-
public final class Report extends Object
Report is a log and issue container. Filled with information, details, minor or major issues, it is stored in an issue list and can be retrieved to present issues to end-users. Behavior is the same as a simple logging library.- Author:
- Mathieu Bastian
-
-
Constructor Summary
Constructors Constructor Description Report()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(Report report)Appends all entries inreportto this report.voidclean()Free resources.voidclose()Closes writing.Issue.LevelgetExceptionLevel()Get the current exception level for the report.Iterator<Issue>getIssues(int limit)Returns all issues written in the report.StringgetText()Returns the report logs and issues, presented as basic multi-line text.booleanisEmpty()voidlog(String message)Log an information message in the report.voidlogIssue(Issue issue)Log an issue in the report.voidsetExceptionLevel(Issue.Level exceptionLevel)Set the level of exception for the report.
-
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
-
clean
public void clean()
Free resources.
-
close
public void close()
Closes writing.
-
log
public void log(String message)
Log an information message in the report.- Parameters:
message- the message to write in the report- Throws:
NullPointerException- ifmessageisnull
-
append
public void append(Report report)
Appends all entries inreportto this report.- Parameters:
report- report to read entries from
-
logIssue
public void logIssue(Issue issue)
Log an issue in the report.- Parameters:
issue- the issue to write in the report- Throws:
NullPointerException- ifissueisnull
-
getIssues
public Iterator<Issue> getIssues(int limit)
Returns all issues written in the report.- Parameters:
limit- maximum number of issuers- Returns:
- a collection of all issues written in the report
-
getText
public String getText()
Returns the report logs and issues, presented as basic multi-line text.- Returns:
- a string of all messages and issues written in the report, one per line
-
getExceptionLevel
public Issue.Level getExceptionLevel()
Get the current exception level for the report. Default isLevel.CRITICAL.- Returns:
- the current exception level
-
setExceptionLevel
public void setExceptionLevel(Issue.Level exceptionLevel)
Set the level of exception for the report. If a reported issue has his level greater or equal asexceptionLevel, an exception is thrown. Default isLevel.CRITICAL- Parameters:
exceptionLevel- the exception level where exceptions are to be thrown
-
-