Package org.apache.ofbiz.htmlreport
Class AbstractReport
- java.lang.Object
-
- org.apache.ofbiz.htmlreport.AbstractReport
-
- All Implemented Interfaces:
InterfaceReport
- Direct Known Subclasses:
HtmlReport
public abstract class AbstractReport extends java.lang.Object implements InterfaceReport
Base report class.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
SESSION_REPORT_CLASS
-
Fields inherited from interface org.apache.ofbiz.htmlreport.InterfaceReport
FORMAT_DEFAULT, FORMAT_ERROR, FORMAT_HEADLINE, FORMAT_NOTE, FORMAT_OK, FORMAT_WARNING, REPORT_TYPE_EXTENDED, REPORT_TYPE_SIMPLE
-
-
Constructor Summary
Constructors Constructor Description AbstractReport()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addError(java.lang.Object obj)
Adds an error object to the list of errors that occured during the report.void
addWarning(java.lang.Object obj)
Adds a warning object to the list of warnings that occured during the report.java.lang.String
formatRuntime()
Formats the runtime formatted as "hh:mm:ss".java.util.List<java.lang.Object>
getErrors()
Returns a list of all errors that occured during the report.java.util.Locale
getLocale()
Returns the locale this report was initialized with.long
getRuntime()
Returns the time this report has been running.java.util.List<java.lang.Object>
getWarnings()
Returns a list of all warnings that occured during the report.boolean
hasError()
Returns if the report generated an error output.boolean
hasWarning()
Returns if the report generated a warning output.protected void
init(java.util.Locale locale)
Initializes some member variables for this report.void
print(java.lang.String value)
Prints a String to the report.abstract void
print(java.lang.String value, int format)
Prints a String to the report, using the indicated formatting.void
println(java.lang.String value)
Prints a String with line break to the report.void
println(java.lang.String value, int format)
Prints a String with line break to the report, using the indicated formatting.void
resetRuntime()
Resets the runtime to 0 milliseconds.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.ofbiz.htmlreport.InterfaceReport
addLogFile, closeLogFile, getReportUpdate, getSequenceNum, println, println, printMessageWithParam, printMessageWithParam, setSequenceNum
-
-
-
-
Field Detail
-
SESSION_REPORT_CLASS
public static final java.lang.String SESSION_REPORT_CLASS
- See Also:
- Constant Field Values
-
-
Method Detail
-
addError
public void addError(java.lang.Object obj)
Description copied from interface:InterfaceReport
Adds an error object to the list of errors that occured during the report.- Specified by:
addError
in interfaceInterfaceReport
- Parameters:
obj
- the error object
-
addWarning
public void addWarning(java.lang.Object obj)
Description copied from interface:InterfaceReport
Adds a warning object to the list of warnings that occured during the report.- Specified by:
addWarning
in interfaceInterfaceReport
- Parameters:
obj
- the error object
-
formatRuntime
public java.lang.String formatRuntime()
Description copied from interface:InterfaceReport
Formats the runtime formatted as "hh:mm:ss".- Specified by:
formatRuntime
in interfaceInterfaceReport
- Returns:
- the runtime formatted as "hh:mm:ss"
-
getErrors
public java.util.List<java.lang.Object> getErrors()
Description copied from interface:InterfaceReport
Returns a list of all errors that occured during the report.- Specified by:
getErrors
in interfaceInterfaceReport
- Returns:
- an error list that occured during the report
-
getLocale
public java.util.Locale getLocale()
Description copied from interface:InterfaceReport
Returns the locale this report was initialized with.- Specified by:
getLocale
in interfaceInterfaceReport
- Returns:
- the locale this report was initialized with
-
getRuntime
public long getRuntime()
Description copied from interface:InterfaceReport
Returns the time this report has been running.- Specified by:
getRuntime
in interfaceInterfaceReport
- Returns:
- the time this report has been running
-
getWarnings
public java.util.List<java.lang.Object> getWarnings()
Description copied from interface:InterfaceReport
Returns a list of all warnings that occured during the report.- Specified by:
getWarnings
in interfaceInterfaceReport
- Returns:
- a warning list that occured during the report
-
hasError
public boolean hasError()
Description copied from interface:InterfaceReport
Returns if the report generated an error output.- Specified by:
hasError
in interfaceInterfaceReport
- Returns:
- true if the report generated an error, otherwise false
-
hasWarning
public boolean hasWarning()
Description copied from interface:InterfaceReport
Returns if the report generated a warning output.- Specified by:
hasWarning
in interfaceInterfaceReport
- Returns:
- true if the report generated a warning, otherwise false
-
resetRuntime
public void resetRuntime()
Description copied from interface:InterfaceReport
Resets the runtime to 0 milliseconds.- Specified by:
resetRuntime
in interfaceInterfaceReport
-
init
protected void init(java.util.Locale locale)
Initializes some member variables for this report.- Parameters:
locale
- the locale for this report
-
print
public void print(java.lang.String value)
Prints a String to the report.- Specified by:
print
in interfaceInterfaceReport
- Parameters:
value
- the String to add
-
print
public abstract void print(java.lang.String value, int format)
Prints a String to the report, using the indicated formatting.Use the contants starting with
FORMAT
from this interface to indicate which formatting to use.- Specified by:
print
in interfaceInterfaceReport
- Parameters:
value
- the message container to addformat
- the formatting to use for the output
-
println
public void println(java.lang.String value)
Prints a String with line break to the report.- Specified by:
println
in interfaceInterfaceReport
- Parameters:
value
- the message container to add
-
println
public void println(java.lang.String value, int format)
Prints a String with line break to the report, using the indicated formatting.Use the contants starting with
FORMAT
from this interface to indicate which formatting to use.- Specified by:
println
in interfaceInterfaceReport
- Parameters:
value
- the String to addformat
- the formatting to use for the output
-
-