Class HTMLFormatter

java.lang.Object
com.nomagic.magicreport.format.DefaultFormatter
com.nomagic.magicreport.format.HTMLFormatter
All Implemented Interfaces:
IFormatter

@OpenApiAll public class HTMLFormatter extends DefaultFormatter
This class provides implementation for HTML format output. Extend from DefaultFormatter, this class provide additional support for BufferedImage.
Since:
Jul 2, 2007
  • Constructor Details

    • HTMLFormatter

      public HTMLFormatter(Properties properties)
      Create a HTML formatter with specific properties.
      Parameters:
      properties - template properties
  • Method Details

    • format

      public Object format(Object value)
      Convert an Object value into HTML format.
      Specified by:
      format in interface IFormatter
      Overrides:
      format in class DefaultFormatter
      Parameters:
      value - converting value
      Returns:
      object in default format.
    • createImage

      protected ITool.RetainedString createImage(Image image) throws IOException
      Create a HTML image string from given Image object.
      Parameters:
      image - an Image object
      Returns:
      The String in HTML image format.
      Throws:
      IOException - when IO error occurs
    • createImage

      protected ITool.RetainedString createImage(Image image, int width, int height, String flag) throws IOException
      Create a HTML image string from given Image object.
      Parameters:
      image - an Image object
      width - the target image width
      height - the target image height
      flag - scaling image flag
      Returns:
      The String in HTML image format.
      Throws:
      IOException - when IO error occurs
    • createBookmark

      protected ITool.RetainedString createBookmark(Bookmark bookmark) throws IOException
      Create a HTML bookmark string from given Bookmark object.
      Parameters:
      bookmark - an Bookmark object
      Returns:
      The String in HTML bookmark format.
      Throws:
      IOException - when IO error occurs
    • createLink

      protected ITool.RetainedString createLink(Link link) throws IOException
      Create a HTML link string from given Link object.
      Parameters:
      link - an Link object
      Returns:
      The String in HTML link format.
      Throws:
      IOException - when IO error occurs