org.apache.uima.resource.metadata.impl
Class ConfigurationParameterSettings_impl

java.lang.Object
  extended by org.apache.uima.resource.metadata.impl.MetaDataObject_impl
      extended by org.apache.uima.resource.metadata.impl.ConfigurationParameterSettings_impl
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, ConfigurationParameterSettings, MetaDataObject, XMLizable

public class ConfigurationParameterSettings_impl
extends MetaDataObject_impl
implements ConfigurationParameterSettings

Reference implementation of ConfigurationParameterSettings.

See Also:
Serialized Form

Constructor Summary
ConfigurationParameterSettings_impl()
           
 
Method Summary
 void buildFromXMLElement(org.w3c.dom.Element aElement, XMLParser aParser, XMLParser.ParsingOptions aOptions)
          Overridden becuase of settingsForGroups property, which is a Map and isn't handled by default XMLization routines.
 NameValuePair[] getParameterSettings()
          Gets the settings for configuration parameters that are not in any group.
 java.lang.Object getParameterValue(java.lang.String aParamName)
          Looks up the value of a parameter.
 java.lang.Object getParameterValue(java.lang.String aGroupName, java.lang.String aParamName)
          Looks up the value of a parameter in a group.
 java.util.Map<java.lang.String,NameValuePair[]> getSettingsForGroups()
          Gets the settings for configuration parameters that are defined within groups.
protected  XmlizationInfo getXmlizationInfo()
          To be implemented by subclasses to return information describing how to represent this object in XML.
 java.util.List<NameClassPair> listAttributes()
          Overridden to add the settingsForGroups property to the result list.
 void setParameterSettings(NameValuePair[] aSettings)
          Sets the settings for configuration parameters that are not in any group.
 void setParameterValue(java.lang.String aParamName, java.lang.Object aValue)
          Sets the value of a parameter.
 void setParameterValue(java.lang.String aGroupName, java.lang.String aParamName, java.lang.Object aValue)
          Sets the value of a parameter in a group.
protected  void writePropertyAsElement(PropertyXmlInfo aPropInfo, java.lang.String aNamespace, org.xml.sax.ContentHandler aContentHandler)
          Overridden to write the settingsForGroups property, whose value is a Map, which is not supported by the default XMLization routines.
 
Methods inherited from class org.apache.uima.resource.metadata.impl.MetaDataObject_impl
buildFromXMLElement, clone, equals, getAttributeClass, getAttributeValue, getPropertyDescriptors, getPropertyXmlInfo, getRelativePathBase, getSourceUrl, getSourceUrlString, getWrapperClass, getXMLAttributes, hashCode, isModifiable, readArrayPropertyValueFromXMLElement, readMapPropertyFromXml, readPropertyValueFromXMLElement, readUnknownPropertyValueFromXMLElement, setAttributeValue, setSourceUrl, setSourceUrlIfNull, toString, toXML, toXML, toXML, toXML, writeArrayPropertyAsElement, writeMapPropertyToXml
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.uima.resource.metadata.MetaDataObject
clone, equals, getAttributeValue, getSourceUrl, getSourceUrlString, isModifiable, setAttributeValue, setSourceUrl
 
Methods inherited from interface org.apache.uima.util.XMLizable
buildFromXMLElement, toXML, toXML, toXML, toXML
 

Constructor Detail

ConfigurationParameterSettings_impl

public ConfigurationParameterSettings_impl()
Method Detail

getParameterSettings

public NameValuePair[] getParameterSettings()
Description copied from interface: ConfigurationParameterSettings
Gets the settings for configuration parameters that are not in any group.

Specified by:
getParameterSettings in interface ConfigurationParameterSettings
Returns:
an array of NameValuePair objects, each of which contains a parameter name and the value of that parameter
See Also:
org.apache.uima.resource.ConfigurationParameterSettings#getParameterSettings()

setParameterSettings

public void setParameterSettings(NameValuePair[] aSettings)
Description copied from interface: ConfigurationParameterSettings
Sets the settings for configuration parameters that are not in any group.

Specified by:
setParameterSettings in interface ConfigurationParameterSettings
Parameters:
aSettings - an array of NameValuePair objects, each of which contains a parameter name and the value of that parameter
See Also:
org.apache.uima.resource.ConfigurationParameterSettings#setParameterSettings(org.apache.uima.resource.NameValuePair[])

getSettingsForGroups

public java.util.Map<java.lang.String,NameValuePair[]> getSettingsForGroups()
Description copied from interface: ConfigurationParameterSettings
Gets the settings for configuration parameters that are defined within groups.

