Interface ConfigurationParameter
- All Superinterfaces:
Cloneable
,MetaDataObject
,Serializable
,XMLizable
- All Known Implementing Classes:
ConfigurationParameter_impl
A configuration parameter consists of the following fields:
- Name
- Description
- Type (String, Boolean, Integer, Long, Float or Double)
- Is the parameter multi-valued?
- Is a value mandatory?
- Overrides (see below)
This interface does not provide access to the value of the parameter - that is a separate piece of metadata associated with the resource.
In an aggregate resource, configuration parameters may override component resources' parameters.
This is done by the overrides
property. Overrides should always be
specified for aggregate resources. If no overrides are specified, the default behavior is to
override any parameter with the same name in any component resource. However, this usage is
discouraged and will generate a warning in the log file; it exists for backwards compatibility
purposes.
As with all MetaDataObject
s, a ConfigurationParameter
may or may not be
modifiable. An application can find out by calling the MetaDataObject.isModifiable()
method.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Identifies the Boolean data type.static final String
Identifies the Double data type.static final String
Identifies the Float data type.static final String
Identifies the Integer data type.static final String
Identifies the Long data type.static final String
Identifies the String data type. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addOverride
(String aOverride) Adds an override to this configuration parameter.Retrieves the description of this configuration parameter.Retrieves the external name of this configuration parameter.getName()
Retrieves the name of this configuration parameter.String[]
Gets the parameters that are this parameter overrides.getType()
Retrieves the data type of this configuration parameter.boolean
Retrieves whether this parameter is mandatory.boolean
Retrieves whether this parameter is multi-valued.void
removeOverride
(String aOverride) Removes an override from this configuration parameter.void
setDescription
(String aDescription) Sets the description of this configuration parameter.void
setExternalOverrideName
(String aExternalOverrideName) Sets the external name of this configuration parameter.void
setMandatory
(boolean aMandatory) Sets whether this parameter is mandatory.void
setMultiValued
(boolean aMultiValued) Sets whether this parameter is multi-valued.void
Sets the name of this configuration parameter.void
setOverrides
(String[] aOverrides) Sets the parameters that are this parameter overrides.void
Sets the data type of this configuration parameter.Methods inherited from interface org.apache.uima.resource.metadata.MetaDataObject
clone, equals, getAttributeValue, getSourceUrl, getSourceUrlString, isModifiable, listAttributes, setAttributeValue, setSourceUrl
Methods inherited from interface org.apache.uima.util.XMLizable
buildFromXMLElement, buildFromXMLElement, toXML, toXML, toXML, toXML
-
Field Details
-
TYPE_STRING
Identifies the String data type. Values of the parameter will be of type java.lang.String.- See Also:
-
TYPE_BOOLEAN
Identifies the Boolean data type. Values of the parameter will be of type java.lang.Boolean.- See Also:
-
TYPE_INTEGER
Identifies the Integer data type. Values of the parameter will be of type java.lang.Integer.- See Also:
-
TYPE_LONG
Identifies the Long data type. Values of the parameter will be of type java.lang.Long.- See Also:
-
TYPE_FLOAT
Identifies the Float data type. Values of the parameter will be of type java.lang.Float.- See Also:
-
TYPE_DOUBLE
Identifies the Double data type. Values of the parameter will be of type java.lang.Double.- See Also:
-
-
Method Details
-
getName
String getName()Retrieves the name of this configuration parameter.- Returns:
- the name of this configuration parameter.
-
setName
Sets the name of this configuration parameter.- Parameters:
aName
- the name of this configuration parameter.- Throws:
UIMA_UnsupportedOperationException
- if this object is not modifiable
-
getExternalOverrideName
String getExternalOverrideName()Retrieves the external name of this configuration parameter.- Returns:
- the external name of this configuration parameter.
-
setExternalOverrideName
Sets the external name of this configuration parameter.- Parameters:
aExternalOverrideName
- the external name of this configuration parameter.- Throws:
UIMA_UnsupportedOperationException
- if this object is not modifiable
-
getDescription
String getDescription()Retrieves the description of this configuration parameter.- Returns:
- the description of this configuration parameter.
-
setDescription
Sets the description of this configuration parameter.- Parameters:
aDescription
- the description of this configuration parameter.- Throws:
UIMA_UnsupportedOperationException
- if this object is not modifiable
-
getType
String getType()Retrieves the data type of this configuration parameter.- Returns:
- the data type of this configuration parameter. This will be one of the TYPE constants defined on this interface.
-
setType
Sets the data type of this configuration parameter.- Parameters:
aType
- the data type of this configuration parameter. This must be one of the TYPE constants defined on this interface.- Throws:
UIMA_IllegalArgumentException
- ifaType
is not a valid data type defined by a TYPE constant on this interface.UIMA_UnsupportedOperationException
- if this object is not modifiable
-
isMultiValued
boolean isMultiValued()Retrieves whether this parameter is multi-valued. Multi-valued parameters take an array of values, each of which must be of the appropriate data type.- Returns:
- true if and only if this parameter is multi-valued.
-
setMultiValued
void setMultiValued(boolean aMultiValued) Sets whether this parameter is multi-valued. Multi-valued parameters take an array of values, each of which must be of the appropriate data type.- Parameters:
aMultiValued
- true if and only if this parameter is multi-valued.- Throws:
UIMA_UnsupportedOperationException
- if this object is not modifiable
-
isMandatory
boolean isMandatory()Retrieves whether this parameter is mandatory.- Returns:
- true if and only if this parameter is mandatory.
-
setMandatory
void setMandatory(boolean aMandatory) Sets whether this parameter is mandatory.- Parameters:
aMandatory
- true if and only if this parameter is mandatory.- Throws:
UIMA_UnsupportedOperationException
- if this object is not modifiable
-
getOverrides
String[] getOverrides()Gets the parameters that are this parameter overrides. This is used for aggregate resources only. Overrides are expressed as strings of the form componentName/
parameterName. For example the overridesannotator1/parameter1
would override the parameter namedparameter1
within the component namedannotator1
.- Returns:
- the parameters this this parameter overrides
-
setOverrides
Sets the parameters that are this parameter overrides. This is used for aggregate resources only. Overrides are expressed as strings of the form componentName/
parameterName. For example the overridesannotator1/parameter1
would override the parameter namedparameter1
within the component namedannotator1
.- Parameters:
aOverrides
- the parameters this this parameter overrides
-
addOverride
Adds an override to this configuration parameter.- Parameters:
aOverride
- the override to add- Throws:
UIMA_UnsupportedOperationException
- if this object is not modifiable- See Also:
-
removeOverride
Removes an override from this configuration parameter.- Parameters:
aOverride
- the override to remove. Must equal (via the equals() method) one of the overrides on this parameter, or this method will do nothing.- Throws:
UIMA_UnsupportedOperationException
- if this object is not modifiable- See Also:
-