Package org.opencms.report
Class CmsPrintStreamReport
java.lang.Object
org.opencms.report.A_CmsReport
org.opencms.report.CmsHtmlReport
org.opencms.report.CmsPrintStreamReport
- All Implemented Interfaces:
I_CmsReport
- Direct Known Subclasses:
CmsPublishReport,CmsShellReport
Stream report where the output is streamed to the given print stream instance.
Keep in mind that you are resposible for closing the stream calling the close()
method when the report is no longer used.
- Since:
- 6.5.5
-
Field Summary
Fields inherited from class org.opencms.report.CmsHtmlReport
LINEBREAK, LINEBREAK_TRADITIONALFields inherited from interface org.opencms.report.I_CmsReport
FORMAT_DEFAULT, FORMAT_ERROR, FORMAT_HEADLINE, FORMAT_NOTE, FORMAT_OK, FORMAT_WARNING, REPORT_TYPE_EXTENDED, REPORT_TYPE_SIMPLE -
Constructor Summary
ConstructorsConstructorDescriptionCmsPrintStreamReport(PrintStream printStream, Locale locale, boolean writeHtml) Constructs a new report using the provided locale for the output language. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the print stream.voidfinish()Finishes the report, closing the stream.protected StringReturns the correct line break notation depending on the output style of this report.Updates this report, this processes all new output added since the last call to this method.voidPrints a String to the report, using the indicated formatting.voidprintln()Adds a line break to the report.voidAdds an Exception to the report, ensuring that the Exception content is processed to generate a valid output esp.voidstart()Starts the report.Methods inherited from class org.opencms.report.CmsHtmlReport
isWriteHtmlMethods inherited from class org.opencms.report.A_CmsReport
addError, addWarning, formatRuntime, getErrors, getLastEntryTime, getLocale, getMessages, getReportUpdate, getRuntime, getSiteRoot, getWarnings, hasError, hasWarning, init, print, print, print, println, println, println, println, printMessageWithParam, printMessageWithParam, removeSiteRoot, resetRuntime, setLastEntryTime
-
Constructor Details
-
CmsPrintStreamReport
Constructs a new report using the provided locale for the output language.- Parameters:
printStream- the print stream to write the output tolocale- the locale to use for the output languagewriteHtml- decides if the report should write clear text or html code
-
-
Method Details
-
close
Closes the print stream.Has to be called after the report has finished.
-
finish
Finishes the report, closing the stream. -
getReportUpdate
Description copied from interface:I_CmsReportUpdates this report, this processes all new output added since the last call to this method.This is only required in case the output is written to a HTML page, if the shell output is used, this will just return an empty String.
- Specified by:
getReportUpdatein interfaceI_CmsReport- Overrides:
getReportUpdatein classCmsHtmlReport- Returns:
- new elements that have been added to the report and not yet processed.
- See Also:
-
print
Description copied from class:A_CmsReportPrints a String to the report, using the indicated formatting.Use the constants starting with
FORMATfrom this interface to indicate which formatting to use.- Overrides:
printin classCmsHtmlReport- Parameters:
value- the message container to addformat- the formatting to use for the output- See Also:
-
println
Description copied from interface:I_CmsReportAdds a line break to the report.- Specified by:
printlnin interfaceI_CmsReport- Overrides:
printlnin classCmsHtmlReport- See Also:
-
println
Description copied from interface:I_CmsReportAdds an Exception to the report, ensuring that the Exception content is processed to generate a valid output esp. for HTML pages.The exception will be stored and the output will later be processed in a special way.
- Specified by:
printlnin interfaceI_CmsReport- Overrides:
printlnin classCmsHtmlReport- Parameters:
t- the exception to add- See Also:
-
start
Starts the report. -
getLineBreak
Description copied from class:CmsHtmlReportReturns the correct line break notation depending on the output style of this report.- Overrides:
getLineBreakin classCmsHtmlReport- Returns:
- the correct line break notation
- See Also:
-