public class CommonMachineConfig extends Object
Modifier and Type | Field and Description |
---|---|
static int |
CMC_PORT |
static String |
COUNT_PREFIX |
static String |
DELIMITER |
static String |
REMOVE_PREFIX |
static String |
SET_PREFIX |
Modifier and Type | Method and Description |
---|---|
Object |
addLocalConfig(String rootFile)
The controller uses this to add project-level configuration to the system.
|
String |
configValue(String key)
Public entry to the CommonMachineConfig object.
|
int |
configValueCount(String key)
Public entry to the CommonMachineConfig object.
|
String[] |
configValues(String key)
public entry to the CommonMachineConfig object.
|
static CommonMachineConfig |
instance()
Return an instance of CommonMachineConfig which is the only one on the machine.
|
static CommonMachineConfig |
instance(String implementer,
String rootFile)
Return an instance of CommonMachineConfig which is the only one on the machine.
|
int |
num(String key)
Alternate name for configValueCount() method in the interest of code readability
|
void |
removeLocalConfig(Object key)
Controller uses this to remove project-level config.
|
void |
removeVal(String key)
Remove a configuration property
|
void |
setVal(String key,
String val)
Write a configuration value back to XML
|
static CommonMachineConfig |
soleInstance()
Return an instance of CommonMachineConfig which is the only one on the machine.
|
static CommonMachineConfig |
soleInstance(String rootFile)
Return an instance of CommonMachineConfig which is the only one on the machine.
|
String |
val(String key)
Alternate name for configValue() method, in the interest of code readability
|
String[] |
vals(String key)
Alternate name for configValues() method, in the interest of code readability
|
public static final int CMC_PORT
public static final String COUNT_PREFIX
public static final String SET_PREFIX
public static final String REMOVE_PREFIX
public static final String DELIMITER
public static CommonMachineConfig soleInstance() throws Exception
Exception
- Thrown if a previously-instantiated instance has been detectedpublic static CommonMachineConfig soleInstance(String rootFile) throws Exception
rootFile
- Master XML file listing other XML filesException
- Thrown if a previously-instantiated instance has been detectedpublic static CommonMachineConfig instance()
public static CommonMachineConfig instance(String implementer, String rootFile)
implementer
- rootFile
- public String configValue(String key)
key
- the key to any value(s)public String val(String key)
key
- the key for the held valuepublic void setVal(String key, String val)
key
- val
- public void removeVal(String key)
key
- public String[] configValues(String key)
key
- the key for the desired valuespublic String[] vals(String key)
key
- public int configValueCount(String key)
key
- public int num(String key)
key
- public Object addLocalConfig(String rootFile) throws Exception
rootFile
- path to the root xml file (I.e., "commonsConfig.xml")Exception
- if error configuring xml files.public void removeLocalConfig(Object key)
key
- obtained from @see addLocalConfig