|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.actf.core.config.AbstractConfiguration
public class AbstractConfiguration
serves as a general-purpose implementation of the Configuration interface. In particular, this class manages the overall pool of ids and the key-value pairs (parameters) to which each id corresponds.
Note: Clients should extend this class rather than implementing Configuration
to avoid API modifications.
Field Summary | |
---|---|
Map |
_configMap
|
protected String |
_curPool
|
Fields inherited from interface org.eclipse.actf.core.config.IConfiguration |
---|
ACTF_ID, ALIASES_ID, FILTER_CLASSNAME_ATTRIBUTE, FILTER_ID, FILTER_MODEL_ATTRIBUTE, FILTER_NODEIDS_ATTRIBUTE, FILTER_NODENAMES_ATTRIBUTE, FILTER_NODETYPES_ATTRIBUTE, MODEL_ADAPTOR_FACTORY, MODEL_BASE_TYPE, MODEL_ID, MODEL_IGNOREIDS, MODEL_IGNORENODENAMES, MODEL_LOCATOR, MODEL_LOCATORIDS_POOL, MODEL_POOL_ID_DELIMITER, SHOW_INVISIBLE_KEY, SHOW_ITEMS_KEY, TRACE_LEVEL_KEY, TRACE_STREAM_KEY, WORKING_DIR_KEY |
Constructor Summary | |
---|---|
AbstractConfiguration()
create a Configuration. |
Method Summary | |
---|---|
void |
addConfigurationData(Object data)
default implementation for this method attempts to treat the data object as a map and simply adds it to the existing configuration map. |
void |
createSymbolPool(String id)
|
boolean |
getBooleanParameter(String key)
retrieve a boolean parameter from the current symbol pool |
Class |
getClassParameter(String key)
retrieve a class parameter from the current symbol pool |
double |
getDoubleParameter(String key)
retrieve a double parameter from the current symbol pool |
int |
getIntParameter(String key)
retrieve an int parameter from the current symbol pool |
String[] |
getModelTypes()
returns the model supported within this configuration object. |
Object |
getParameter(String key)
get a parameter of an undetermined type in the current symbol pool |
String |
getParameterAsString(String key)
get the parameter with the given key as a string |
String[] |
getParameterNames()
retrieve list of parameters from the current symbol pool |
String |
getStringParameter(String key)
retrieve a string parameter from the current symbol pool |
String |
getSymbolPool()
get the current symbol pool. |
Map |
getSymbolPoolContents(String poolID)
get the contents of the specified symbol pool |
String[] |
getSymbolPools()
get all available symbol pools. |
void |
setParameter(String key,
boolean value)
set a boolean parameter in the current symbol pool |
void |
setParameter(String key,
Class value)
set a class parameter in the current symbol pool |
void |
setParameter(String key,
double value)
set a double parameter in the current symbol pool |
void |
setParameter(String key,
int value)
set an int parameter in the current symbol pool |
void |
setParameter(String key,
Object value)
set a parameter of an undetermined type in the current symbol pool |
void |
setParameter(String key,
String value)
set a string parameter in the current symbol pool |
void |
setParameter(String poolID,
String name,
Object val)
convenience method to set any parameter in the configuration. |
void |
setSymbolPool(String id)
set the symbol pool to be used in subsequent set/getParameter calls. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public Map _configMap
protected String _curPool
Constructor Detail |
---|
public AbstractConfiguration()
RuntimeContextFactory
Method Detail |
---|
public Map getSymbolPoolContents(String poolID)
getSymbolPoolContents
in interface IConfiguration
poolID
- -
id of symbol pool
null
if pool
does not existIConfiguration.setSymbolPool(String)
public void setSymbolPool(String id)
Symbol pool ids can have two forms:
<modelName>MODEL_POOL_ID_DELIMITER
<poolId>
The symbol pool is the pool that is queried for all get/setXXXParameter methods. Thus, this method should always be called prior to a set/getXXXParameter method to insure that the correct pool is being accessed.
setSymbolPool
in interface IConfiguration
id
- -
id of symbol poolpublic void createSymbolPool(String id)
public String getSymbolPool()
getSymbolPool
in interface IConfiguration
IConfiguration.setSymbolPool(String)
public String[] getSymbolPools()
getSymbolPools
in interface IConfiguration
IConfiguration.setSymbolPool(String)
public String[] getModelTypes()
Models are always introduced in the main symbol pool, ACTF_ID
and
should be retrieved via the MODEL_ID
symbol pool. Indeed, this method will usually be short-hand for:
setSymbolPool(MODEL_ID); return getParameterNames();
getModelTypes
in interface IConfiguration
IConfiguration.getParameterNames()
,
IConfiguration.setSymbolPool(String)
public void setParameter(String key, Object value)
setParameter
in interface IConfiguration
key
- -
name of parametervalue
- -
object corresponding to this keyIConfiguration.setSymbolPool(String)
public void setParameter(String key, String value)
setParameter
in interface IConfiguration
key
- -
name of parametervalue
- -
string value corresponding to this keyIConfiguration.setSymbolPool(String)
public void setParameter(String key, int value)
setParameter
in interface IConfiguration
key
- -
name of parametervalue
- -
int value corresponding to this keyIConfiguration.setSymbolPool(String)
public void setParameter(String key, double value)
setParameter
in interface IConfiguration
key
- -
name of parametervalue
- -
double value corresponding to this keyIConfiguration.setSymbolPool(String)
public void setParameter(String key, boolean value)
setParameter
in interface IConfiguration
key
- -
name of parametervalue
- -
boolean value corresponding to this keyIConfiguration.setSymbolPool(String)
public void setParameter(String key, Class value)
setParameter
in interface IConfiguration
key
- -
name of parametervalue
- -
Class object corresponding to this keyIConfiguration.setSymbolPool(String)
public void setParameter(String poolID, String name, Object val)
poolID
- -
id of symbol pool in which set is to occurname
- -
name or id of parameter to setval
- -
value of parameterpublic Object getParameter(String key)
getParameter
in interface IConfiguration
key
- -
name of parameter to retrieve
IConfiguration.setSymbolPool(String)
public String getStringParameter(String key)
getStringParameter
in interface IConfiguration
key
- -
name or key of parameter
null
if no
such key existsIConfiguration.setSymbolPool(String)
public int getIntParameter(String key)
getIntParameter
in interface IConfiguration
key
- -
name or key of parameter
null
if no
such key existsIConfiguration.setSymbolPool(String)
public double getDoubleParameter(String key)
getDoubleParameter
in interface IConfiguration
key
- -
name or key of parameter
null
if no
such key existsIConfiguration.setSymbolPool(String)
public boolean getBooleanParameter(String key)
getBooleanParameter
in interface IConfiguration
key
- -
name or key of parameter
null
if
no such key existsIConfiguration.setSymbolPool(String)
public Class getClassParameter(String key)
getClassParameter
in interface IConfiguration
key
- -
name or key of parameter
null
if no
such key existsIConfiguration.setSymbolPool(String)
public String getParameterAsString(String key)
getParameterAsString
in interface IConfiguration
key
- -
key of desired parameter
null
if
parameter is not foundIConfiguration.setSymbolPool(String)
public void addConfigurationData(Object data) throws ConfigurationException
addConfigurationData
in interface IConfiguration
data
- configuration data
ConfigurationException
public String[] getParameterNames()
getParameterNames
in interface IConfiguration
IConfiguration.setSymbolPool(String)
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |