|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.filenet.api.util.ConfigurationParameters
public class ConfigurationParameters
Represents a group of parameters that define the behavior of the client API.
This class is a map of ConfigurationParameter
keys to Object
values. Instances are
initially empty; they are not pre-populated with default values.
Constructor Summary | |
---|---|
ConfigurationParameters()
Constructs an empty map of configuration parameters. |
|
ConfigurationParameters(ConfigurationParameters parameters)
Constructs a map of configuration parameters to Object values. |
Method Summary | |
---|---|
java.lang.Object |
getParameter(ConfigurationParameter parameter)
Retrieves a configured value. |
void |
loadMap(java.util.Map map)
Parses a map of key/value pairs into valid ConfigurationParameter keys
and Object values. |
java.lang.Object |
setParameter(ConfigurationParameter parameter,
java.lang.Object value)
Sets a configuration parameter. |
void |
setParameters(ConfigurationParameters parameters)
Sets the connection parameters specified in the parameters
argument. |
java.lang.String |
toString()
Returns a string representation of this instance. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ConfigurationParameters()
public ConfigurationParameters(ConfigurationParameters parameters)
Object
values. The
parameters are populated with the values specified in the input collection.
parameters
- A collection of ConfigurationParameter
objects.
Cannot be null
.Method Detail |
---|
public java.lang.Object getParameter(ConfigurationParameter parameter)
A returned value of null
indicates that no value has been explicitly configured
for the requested parameter and an appropriate default value for the parameter in question is used instead.
parameter
- The parameter for which the value is to be retrieved. See
ConfigurationParameter
.
Object
associated with the requested parameter value. If no
value has been configured for the requested parameter, this method returns null
.public java.lang.Object setParameter(ConfigurationParameter parameter, java.lang.Object value)
value
argument is null
, this method removes the value. Defaults are used for removed values.
parameter
- The configuration parameter value to set.value
- The value of the parameter to set, or null
.
EngineRuntimeException
- if the type or value of the object are
invalid.ExceptionCode.API_INVALID_CONFIGURATION_PARAMETER
public void setParameters(ConfigurationParameters parameters)
parameters
argument. Other connection parameters are unchanged. This is equivalent
to calling setParameter(parameter, value)
for each
parameter with a non-null
value in the parameters
argument.
parameters
- A ConnectionParameters
collection.
EngineRuntimeException
- if one or more
parameters are invalid.ExceptionCode.API_INVALID_CONFIGURATION_PARAMETER
public void loadMap(java.util.Map map)
ConfigurationParameter
keys
and Object
values. The resulting configuration values are used to populate this
ConfigurationParameters
class.
The standard java.util.Properties
class implements the Map
interface. A common usage of this method is to load a properties file into a Properties
object and call this method to parse the properties into valid configuration parameters.
Each key must be a ConfigurationParameter
or a String
. The
key is used as-is if it is already a ConfigurationParameter
; otherwise, the
String
is parsed for a valid ConfigurationParameter
string value.
All string comparisons and lookups are case-insensitive.
If a String
key does not start with "FileNet.", the key/value
pair is logged at the debug level but otherwise skipped and ignored. The entire key is
then used to look up the corresponding ConfigurationParameter
constant;
an exception is thrown if it is not found.
The value for a valid key is then parsed. If the value is already of the required type, it is used as-is; otherwise, it is transformed into one of the required types. The type of transformation depends on the parameter and type of value. An exception is thrown if the transformation fails. An exception is also thrown if the given or transformed valued is invalid for the parameter.
map
- A Java Map
object containing configuration key/value pairs. Cannot be null
public java.lang.String toString()
toString
in class java.lang.Object
String
representing the instance.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |