net.logAnalyzer.reports
Class HTMLReport

java.lang.Object
  extended bynet.logAnalyzer.reports.HTMLReport
All Implemented Interfaces:
LAReport

public class HTMLReport
extends java.lang.Object
implements LAReport

This class is a wrapper used to encapsulate an HTML doc in a LAReport object.

Version:
0.1
Author:
David Vicente

Constructor Summary
HTMLReport(java.lang.String name, org.w3c.dom.Document report)
          Wrap the specified document in a new wrapper instance.
 
Method Summary
 java.awt.image.BufferedImage createBufferedImage(int width, int height)
          Create an image from the report as a BufferedImage.
 javax.swing.JComponent createGUI()
          Create the GUI displaying the report as a JEditorPane component.
 java.lang.String getFileExtension()
          Return the file extension of the report : html.
 java.lang.String getMimeType()
          Return the mime type of the report.
 java.lang.String getName()
          Return the name of the report.
 void saveToFile(java.lang.String filename)
          Save the report with the specified filename.
 void setName(java.lang.String name)
          Set the name of the report.
 java.lang.String toString()
          Serialize the wrapped document to a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HTMLReport

public HTMLReport(java.lang.String name,
                  org.w3c.dom.Document report)
Wrap the specified document in a new wrapper instance.

Parameters:
name - Name of the report.
report - Document to wrap as a report.
Method Detail

getFileExtension

public java.lang.String getFileExtension()
Return the file extension of the report : html.

Specified by:
getFileExtension in interface LAReport
Returns:
Report file name extension.
See Also:
LAReport.getFileExtension()

getName

public java.lang.String getName()
Return the name of the report.

Specified by:
getName in interface LAReport
Returns:
Report name.
See Also:
LAReport.getName()

setName

public void setName(java.lang.String name)
Set the name of the report.

Specified by:
setName in interface LAReport
Parameters:
name - Report name.
See Also:
LAReport.setName(String)

getMimeType

public java.lang.String getMimeType()
Return the mime type of the report.

Specified by:
getMimeType in interface LAReport
Returns:
Mime type of the report.
See Also:
LAReport.getMimeType()

saveToFile

public void saveToFile(java.lang.String filename)
                throws java.io.IOException
Save the report with the specified filename. The filename can contain a relative or absolute path.

If the file exists, it is overwritten.

Specified by:
saveToFile in interface LAReport
Parameters:
filename - Name of the output file.
Throws:
java.io.IOException - If an I/O exception occurs.
See Also:
LAReport.saveToFile(String)

createBufferedImage

public java.awt.image.BufferedImage createBufferedImage(int width,
                                                        int height)
Create an image from the report as a BufferedImage.

This implementation returns always null.

Specified by:
createBufferedImage in interface LAReport
Parameters:
width - Image width.
height - Image height.
Returns:
Image from the report; null if unsupported feature.

createGUI

public javax.swing.JComponent createGUI()
Create the GUI displaying the report as a JEditorPane component.

Specified by:
createGUI in interface LAReport
Returns:
GUI showing the report.
See Also:
LAReport.createGUI()

toString

public java.lang.String toString()
Serialize the wrapped document to a string.

Specified by:
toString in interface LAReport
Returns:
String serialization of the wrapped document, or null if an IOException occurs.
See Also:
LAReport.toString()


Copyright © 2006 null. All Rights Reserved.