org.opennms.systemreport.formatters
Class AbstractSystemReportFormatter

java.lang.Object
  extended by 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


Constructor Summary
AbstractSystemReportFormatter()
           
 
Method Summary
 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 UI's when presenting an option of which formatter to choose.
protected  String getOutput()
           
protected  OutputStream getOutputStream()
           
protected  String getResourceText(org.springframework.core.io.Resource r)
           
protected  boolean hasDisplayable(SystemReportPlugin plugin)
           
protected  boolean isDisplayable(org.springframework.core.io.Resource r)
           
protected  boolean isFile(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 specified SystemReportPlugin.
 
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
 

Constructor Detail

AbstractSystemReportFormatter

public AbstractSystemReportFormatter()
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 interface SystemReportFormatter

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 interface SystemReportFormatter

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 interface SystemReportFormatter

getName

public String getName()
Description copied from interface: SystemReportFormatter
A short name for this format for use by UI's when presenting an option of which formatter to choose.

Specified by:
getName in interface SystemReportFormatter
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 interface SystemReportFormatter
Returns:
the description

write

public void write(SystemReportPlugin plugin)
Description copied from interface: SystemReportFormatter
Write the data from the specified SystemReportPlugin.

Specified by:
write in interface SystemReportFormatter
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 interface SystemReportFormatter

end

public void end()
Description copied from interface: SystemReportFormatter
Indicates that report output will end.

Specified by:
end in interface SystemReportFormatter

compareTo

public int compareTo(SystemReportFormatter o)
Specified by:
compareTo in interface Comparable<SystemReportFormatter>

isDisplayable

protected boolean isDisplayable(org.springframework.core.io.Resource r)

isFile

protected boolean isFile(org.springframework.core.io.Resource r)

getResourceText

protected String getResourceText(org.springframework.core.io.Resource r)

hasDisplayable

protected boolean hasDisplayable(SystemReportPlugin plugin)


Copyright © 2011. All Rights Reserved.