i2p.susi.dns

## Class BaseBean

- java.lang.Object
- - i2p.susi.dns.BaseBean

- Direct Known Subclasses:
    AddressbookBean, BlacklistBean, ConfigBean, LogBean, SubscriptionsBean

      public class BaseBean
      extends Object

  Holds methods common to several Beans.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected I2PAppContext` | `_context`
    `protected String` | `action`
    `protected String` | `lastSerial`
    `protected String` | `method`
    `static String` | `PROP_PW_ENABLE`
    `protected Properties` | `properties`
    `protected String` | `serial`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BaseBean()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected static String` | `_t(String s)` Translate a string.
    `protected static String` | `_t(String s, Object o)` Translate a string with one parameter.
    `protected static String` | `_t(String s, Object o, Object o2)` Translate a string with two parameters.
    `protected File` | `addressbookDir()` Returns the addressbook directory.
    `protected File` | `configFile()` Returns the config file.
    `protected void` | `debug(String msg)` Log a debug message.
    `String` | `getAction()` Returns the action.
    `String` | `getSerial()` Returns a new serial number.
    `String` | `getTheme()` Returns the theme path
    `String` | `getThemeName()` Returns the theme name
    `String[]` | `getThemes()` Get all themes
    `boolean` | `isOverrideCssActive()` Determine if a user-provided override.css file is active
    `protected void` | `loadConfig()` Loads the configuration if needed.
    `protected static String` | `ngettext(String s, String p, int n)` Translate a string with plural form (ngettext).
    `protected void` | `reload()` Reloads the configuration from file.
    `void` | `setAction(String action)` Sets the action.
    `void` | `setSerial(String serial)` Sets the serial.
    `void` | `storeMethod(String method)` Stores the HTTP method.
    `boolean` | `useSoraFont()` Checks if Sora font should be used.
    `protected void` | `warn(Throwable t)` Log a warning message.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### _context

          protected final I2PAppContext _context

    - #### action

          protected String action

    - #### lastSerial

          protected String lastSerial

    - #### method

          protected String method

    - #### PROP_PW_ENABLE

          public static final String PROP_PW_ENABLE

      See Also:
        Constant Field Values

    - #### properties

          protected final Properties properties

    - #### serial

          protected String serial

  - ### Constructor Detail

    - #### BaseBean

          public BaseBean()

  - ### Method Detail

    - #### _t

          protected static String _t(String s)

      Translate a string.
      Parameters:
        `s` - the string to translate
      Returns:
        the translated string

    - #### _t

          protected static String _t(String s,
                                     Object o)

      Translate a string with one parameter.
      Parameters:
        `s` - the string to translate
        `o` - the parameter
      Returns:
        the translated string

    - #### _t

          protected static String _t(String s,
                                     Object o,
                                     Object o2)

      Translate a string with two parameters.
      Parameters:
        `s` - the string to translate
        `o` - the first parameter
        `o2` - the second parameter
      Returns:
        the translated string

    - #### addressbookDir

          protected File addressbookDir()

      Returns the addressbook directory.
      Returns:
        the addressbook directory

    - #### configFile

          protected File configFile()

      Returns the config file.
      Returns:
        the config file

    - #### debug

          protected void debug(String msg)

      Log a debug message.
      Parameters:
        `msg` - the message to log

    - #### getAction

          public String getAction()

      Returns the action.
      Returns:
        the action

    - #### getSerial

          public String getSerial()

      Returns a new serial number.
      Returns:
        a new serial number

    - #### getTheme

          public String getTheme()

      Returns the theme path
      Returns:
        the theme path

    - #### getThemeName

          public String getThemeName()

      Returns the theme name
      Returns:
        the theme name

    - #### getThemes

          public String[] getThemes()

      Get all themes
      Returns:
        String[] -- Array of all the themes found.

    - #### isOverrideCssActive

          public boolean isOverrideCssActive()

      Determine if a user-provided override.css file is active
      Returns:
        true if override.css is active

    - #### loadConfig

          protected void loadConfig()

      Loads the configuration if needed.

    - #### ngettext

          protected static String ngettext(String s,
                                           String p,
                                           int n)

      Translate a string with plural form (ngettext).
      Parameters:
        `s` - the singular form
        `p` - the plural form
        `n` - the count
      Returns:
        the translated string

    - #### reload

          protected void reload()

      Reloads the configuration from file.

    - #### setAction

          public void setAction(String action)

      Sets the action.
      Parameters:
        `action` - the action to set

    - #### setSerial

          public void setSerial(String serial)

      Sets the serial.
      Parameters:
        `serial` - the serial to set

    - #### storeMethod

          public void storeMethod(String method)

      Stores the HTTP method.
      Parameters:
        `method` - the HTTP method to store

    - #### useSoraFont

          public boolean useSoraFont()

      Checks if Sora font should be used.
      Returns:
        true if Sora font is enabled

    - #### warn

          protected void warn(Throwable t)

      Log a warning message.
      Parameters:
        `t` - the throwable to log