com.monica.javacom.interfaces
Interface MJCConfiguration

All Known Implementing Classes:
MJCInputStreamConfiguration

public interface MJCConfiguration

This interface is responsible for the configuration of objects in the MJC layer hierarchy. Configuration sources can be of any kind, the main thing is that the classes can get configuration data of common way.


Method Summary
 boolean getBoolean(java.lang.String id)
          Returns a boolean configuraton value for the specified configuration id.
 boolean getBoolean(java.lang.String id, boolean def)
          Returns a boolean configuraton value for the specified configuration id.
 java.lang.String getConfigurationName()
          Returns the MJC name of the MJCConfiguration.
 java.lang.String getConfigurationVersion()
          Returns the MJC version of the MJCConfiguration.
 int getInt(java.lang.String id)
          Retuns an int configuration value for the specified configuration id.
 int getInt(java.lang.String id, int def)
          Returns an int configuraton value for the specified configuration id.
 int getIntFromStrings(java.lang.String id, java.lang.String[] possibilities, int[] values, int def)
          Useable if String possible values in the configuration source should be mapped into ints as configuration values.
 java.lang.String getString(java.lang.String id)
          Returns a String configuraton value for the specified configuration id.
 java.lang.String getString(java.lang.String id, java.lang.String def)
          Returns a String configuraton value for the specified configuration id.
 

Method Detail

getInt

public int getInt(java.lang.String id)
           throws java.lang.Exception
Retuns an int configuration value for the specified configuration id.
Parameters:
String - id: the required configuration id
Returns:
int: the configuration int matching the configuration id
Throws:
Exception: - if the id is invalid or the id doesn't represent an int value

getBoolean

public boolean getBoolean(java.lang.String id)
                   throws java.lang.Exception
Returns a boolean configuraton value for the specified configuration id.
Parameters:
String - id: the required configuration id ` @return boolean: the configuration boolean matching the configuration id
Throws:
Exception: - if the id is invalid or the id doesn't represent a boolean value

getString

public java.lang.String getString(java.lang.String id)
                           throws java.lang.Exception
Returns a String configuraton value for the specified configuration id.
Parameters:
String - id: the required configuration id
Returns:
String: the configuration String matching the configuration id
Throws:
Exception: - if the id is invalid or the id doesn't represent a String value

getInt

public int getInt(java.lang.String id,
                  int def)
Returns an int configuraton value for the specified configuration id. Should call the getInt(String) method of this interface and if there was an exception, returns the specified default value.
Parameters:
String - id: the required configuration id
int - def: the specified default value
Returns:
int: the configuration int matching the configuration id or if there was an exception then the default int

getBoolean

public boolean getBoolean(java.lang.String id,
                          boolean def)
Returns a boolean configuraton value for the specified configuration id. Should call the getBoolean(String) method of this interface and if there was an exception, returns the specified default value.
Parameters:
String - id: the required configuration id
boolean - def: the specified default value
Returns:
boolean: the configuration boolean matching the configuration id or if there was an exception then the default boolean

getString

public java.lang.String getString(java.lang.String id,
                                  java.lang.String def)
Returns a String configuraton value for the specified configuration id. Should call the getString(String) method of this interface and if there was an exception, returns the specified default value.
Parameters:
String - id: the required configuration id
boolean - String: the specified default value
Returns:
boolean: the configuration String matching the configuration id or if there was an exception then the default String

getIntFromStrings

public int getIntFromStrings(java.lang.String id,
                             java.lang.String[] possibilities,
                             int[] values,
                             int def)
Useable if String possible values in the configuration source should be mapped into ints as configuration values. If there is a problem retrieving the int returned, the default value will be returned.
Parameters:
String - id: the required configuration id
String[] - possibilities: possible Strings acceptable in the configuration source
int[] - values: int values matching the possible Strings
int - def: the dafault int that should be returned in case of errors
Returns:
int: the int value matching the found possibility String of the def int

getConfigurationName

public java.lang.String getConfigurationName()
Returns the MJC name of the MJCConfiguration.
Returns:
String: the MJC name of the MJCConfiguration

getConfigurationVersion

public java.lang.String getConfigurationVersion()
Returns the MJC version of the MJCConfiguration.
Returns:
String: the MJC version of the MJCConfiguration