Class TextConverter

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.QuickInfoSupporter, adams.core.SizeOfHandler, Serializable

    public class TextConverter
    extends AbstractTwitterStatusConverter<String>
    A simple text converter.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -field <ID|USER_ID|USER_NAME|SOURCE|TEXT|CREATED|FAVORITED|RETWEET|RETWEET_COUNT|RETWEET_BY_ME|POSSIBLY_SENSITIVE|GEO_LATITUDE|GEO_LONGITUDE|LANGUAGE_CODE|PLACE|PLACE_TYPE|PLACE_URL|STREET_ADDRESS|COUNTRY|COUNTRY_CODE> [-field ...] (property: fields)
        The fields to use for generating the output.
        default: TEXT
     
    -separator <java.lang.String> (property: separator)
        The separator to use when generating strings as output; tab, new line, carriage 
        return and backslash need to be escaped, ie, '   ', '
        ', '
    ', '\'.
        default: \t
     
    -quote <boolean> (property: quote)
        If enabled all sub-strings are quoted if necessary when generating string 
        output.
        default: false
     
    -date-format <adams.data.DateFormatString> (property: dateFormat)
        The format for the dates.
        default: yyyy-MM-dd HH:mm:ss
        more: http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html
     
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Separator

        protected String m_Separator
        the separator, when generating a string.
      • m_Quote

        protected boolean m_Quote
        whether to quote strings.
      • m_DateFormat

        protected adams.data.DateFormatString m_DateFormat
        for format for dates.
    • Constructor Detail

      • TextConverter

        public TextConverter()
    • 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
      • setSeparator

        public void setSeparator​(String value)
        Sets the separator to use. \t, \n, \r, \\ must be quoted.
        Parameters:
        value - the separator
      • getSeparator

        public String getSeparator()
        Returns the separator in use. \t, \r, \n, \\ get returned quoted.
        Returns:
        the separator
      • separatorTipText

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

        public void setQuote​(boolean value)
        Sets whether to quote the sub-strings when generating string output.
        Parameters:
        value - if true then the sub-strings get quoted
      • getQuote

        public boolean getQuote()
        Returns whether to quote the sub-strings when generating string output.
        Returns:
        true if quoting enabled
      • quoteTipText

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

        public void setDateFormat​(adams.data.DateFormatString value)
        Sets the date format.
        Parameters:
        value - the separator
      • getDateFormat

        public adams.data.DateFormatString getDateFormat()
        Returns the current date format.
        Returns:
        the date format
      • dateFormatTipText

        public String dateFormatTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • 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 AbstractTwitterStatusConverter<String>
        Returns:
        null if no info available, otherwise short string