Documentation of 'com.jstatcom.engine.ConfigHolder' Java class
ConfigHolder
com.jstatcom.engine

Class ConfigHolder



  • public final class ConfigHolder
    extends java.lang.Object
    This class is used by Engine instances to get all information that is necessary to run a specific engine. The types of configuration settings are defined in the ConfigKeys implementation for the underlying engine type. Instances of this class store information according to the respective configuration keys.

    For every engine type there exists only one instance of this class. Instances for engine types are created or referenced by the static factory method valueOf.

    All information is stored permanently in an XML file defined in the respective engine type.

    See Also:
    EngineTypes, ConfigKeys
    • Field Detail

      • ConfigHolder_XML

        public static final XmlFormat<ConfigHolder> ConfigHolder_XML
        XML format field for (de)serialization.
    • Method Detail

      • adjustConfig

        public void adjustConfig()
        Creates a dialog to change the configuration settings for the respective engine. It updates the XML configuration file if the changes were successful.
      • getConfig

        public java.lang.String getConfig(ConfigKeys key)
        Get a configuration value for a key.
        Parameters:
        key - that defines type of setting
        Returns:
        a string containing the setting associated with key or null if the key is not contained
        Throws:
        java.lang.IllegalArgumentException - if (key == null)
      • getConfigKeys

        public java.util.Set<ConfigKeys> getConfigKeys()
        Gets a Set of all available ConfigKeys.
        Returns:
        a set of all keys
      • getEngineType

        public final EngineTypes getEngineType()
        Returns the engine type associated with this.
        Returns:
        the engine type
      • setConfig

        public void setConfig(ConfigKeys configKey,
                              java.lang.String value)
        Set a key value pair to be stored by the config holder.
        Parameters:
        configKey - the key
        value - the value
        Throws:
        java.lang.IllegalArgumentException - if (configKey == null) or if configKey is not valid for the underlying engine type
      • valueOf

        public static ConfigHolder valueOf(EngineTypes engineType)
        Static initializer to return an instance of ConfigHolder. It parses the XML config file if it exists and tries to get all necessary configuration information. If the config file does not exist or if something is wrong with the settings, an input dialog is shown. The configuration file is updated if something has changed.
        Parameters:
        engineType - to define a specific engine
        Returns:
        the initialized instance
        Throws:
        java.lang.IllegalArgumentException - if (engineType == null)
        java.lang.IllegalStateException - if the user input dialog is cancelled but the settings are still invalid

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.