Interface ConfigurationParameterDeclarations
-
- All Superinterfaces:
java.lang.Cloneable
,MetaDataObject
,java.io.Serializable
,XMLizable
- All Known Implementing Classes:
ConfigurationParameterDeclarations_impl
public interface ConfigurationParameterDeclarations extends MetaDataObject
The declarations of configuration parameters in a Resource. A Resource can either declare a single list ofConfigurationParameter
s or a list ofConfigurationGroup
s, where each group can contain a list of parameters. When groups are used, the Resource can also declare a list ofcommon parameters
shared by all groups.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
SEARCH_STRATEGY_DEFAULT_FALLBACK
A value for thesearchStrategy
property indicating that if there is no value declared in a group, look in thedefault group
.static java.lang.String
SEARCH_STRATEGY_LANGUAGE_FALLBACK
A value for thesearchStrategy
property that is useful when ISO language and country codes are used as configuration group names.static java.lang.String
SEARCH_STRATEGY_NONE
A value for thesearchStrategy
property indicating that there is no fallback.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addCommonParameter(ConfigurationParameter aConfigurationParameter)
Adds a Configuration Parameter that is common to all groups.void
addConfigurationGroup(ConfigurationGroup aConfigurationGroup)
Adds a Configuration Group.void
addConfigurationParameter(ConfigurationParameter aConfigurationParameter)
Adds a Configuration Parameter that is not in any group.ConfigurationParameter[]
getCommonParameters()
Gets the configuration parameters that are common to all groups.ConfigurationGroup[]
getConfigurationGroupDeclarations(java.lang.String aGroupName)
Gets the declarations of a named configuration group.ConfigurationGroup[]
getConfigurationGroups()
Gets the configuration parameter groups for this Resource.ConfigurationParameter
getConfigurationParameter(java.lang.String aGroupName, java.lang.String aParamName)
Gets a configuration parameter.ConfigurationParameter[]
getConfigurationParameters()
Gets the configuration parameters for this Resource.java.lang.String
getDefaultGroupName()
Gets the name of the default configuration group.java.lang.String
getSearchStrategy()
Gets the configuration parameter search strategy.void
removeCommonParameter(ConfigurationParameter aConfigurationParameter)
Removes an Configuration Parameter that is common to all groups.void
removeConfigurationGroup(ConfigurationGroup aConfigurationGroup)
Removes an Configuration Groupvoid
removeConfigurationParameter(ConfigurationParameter aConfigurationParameter)
Removes an Configuration Parameter that is not in any group.void
setCommonParameters(ConfigurationParameter[] aParams)
Sets the configuration parameters that are common to all groups.void
setConfigurationGroups(ConfigurationGroup[] aGroups)
Sets the configuration parameter groups for this Resource.void
setConfigurationParameters(ConfigurationParameter[] aParams)
Sets the configuration parameters for this Resource.void
setDefaultGroupName(java.lang.String aGroupName)
Sets the name of the default configuration group.void
setSearchStrategy(java.lang.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, setSourceUrl
-
Methods inherited from interface org.apache.uima.util.XMLizable
buildFromXMLElement, buildFromXMLElement, toXML, toXML, toXML, toXML
-
-
-
-
Field Detail
-
SEARCH_STRATEGY_NONE
static final java.lang.String SEARCH_STRATEGY_NONE
A value for thesearchStrategy
property 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,null
will be returned.- See Also:
- Constant Field Values
-
SEARCH_STRATEGY_DEFAULT_FALLBACK
static final java.lang.String SEARCH_STRATEGY_DEFAULT_FALLBACK
A value for thesearchStrategy
property indicating that if there is no value declared in a group, look in thedefault group
.- See Also:
- Constant Field Values
-
SEARCH_STRATEGY_LANGUAGE_FALLBACK
static final java.lang.String SEARCH_STRATEGY_LANGUAGE_FALLBACK
A value for thesearchStrategy
property 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:
- Constant Field Values
-
-
Method Detail
-
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
ConfigurationParameter
objects, each of which describes a configuration parameter for this Resource.
-
setConfigurationParameters
void setConfigurationParameters(ConfigurationParameter[] aParams)
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 containingConfigurationParameter
objects, each of which describes a configuration parameter for this Resource.- Throws:
UIMA_UnsupportedOperationException
- if this object is not modifiable
-
addConfigurationParameter
void addConfigurationParameter(ConfigurationParameter aConfigurationParameter)
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
void removeConfigurationParameter(ConfigurationParameter aConfigurationParameter)
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
ConfigurationGroup
objects, each of which describes a configuration parameter group for this Resource.
-
setConfigurationGroups
void setConfigurationGroups(ConfigurationGroup[] aGroups)
Sets the configuration parameter groups for this Resource.- Parameters:
aGroups
- an array containingConfigurationGroup
objects, each of which describes a configuration parameter group for this Resource.- Throws:
UIMA_UnsupportedOperationException
- if this object is not modifiable
-
addConfigurationGroup
void addConfigurationGroup(ConfigurationGroup aConfigurationGroup)
Adds a Configuration Group.- Parameters:
aConfigurationGroup
- the Configuration Group to add- Throws:
UIMA_UnsupportedOperationException
- if this object is not modifiable
-
removeConfigurationGroup
void removeConfigurationGroup(ConfigurationGroup aConfigurationGroup)
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
ConfigurationParameter
objects, each of which describes a parameter common to all groups.
-
setCommonParameters
void setCommonParameters(ConfigurationParameter[] aParams)
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 containingConfigurationParameter
objects, each of which describes a parameter common to all groups.
-
addCommonParameter
void addCommonParameter(ConfigurationParameter aConfigurationParameter)
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
void removeCommonParameter(ConfigurationParameter aConfigurationParameter)
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
java.lang.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
void setDefaultGroupName(java.lang.String aGroupName)
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
java.lang.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
void setSearchStrategy(java.lang.String aStrategy)
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
ConfigurationParameter getConfigurationParameter(java.lang.String aGroupName, java.lang.String aParamName)
Gets a configuration parameter.- Parameters:
aGroupName
- the name of a group, ornull
for no groupaParamName
- the name of the parameter- Returns:
- the specified parameter,
null
if it does not exist
-
getConfigurationGroupDeclarations
ConfigurationGroup[] getConfigurationGroupDeclarations(java.lang.String aGroupName)
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.
-
-