Specified by:
getSettingsForGroups in interface ConfigurationParameterSettings
Returns:
a Map with String keys (the group names) and NameValuePair[] values (the settings for parameters in that group.
See Also:
org.apache.uima.resource.ConfigurationParameterSettings#getSettingsForGroups()

getParameterValue

public java.lang.Object getParameterValue(java.lang.String aParamName)
Description copied from interface: ConfigurationParameterSettings
Looks up the value of a parameter. This is a "dumb" getter and does not follow any fallback strategies. It will only return the value of a parameter that is not defined in any group.

Specified by:
getParameterValue in interface ConfigurationParameterSettings
Parameters:
aParamName - the name of a parameter that is not in any group
Returns:
the value of the parameter with name aParamName
See Also:
org.apache.uima.resource.ConfigurationParameterSettings#getParameterValue(java.lang.String)

getParameterValue

public java.lang.Object getParameterValue(java.lang.String aGroupName,
                                          java.lang.String aParamName)
Description copied from interface: ConfigurationParameterSettings
Looks up the value of a parameter in a group. This is a "dumb" getter and does not follow any fallback strategies.

Specified by:
getParameterValue in interface ConfigurationParameterSettings
Parameters:
aGroupName - the name of a configuration group. If this parameter is null, this method will return the same value as ConfigurationParameterSettings.getParameterValue(String).
aParamName - the name of a parameter in the group
Returns:
the value of the parameter in group aGroupName with name aParamName
See Also:
org.apache.uima.resource.ConfigurationParameterSettings#getParameterValue(java.lang.String, java.lang.String)

setParameterValue

public void setParameterValue(java.lang.String aParamName,
                              java.lang.Object aValue)
Description copied from interface: ConfigurationParameterSettings
Sets the value of a parameter. This only works for a parameter that is not defined in any group.

Specified by:
setParameterValue in interface ConfigurationParameterSettings
Parameters:
aParamName - the name of a parameter that is not in any group
aValue - the value to assign to the parameter
See Also:
org.apache.uima.resource.ConfigurationParameterSettings#setParameterValue(java.lang.String, java.lang.Object)

setParameterValue

public void setParameterValue(java.lang.String aGroupName,
                              java.lang.String aParamName,
                              java.lang.Object aValue)
Description copied from interface: ConfigurationParameterSettings
Sets the value of a parameter in a group.

Specified by:
setParameterValue in interface ConfigurationParameterSettings
Parameters:
aGroupName - the name of a configuration group
aParamName - the name of a parameter in the group
aValue - the value to assign to the parameter
See Also:
org.apache.uima.resource.ConfigurationParameterSettings#setParameterValue(java.lang.String, java.lang.String, java.lang.Object)

getXmlizationInfo

protected XmlizationInfo getXmlizationInfo()
Description copied from class: MetaDataObject_impl
To be implemented by subclasses to return information describing how to represent this object in XML.

Specified by:
getXmlizationInfo in class MetaDataObject_impl
Returns:
information defining this object's XML representation
See Also:
org.apache.uima.resource.impl.MetaDataObject_impl#getXmlizationInfo()

listAttributes

public java.util.List<NameClassPair> listAttributes()
Overridden to add the settingsForGroups property to the result list. Default introspection implementation won't return it because it has no set method. We've also overridden the XML import/export methods, though, so that set methods are not required.

Specified by:
listAttributes in interface MetaDataObject
Overrides:
listAttributes in class MetaDataObject_impl
Returns:
a List containing NameClassPair objects, each of which contains the name of a parameter and the Class of its value. For primitive types, the wrapper classes will be returned (e.g. java.lang.Integer instead of int).
See Also:
org.apache.uima.resource.MetaDataObject#listAttributes()

buildFromXMLElement

public void buildFromXMLElement(org.w3c.dom.Element aElement,
                                XMLParser aParser,
                                XMLParser.ParsingOptions aOptions)
                         throws InvalidXMLException
Overridden becuase of settingsForGroups property, which is a Map and isn't handled by default XMLization routines.

Specified by:
buildFromXMLElement in interface XMLizable
Overrides:
buildFromXMLElement in class MetaDataObject_impl
Parameters:
aElement - the XML element that represents this object.
aParser - a reference to the UIMA XMLParser. The XMLParser.buildObject(Element) method can be used to construct sub-objects.
aOptions - option settings
Throws:
InvalidXMLException - if the input XML element does not specify a valid object
See Also:
XMLizable.buildFromXMLElement(org.w3c.dom.Element, org.apache.uima.util.XMLParser)

writePropertyAsElement

protected void writePropertyAsElement(PropertyXmlInfo aPropInfo,
                                      java.lang.String aNamespace,
                                      org.xml.sax.ContentHandler aContentHandler)
                               throws org.xml.sax.SAXException
Overridden to write the settingsForGroups property, whose value is a Map, which is not supported by the default XMLization routines.

Overrides:
writePropertyAsElement in class MetaDataObject_impl
Parameters:
aPropInfo - information on how to represent the property in XML
aNamespace - XML namespace URI for this object
aContentHandler - content handler to which this object will send events that describe its XML representation
Throws:
org.xml.sax.SAXException
See Also:
org.apache.uima.resource.impl.MetaDataObject_impl#writePropertyAsElement(org.apache.uima.resource.impl.PropertyXmlInfo, java.lang.String, ContentHandler)


Copyright © 2012. All Rights Reserved.