Klasse UtilProperties

Alle implementierten Schnittstellen:
Serializable, Cloneable, Map<Object,Object>

public final class UtilProperties extends Properties
This singleton contains all properties including those of modules that use this one.
Siehe auch:
  • Felddetails

    • isWindows

      public static final boolean isWindows
      Is this program running under Windows?
    • PROP

      public static final UtilProperties PROP
      The singleton.
    • sysEditor

      public static final String sysEditor
      The editor (depending on operating system) that is always available.
    • propFile

      final File propFile
      The file where the properties are stored.
  • Methodendetails

    • nls

      static String nls(String msgTemplate, Object... msgParms)
      To create NLS enabled dialogs
      Parameter:
      msgTemplate - key with placeholders (%1$s, ...)
      msgParms - values for the placeholders
      Gibt zurück:
      the text in natural language (e. g. en, de)
    • edit

      void edit(boolean isInBatchPhase)
      Edit the properties file.
      Parameter:
      isInBatchPhase - in batch phase do not display the dialog
    • getBoolean

      public boolean getBoolean(KeyAble keyAble)
      Get a boolean property
      Parameter:
      keyAble - used as key of the property
      Gibt zurück:
      the property as a boolean, false if it does not exist
    • getBoolean

      public boolean getBoolean(String key)
      Get a boolean property
      Parameter:
      key - (string) of the property
      Gibt zurück:
      the property as a boolean, false if it does not exist
    • getDouble

      public double getDouble(KeyAble keyAble) throws UtilException
      Get a double property.
      Parameter:
      keyAble - used as key of the property
      Gibt zurück:
      the property as a double
      Löst aus:
      UtilException - if the value does not exist or is not a double
    • getDouble

      public double getDouble(String key) throws UtilException
      Get a double property.
      Parameter:
      key - of the property
      Gibt zurück:
      the property as a double
      Löst aus:
      UtilException - if the value does not exist or is not a double
    • getTimeDiff

      public TimeDiff getTimeDiff(KeyAble keyAble) throws UtilException
      Get a TimeDiff property.
      Parameter:
      keyAble - as key of the property
      Gibt zurück:
      the property as a double
      Löst aus:
      UtilException - if the value does not exist or is not a double with units (ms, s, ...)
    • getTimeDiff

      public TimeDiff getTimeDiff(String key) throws UtilException
      Get a TimeDiff property.
      Parameter:
      key - of the property
      Gibt zurück:
      the property as a double
      Löst aus:
      UtilException - if the value does not exist or is not a double with units (ms, s, ...)
    • getInt

      public int getInt(KeyAble keyAble) throws UtilException
      Get an integer property.
      Parameter:
      keyAble - used as key of the property
      Gibt zurück:
      the property as a double
      Löst aus:
      UtilException - if the value does not exist or is not an integer
    • getLevel

      public Level getLevel(KeyAble keyAble) throws UtilException
      Get a message level property.
      Parameter:
      keyAble - used as key of the property
      Gibt zurück:
      the property as a double
      Löst aus:
      UtilException - if the value does not exist or is not an integer
    • getLong

      public long getLong(KeyAble keyAble) throws UtilException
      Get an long property.
      Parameter:
      keyAble - used as key of the property
      Gibt zurück:
      the property as a long
      Löst aus:
      UtilException - if the value does not exist or is not an integer
    • getProperty

      public String getProperty(KeyAble keyAble)
      Get a string property.
      Parameter:
      keyAble - used as key of the property
      Gibt zurück:
      the property as a string
    • getPropFile

      File getPropFile()
      Get the file where the properties are stored.
      Gibt zurück:
      the properties file
    • load

      void load()
      Load the properties from the properties file and check them.
    • put

      public void put(KeyAble keyAble, Object value)
      Put a property by using a KeyAble (i. e. a Setting) as key
      Parameter:
      keyAble - used as key
      value - the property value
    • put

      public Object put(Object key, Object value)
      Put the property. If it has been changed, mark that it must be stored.
      Angegeben von:
      put in Schnittstelle Map<Object,Object>
      Setzt außer Kraft:
      put in Klasse Properties
      Parameter:
      key - the key (always a string)
      value - (allways a string)
    • putBoolean

      public void putBoolean(KeyAble itemKeyAble, boolean value)
      Put a boolean property.
      Parameter:
      itemKeyAble - a setting used as key
      value - the boolean value
    • putDefaults

      public void putDefaults(KeyAble[] keyAbles)
      For every entry not read from property file replace missing values by defaults. Ignore KeyAbles with default=null.
      Parameter:
      keyAbles - the array of settings
    • putIfEmpty

      public boolean putIfEmpty(KeyAble keyAble, Object value)
      Put a property if it has no value.
      Parameter:
      keyAble - the Setting (enum) of the property. The Setting is the property's name.
      value - the value which may have type String, Boolean, or Double.
      Gibt zurück:
      if the value has been changed.
    • setCheckPred

      public void setCheckPred(Predicate<PropertyEntry> checkPred)
      The predicate for checking the type and values is assigned in the start method and depends on the application.
      Parameter:
      checkPred - predicate function to be assigned
    • store

      void store()
      Store the properties in the properties file.
    • verbose

      public boolean verbose()
      There is a property for additional log output.
      Gibt zurück:
      true if more log output is wanted.