|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.monica.javacom.util.MJCInputStreamConfiguration
This class implements the MJConfiguration interface to provide customization possibility
for MJC classes. This class reads customization information from a file called MJC.conf,
which has to be located in the current directory.
The configuration file can have the following stucure:
keyword=valueValues can be Strings, ints, and booleans. Booleans are represented with the strings "true" and "false". These values can be referenced int he get methods of the MJCConfiguration with the id matching the keyword.
Field Summary | |
protected java.io.InputStream |
iS
|
Constructor Summary | |
MJCInputStreamConfiguration()
|
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()
Sets the MJCConfiguration for this object. |
java.lang.String |
getConfigurationVersion()
Returns the MJCConfiguration with which this object is customized. |
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. |
protected void |
post_init()
|
protected void |
pre_init()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.io.InputStream iS
Constructor Detail |
public MJCInputStreamConfiguration()
Method Detail |
protected void pre_init()
protected void post_init()
public java.lang.String getConfigurationName()
getConfigurationName
in interface MJCConfiguration
MJCConfiguration
- configuration: the MJCConfiguration
object for the customizationpublic java.lang.String getConfigurationVersion()
getConfigurationVersion
in interface MJCConfiguration
public int getInt(java.lang.String id) throws java.lang.Exception
getInt
in interface MJCConfiguration
String
- id: the required configuration idException:
- if the id is invalid or the id doesn't represent an
int valuepublic boolean getBoolean(java.lang.String id) throws java.lang.Exception
getBoolean
in interface MJCConfiguration
String
- id: the required configuration id
` @return boolean: the configuration boolean matching the configuration idException:
- if the id is invalid or the id doesn't represent a
boolean valuepublic java.lang.String getString(java.lang.String id) throws java.lang.Exception
getString
in interface MJCConfiguration
String
- id: the required configuration idException:
- if the id is invalid or the id doesn't represent a
String valuepublic int getInt(java.lang.String id, int def)
getInt
in interface MJCConfiguration
String
- id: the required configuration idint
- def: the specified default valuepublic boolean getBoolean(java.lang.String id, boolean def)
getBoolean
in interface MJCConfiguration
String
- id: the required configuration idboolean
- def: the specified default valuepublic java.lang.String getString(java.lang.String id, java.lang.String def)
getString
in interface MJCConfiguration
String
- id: the required configuration idboolean
- String: the specified default valuepublic int getIntFromStrings(java.lang.String id, java.lang.String[] possibilities, int[] values, int def)
getIntFromStrings
in interface MJCConfiguration
String
- id: the required configuration idString[]
- possibilities: possible Strings acceptable in the
configuration sourceint[]
- values: int values matching the possible Stringsint
- def: the dafault int that should be returned in case of
errors
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |