Class AbstractSystemReportFormatter
- java.lang.Object
-
- org.opennms.systemreport.formatters.AbstractSystemReportFormatter
-
- All Implemented Interfaces:
Comparable<SystemReportFormatter>
,SystemReportFormatter
- Direct Known Subclasses:
FtpSystemReportFormatter
,FullTextSystemReportFormatter
,TextSystemReportFormatter
,XmlSystemReportFormatter
,ZipSystemReportFormatter
public abstract class AbstractSystemReportFormatter extends Object implements SystemReportFormatter
-
-
Field Summary
Fields Modifier and Type Field Description protected OutputStream
m_outputStream
-
Constructor Summary
Constructors Constructor Description AbstractSystemReportFormatter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
begin()
Indicates that report output will begin.int
compareTo(SystemReportFormatter o)
void
end()
Indicates that report output will end.String
getDescription()
A short description of the format.String
getName()
A short name for this format for use by UIs when presenting an option of which formatter to choose.protected String
getOutput()
protected OutputStream
getOutputStream()
protected String
getResourceText(org.springframework.core.io.Resource r)
boolean
needsOutputStream()
Whether or not this formatter needs to be given an output stream.void
setOutput(String output)
The output string as passed on the command-line.void
setOutputStream(OutputStream stream)
The output stream to use when writing data.void
write(SystemReportPlugin plugin)
Write the data from the specifiedSystemReportPlugin
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opennms.systemreport.SystemReportFormatter
canStdout, getContentType, getExtension
-
-
-
-
Field Detail
-
m_outputStream
protected OutputStream m_outputStream
-
-
Method Detail
-
getOutput
protected String getOutput()
-
setOutput
public void setOutput(String output)
Description copied from interface:SystemReportFormatter
The output string as passed on the command-line.- Specified by:
setOutput
in interfaceSystemReportFormatter
-
getOutputStream
protected OutputStream getOutputStream()
-
setOutputStream
public void setOutputStream(OutputStream stream)
Description copied from interface:SystemReportFormatter
The output stream to use when writing data.- Specified by:
setOutputStream
in interfaceSystemReportFormatter
-
needsOutputStream
public boolean needsOutputStream()
Description copied from interface:SystemReportFormatter
Whether or not this formatter needs to be given an output stream.- Specified by:
needsOutputStream
in interfaceSystemReportFormatter
-
getName
public String getName()
Description copied from interface:SystemReportFormatter
A short name for this format for use by UIs when presenting an option of which formatter to choose.- Specified by:
getName
in interfaceSystemReportFormatter
- Returns:
- the format name (eg, "text", "xml", etc.)
-
getDescription
public String getDescription()
Description copied from interface:SystemReportFormatter
A short description of the format.- Specified by:
getDescription
in interfaceSystemReportFormatter
- Returns:
- the description
-
write
public void write(SystemReportPlugin plugin)
Description copied from interface:SystemReportFormatter
Write the data from the specifiedSystemReportPlugin
.- Specified by:
write
in interfaceSystemReportFormatter
- Parameters:
plugin
- the system report plugin which contains the data to write
-
begin
public void begin()
Description copied from interface:SystemReportFormatter
Indicates that report output will begin.- Specified by:
begin
in interfaceSystemReportFormatter
-
end
public void end()
Description copied from interface:SystemReportFormatter
Indicates that report output will end.- Specified by:
end
in interfaceSystemReportFormatter
-
compareTo
public final int compareTo(SystemReportFormatter o)
- Specified by:
compareTo
in interfaceComparable<SystemReportFormatter>
-
getResourceText
protected String getResourceText(org.springframework.core.io.Resource r)
-
-