Class DefaultReportBuilder
java.lang.Object
com.itextpdf.pdfoptimizer.report.builder.DefaultReportBuilder
- Direct Known Subclasses:
-
FileReportBuilder
,LogReportBuilder
The goal of the class is to generate an optimization report.
-
Constructor Summary
ConstructorDescriptionDefaultReportBuilder
(SeverityLevel minimalLevel) Creates an instance of default ReportBuilder with provided minimal severity level. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a report based on messages logged withlog(SeverityLevel, Date, LocationStack, String, Object...)
.protected ArrayList<ReportMessage>
Returns list of logged messages.final ReportMessage
log
(SeverityLevel level, Date time, LocationStack location, String message, Object... params) Creates a message during PDF optimization process with provided severity level and message.protected void
processMessage
(ReportMessage message) Allows to provide additional logic of message processing.
-
Constructor Details
-
DefaultReportBuilder
Creates an instance of default ReportBuilder with provided minimal severity level.- Parameters:
-
minimalLevel
- is a minimalSeverityLevel
-
-
Method Details
-
log
public final ReportMessage log(SeverityLevel level, Date time, LocationStack location, String message, Object... params) Creates a message during PDF optimization process with provided severity level and message. Parametrized messages are also supported.- Parameters:
-
level
- is aSeverityLevel
of the message -
time
- is a time when the message was generated -
location
- is a string representation of the origin of the message -
message
- is a text of the message -
params
- is an array of parameters of the message - Returns:
- generated message if it was logged and null otherwise
-
build
Builds a report based on messages logged withlog(SeverityLevel, Date, LocationStack, String, Object...)
.- Returns:
- an optimization result object
-
getMessages
Returns list of logged messages.- Returns:
- the list of messages
-
processMessage
Allows to provide additional logic of message processing. The method is called insidelog(SeverityLevel, Date, LocationStack, String, Object...)
method.- Parameters:
-
message
- is a message to process
-