Interface ConfigurationParameterDeclarations
- All Superinterfaces:
Cloneable,MetaDataObject,Serializable,XMLizable
- All Known Implementing Classes:
ConfigurationParameterDeclarations_impl
The declarations of configuration parameters in a Resource. A Resource can either declare a
single list of
ConfigurationParameters or a list of ConfigurationGroups, where
each group can contain a list of parameters. When groups are used, the Resource can also declare
a list of common parameters shared by all groups.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringA value for thesearchStrategyproperty indicating that if there is no value declared in a group, look in thedefault group.static final StringA value for thesearchStrategyproperty that is useful when ISO language and country codes are used as configuration group names.static final StringA value for thesearchStrategyproperty indicating that there is no fallback. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCommonParameter(ConfigurationParameter aConfigurationParameter) Adds a Configuration Parameter that is common to all groups.voidaddConfigurationGroup(ConfigurationGroup aConfigurationGroup) Adds a Configuration Group.voidaddConfigurationParameter(ConfigurationParameter aConfigurationParameter) Adds a Configuration Parameter that is not in any group.Gets the configuration parameters that are common to all groups.getConfigurationGroupDeclarations(String aGroupName) Gets the declarations of a named configuration group.Gets the configuration parameter groups for this Resource.getConfigurationParameter(String aGroupName, String aParamName) Gets a configuration parameter.Gets the configuration parameters for this Resource.Gets the name of the default configuration group.Gets the configuration parameter search strategy.voidremoveCommonParameter(ConfigurationParameter aConfigurationParameter) Removes an Configuration Parameter that is common to all groups.voidremoveConfigurationGroup(ConfigurationGroup aConfigurationGroup) Removes an Configuration GroupvoidremoveConfigurationParameter(ConfigurationParameter aConfigurationParameter) Removes an Configuration Parameter that is not in any group.voidsetCommonParameters(ConfigurationParameter[] aParams) Sets the configuration parameters that are common to all groups.voidsetConfigurationGroups(ConfigurationGroup[] aGroups) Sets the configuration parameter groups for this Resource.voidsetConfigurationParameters(ConfigurationParameter[] aParams) Sets the configuration parameters for this Resource.voidsetDefaultGroupName(String aGroupName) Sets the name of the default configuration group.voidsetSearchStrategy(String aStrategy) Sets the configuration parameter search strategy.Methods inherited from interface org.apache.uima.resource.metadata.MetaDataObject
clone, equals, getAttributeValue, getSourceUrl, getSourceUrlString, isModifiable, listAttributes, setAttributeValue, setSourceUrlMethods inherited from interface org.apache.uima.util.XMLizable
buildFromXMLElement, buildFromXMLElement, toXML, toXML, toXML, toXML
-
Field Details
-
SEARCH_STRATEGY_NONE
A value for thesearchStrategyproperty indicating that there is no fallback. If a request is made for the value of a parameter in a group and there is no such value in that exact group,nullwill be returned.- See Also:
-
SEARCH_STRATEGY_DEFAULT_FALLBACK
A value for thesearchStrategyproperty indicating that if there is no value declared in a group, look in thedefault group.- See Also:
-
SEARCH_STRATEGY_LANGUAGE_FALLBACK
A value for thesearchStrategyproperty that is useful when ISO language and country codes are used as configuration group names. If there is no value declared in a group, look in more general groups. The fallback sequence islang-country-region -%gt; lang-country -%gt; lang -%gt; default. For example, if a request is made for the value of a parameter in the "en-GB" group and no such group exists, the value from the "en" group will be used instead.- See Also:
-
-
Method Details
-
getConfigurationParameters
ConfigurationParameter[] getConfigurationParameters()Gets the configuration parameters for this Resource. This gets configuration parameters that are not defined within a group - see alsogetConfigurationGroups().- Returns:
- an array containing
ConfigurationParameterobjects, each of which describes a configuration parameter for this Resource.
-
setConfigurationParameters
Sets the configuration parameters for this Resource. This sets the configuration parameters that are not defined within groups - see alsosetConfigurationGroups(ConfigurationGroup[]).- Parameters:
aParams- an array containingConfigurationParameterobjects, each of which describes a configuration parameter for this Resource.- Throws:
UIMA_UnsupportedOperationException- if this object is not modifiable
-
addConfigurationParameter
Adds a Configuration Parameter that is not in any group.- Parameters:
aConfigurationParameter- the Configuration Parameter to add- Throws:
UIMA_UnsupportedOperationException- if this object is not modifiable
-
removeConfigurationParameter
Removes an Configuration Parameter that is not in any group.- Parameters:
aConfigurationParameter- the Configuration Parameter to remove (must be == with an ConfigurationParameter in this collection, or this method will do nothing).- Throws:
UIMA_UnsupportedOperationException- if this object is not modifiable
-
getConfigurationGroups
ConfigurationGroup[] getConfigurationGroups()Gets the configuration parameter groups for this Resource.- Returns:
- an array containing
ConfigurationGroupobjects, each of which describes a configuration parameter group for this Resource.
-
setConfigurationGroups
Sets the configuration parameter groups for this Resource.- Parameters:
aGroups- an array containingConfigurationGroupobjects, each of which describes a configuration parameter group for this Resource.- Throws:
UIMA_UnsupportedOperationException- if this object is not modifiable
-
addConfigurationGroup
Adds a Configuration Group.- Parameters:
aConfigurationGroup- the Configuration Group to add- Throws:
UIMA_UnsupportedOperationException- if this object is not modifiable
-
removeConfigurationGroup
Removes an Configuration Group- Parameters:
aConfigurationGroup- the Configuration Group to remove (must be == with an ConfigurationGroup defined on this resource, or this method will do nothing).- Throws:
UIMA_UnsupportedOperationException- if this object is not modifiable
-
getCommonParameters
ConfigurationParameter[] getCommonParameters()Gets the configuration parameters that are common to all groups. This property is only meaningful if at least one group is defined.- Returns:
- an array containing
ConfigurationParameterobjects, each of which describes a parameter common to all groups.
-
setCommonParameters
Sets the configuration parameters that are common to all groups. This property is only meaningful if at least one group is defined.- Parameters:
aParams- an array containingConfigurationParameterobjects, each of which describes a parameter common to all groups.
-
addCommonParameter
Adds a Configuration Parameter that is common to all groups.- Parameters:
aConfigurationParameter- the Configuration Parameter to add- Throws:
UIMA_UnsupportedOperationException- if this object is not modifiable
-
removeCommonParameter
Removes an Configuration Parameter that is common to all groups.- Parameters:
aConfigurationParameter- the Configuration Parameter to remove (must be == with an ConfigurationParameter in this collection, or this method will do nothing).- Throws:
UIMA_UnsupportedOperationException- if this object is not modifiable
-
getDefaultGroupName
String getDefaultGroupName()Gets the name of the default configuration group. This must refer to the names of theconfiguration groups.- Returns:
- the name of the default configuration group
-
setDefaultGroupName
Sets the name of the default configuration group. This must refer to the names of theconfiguration groups.- Parameters:
aGroupName- the name of the default configuration group
-
getSearchStrategy
String getSearchStrategy()Gets the configuration parameter search strategy. Valid values for this property are defined by constants on this interface.- Returns:
- the configuration parameter search strategy
-
setSearchStrategy
Sets the configuration parameter search strategy. Valid values for this property are defined by constants on this interface.- Parameters:
aStrategy- the configuration parameter search strategy
-
getConfigurationParameter
Gets a configuration parameter.- Parameters:
aGroupName- the name of a group, ornullfor no groupaParamName- the name of the parameter- Returns:
- the specified parameter,
nullif it does not exist
-
getConfigurationGroupDeclarations
Gets the declarations of a named configuration group. There may be more than one declaration for a single group name; in this case, all parameters contained in each of these declarations are considered part of the named group.- Parameters:
aGroupName- the name of a group- Returns:
- an array of ConfigurationGroup declarations having the name
aGroupName. If there are no such groups, an empty array is returned.
-