Class SpreadSheetToHTML

  • All Implemented Interfaces:
    adams.core.AdditionalInformationHandler, adams.core.CleanUpHandler, adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.QuickInfoSupporter, adams.core.ShallowCopySupporter<adams.data.conversion.AbstractConversion>, adams.core.SizeOfHandler, adams.core.Stoppable, adams.data.conversion.Conversion, Serializable

    public class SpreadSheetToHTML
    extends adams.data.conversion.AbstractConversion
    Turns a spreadsheet into an HTML table.

    Valid options are:

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -title <java.lang.String> (property: title)
        The title to use for the HTML title tag.
        default: 
     
    -html-before-table <adams.core.base.HtmlCode> (property: htmlBeforeTable)
        The HTML code to inject before the table.
        default: 
     
    -html-after-table <adams.core.base.HtmlCode> (property: htmlAfterTable)
        The HTML code to inect after the table.
        default: 
     
    -only-table-code <boolean> (property: onlyTableCode)
        If enabled, only the table code gets generated without surrounding body/
        html tags.
        default: false
     
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected HtmlCode m_HtmlAfterTable
      the HTML code to inject after the table.
      protected HtmlCode m_HtmlBeforeTable
      the HTML code to inject before the table.
      protected boolean m_OnlyTableCode
      whether to generate only table code.
      protected String m_Title
      the title to use.
      • Fields inherited from class adams.data.conversion.AbstractConversion

        m_Input, m_Output, m_Owner, m_Stopped
      • Fields inherited from class adams.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • Field Detail

      • m_Title

        protected String m_Title
        the title to use.
      • m_HtmlBeforeTable

        protected HtmlCode m_HtmlBeforeTable
        the HTML code to inject before the table.
      • m_HtmlAfterTable

        protected HtmlCode m_HtmlAfterTable
        the HTML code to inject after the table.
      • m_OnlyTableCode

        protected boolean m_OnlyTableCode
        whether to generate only table code.
    • Constructor Detail

      • SpreadSheetToHTML

        public SpreadSheetToHTML()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.core.option.AbstractOptionHandler
        Returns:
        a description suitable for displaying in the gui
      • defineOptions

        public void defineOptions()
        Adds options to the internal list of options.
        Specified by:
        defineOptions in interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class adams.core.option.AbstractOptionHandler
      • getQuickInfo

        public String getQuickInfo()
        Returns a quick info about the actor, which will be displayed in the GUI.
        Specified by:
        getQuickInfo in interface adams.core.QuickInfoSupporter
        Overrides:
        getQuickInfo in class adams.data.conversion.AbstractConversion
        Returns:
        null if no info available, otherwise short string
      • setTitle

        public void setTitle​(String value)
        Sets the HTML title.
        Parameters:
        value - the title for the HTML page
      • getTitle

        public String getTitle()
        Returns the HTML title.
        Returns:
        the title of the HTML page
      • titleTipText

        public String titleTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setHtmlBeforeTable

        public void setHtmlBeforeTable​(HtmlCode value)
        Sets the HTML code to inject before the table.
        Parameters:
        value - the HTML code
      • getHtmlBeforeTable

        public HtmlCode getHtmlBeforeTable()
        Returns the HTML code to inject before the table.
        Returns:
        the HTML code
      • htmlBeforeTableTipText

        public String htmlBeforeTableTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setHtmlAfterTable

        public void setHtmlAfterTable​(HtmlCode value)
        Sets the HTML code to inject after the table.
        Parameters:
        value - the HTML code
      • getHtmlAfterTable

        public HtmlCode getHtmlAfterTable()
        Returns the HTML code to inject after the table.
        Returns:
        the HTML code
      • htmlAfterTableTipText

        public String htmlAfterTableTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setOnlyTableCode

        public void setOnlyTableCode​(boolean value)
        Sets whether to omit surrounding body/html tags.
        Parameters:
        value - true if to omit html/body tags
      • getOnlyTableCode

        public boolean getOnlyTableCode()
        Returns whether to omit surrounding body/html tags.
        Returns:
        true if to omit html/body tags
      • onlyTableCodeTipText

        public String onlyTableCodeTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • accepts

        public Class accepts()
        Returns the class that is accepted as input.
        Specified by:
        accepts in interface adams.data.conversion.Conversion
        Specified by:
        accepts in class adams.data.conversion.AbstractConversion
        Returns:
        the class
      • generates

        public Class generates()
        Returns the class that is generated as output.
        Specified by:
        generates in interface adams.data.conversion.Conversion
        Specified by:
        generates in class adams.data.conversion.AbstractConversion
        Returns:
        the class
      • doConvert

        protected Object doConvert()
                            throws Exception
        Performs the actual conversion.
        Specified by:
        doConvert in class adams.data.conversion.AbstractConversion
        Returns:
        the converted data
        Throws:
        Exception - if something goes wrong with the conversion