Class ResourceMetaData_impl
- All Implemented Interfaces:
Serializable
,Cloneable
,MetaDataObject
,ResourceMetaData
,XMLizable
- Direct Known Subclasses:
AnalysisEngineMetaData_impl
ResourceMetaData
.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.uima.resource.metadata.impl.MetaDataObject_impl
MetaDataObject_impl.MetaDataAttr, MetaDataObject_impl.SerialContext, MetaDataObject_impl.Serializer
-
Field Summary
Fields inherited from class org.apache.uima.resource.metadata.impl.MetaDataObject_impl
serialContext
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
buildFromXMLElement
(Element aElement, XMLParser aParser, XMLParser.ParsingOptions aOptions) Overridden to validate configuration parameter data types immediately after parsing is complete.protected Class<?>
getClassForParameterType
(String paramType) Gets the expected Java class for the given parameter type name.Gets the configuration parameter declarations for this Resource.Gets the configuration parameter settings for this Resource.Gets the copyright notice for this Resource.Gets the description of this Resource.getName()
Gets the name of this Resource.getUUID()
Gets the UUID (Universally Unique Identifier) for this Resource.Gets the vendor of this Resource.Gets the version number of this Resource.protected XmlizationInfo
To be implemented by subclasses to return information describing how to represent this object in XML.protected static XmlizationInfo
Static method to get XmlizationInfo, used by subclasses to set up their own XmlizationInfo.void
Resolves any import declarations throughout this metadata.void
resolveImports
(ResourceManager aResourceManager) Resolves any import declarations throughout this metadata.void
Gets the configuration parameter declarations for this Resource.void
Sets the configuration parameter settings for this Resource.void
setCopyright
(String aCopyright) Sets the copyright notice for this Resource.void
setDescription
(String aDescription) Sets the description of this Resource.void
Sets the name of this Resource.void
Sets the UUID (Universally Unique Identifier) for this Resource.void
Sets the vendor of this Resource.void
setVersion
(String aVersion) Sets the version number of this Resource.protected void
Validate that a value is of an appropriate data type for assignment to the given parameter.void
Validates configuration parameter settings within this Resource MetaData, and throws an exception if they are not valid.protected void
validateConfigurationParameterSettings
(NameValuePair[] aNVPs, String aGroupName, ConfigurationParameterDeclarations aParamDecls) Validates configuration parameter settings within a group.Methods inherited from class org.apache.uima.resource.metadata.impl.MetaDataObject_impl
buildFromXMLElement, clone, equals, getAdditionalAttributes, getAttributeClass, getAttributeValue, getInfoset, getMatchingNode, getPropertyDescriptors, getPropertyXmlInfo, getRelativePathBase, getSerialContext, getSourceUrl, getSourceUrlString, getWrapperClass, getXMLAttributes, hashCode, isModifiable, listAttributes, readArrayPropertyValueFromXMLElement, readMapPropertyFromXml, readPropertyValueFromXMLElement, readUnknownPropertyValueFromXMLElement, resolveSettings, setAttributeValue, setInfoset, setSourceUrl, setSourceUrlIfNull, toString, toXML, toXML, toXML, toXML, valueIsNullOrEmptyArray, writeArrayPropertyAsElement, writeMapPropertyToXml, writePropertyAsElement
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, listAttributes, setAttributeValue, setSourceUrl
-
Constructor Details
-
ResourceMetaData_impl
public ResourceMetaData_impl()Creates a newResourceMetaData_impl
.
-
-
Method Details
-
resolveImports
Description copied from interface:ResourceMetaData
Resolves any import declarations throughout this metadata. This base interface cannot contain any interfaces, but subinterfaces may introduce new properties that can have imports that need to be resolved.- Specified by:
resolveImports
in interfaceResourceMetaData
- Throws:
InvalidXMLException
- if either the import target does not exist or is invalid- See Also:
-
resolveImports
Description copied from interface:ResourceMetaData
Resolves any import declarations throughout this metadata. This base interface cannot contain any interfaces, but subinterfaces may introduce new properties that can have imports that need to be resolved.- Specified by:
resolveImports
in interfaceResourceMetaData
- Parameters:
aResourceManager
- the Resource Manager used to locate descriptors imported by name. For example, the path in which to locate these descriptors can be set via theResourceManager.setDataPath(String)
method.- Throws:
InvalidXMLException
- if either the import target does not exist or is invalid- See Also:
-
getUUID
Description copied from interface:ResourceMetaData
Gets the UUID (Universally Unique Identifier) for this Resource.- Specified by:
getUUID
in interfaceResourceMetaData
- Returns:
- the UUID for this Resource
- See Also:
-
setUUID
Description copied from interface:ResourceMetaData
Sets the UUID (Universally Unique Identifier) for this Resource.- Specified by:
setUUID
in interfaceResourceMetaData
- Parameters:
aUUID
- the UUID for this Resource- See Also:
-
getName
Description copied from interface:ResourceMetaData
Gets the name of this Resource.- Specified by:
getName
in interfaceResourceMetaData
- Returns:
- the name of this Resource
- See Also:
-
setName
Description copied from interface:ResourceMetaData
Sets the name of this Resource.- Specified by:
setName
in interfaceResourceMetaData
- Parameters:
aName
- the name of this Resource- See Also:
-
getVersion
Description copied from interface:ResourceMetaData
Gets the version number of this Resource.- Specified by:
getVersion
in interfaceResourceMetaData
- Returns:
- the version number of this Resource, as a String
- See Also:
-
setVersion
Description copied from interface:ResourceMetaData
Sets the version number of this Resource.- Specified by:
setVersion
in interfaceResourceMetaData
- Parameters:
aVersion
- the version number of this Resource, as a String- See Also:
-
getDescription
Description copied from interface:ResourceMetaData
Gets the description of this Resource.- Specified by:
getDescription
in interfaceResourceMetaData
- Returns:
- the description of this Resource
- See Also:
-
setDescription
Description copied from interface:ResourceMetaData
Sets the description of this Resource.- Specified by:
setDescription
in interfaceResourceMetaData
- Parameters:
aDescription
- the description of this Resource- See Also:
-
getVendor
Description copied from interface:ResourceMetaData
Gets the vendor of this Resource.- Specified by:
getVendor
in interfaceResourceMetaData
- Returns:
- the vendor of this Resource, as a String
- See Also:
-
setVendor
Description copied from interface:ResourceMetaData
Sets the vendor of this Resource.- Specified by:
setVendor
in interfaceResourceMetaData
- Parameters:
aVendor
- the vendor of this Resource, as a String- See Also:
-
getCopyright
Description copied from interface:ResourceMetaData
Gets the copyright notice for this Resource.- Specified by:
getCopyright
in interfaceResourceMetaData
- Returns:
- the copyright notice for this Resource
- See Also:
-
setCopyright
Description copied from interface:ResourceMetaData
Sets the copyright notice for this Resource.- Specified by:
setCopyright
in interfaceResourceMetaData
- Parameters:
aCopyright
- the copyright notice for this Resource- See Also:
-
getConfigurationParameterSettings
Description copied from interface:ResourceMetaData
Gets the configuration parameter settings for this Resource.- Specified by:
getConfigurationParameterSettings
in interfaceResourceMetaData
- Returns:
- an object containing the settings for this Resource's configuration parameters.
- See Also:
-
setConfigurationParameterSettings
Description copied from interface:ResourceMetaData
Sets the configuration parameter settings for this Resource.- Specified by:
setConfigurationParameterSettings
in interfaceResourceMetaData
- Parameters:
aSettings
- an object containing the settings for this Resource's configuration parameters.- See Also:
-
getConfigurationParameterDeclarations
Description copied from interface:ResourceMetaData
Gets the configuration parameter declarations for this Resource.- Specified by:
getConfigurationParameterDeclarations
in interfaceResourceMetaData
- Returns:
- an object containing the configuration parameter declarations
- See Also:
-
setConfigurationParameterDeclarations
Description copied from interface:ResourceMetaData
Gets the configuration parameter declarations for this Resource.- Specified by:
setConfigurationParameterDeclarations
in interfaceResourceMetaData
- Parameters:
aDeclarations
- an object containing the configuration parameter declarations- See Also:
-
validateConfigurationParameterSettings
Validates configuration parameter settings within this Resource MetaData, and throws an exception if they are not valid.This method checks to make sure that each configuration parameter setting corresponds to an declared configuration parameter, and that the data types are compatible. It does NOT check that all mandatory parameters have been assigned values - this should be done at resource initialization time and not before.
NOTE: this method can cause a change to the ConfigurationParameterSettings object in the case where the value of a parameter is an empty Object[] and the parameter type is an array of a different type. In this case the empty object array will be replaced by an empty array of the appropriate type.
- Specified by:
validateConfigurationParameterSettings
in interfaceResourceMetaData
- Throws:
ResourceConfigurationException
- if the configuration parameter settings are invalid- See Also:
-
validateConfigurationParameterSettings
protected void validateConfigurationParameterSettings(NameValuePair[] aNVPs, String aGroupName, ConfigurationParameterDeclarations aParamDecls) throws ResourceConfigurationException Validates configuration parameter settings within a group.- Parameters:
aNVPs
- the parameter settingsaGroupName
- the groupaParamDecls
- Configuration Parameter Declarations- Throws:
ResourceConfigurationException
- if the configuration parameter settings are invalid
-
validateConfigurationParameterDataTypeMatch
protected void validateConfigurationParameterDataTypeMatch(ConfigurationParameter aParam, NameValuePair aNVP) throws ResourceConfigurationException Validate that a value is of an appropriate data type for assignment to the given parameter.NOTE: this method can cause a change to the NameValuePair object in the case where the value of a parameter is an empty Object[] and the parameter type is an array of a different type. In this case the empty object array will be replaced by an empty array of the appropriate type.
- Parameters:
aParam
- configuration parameteraNVP
- name value pair containing candidate value- Throws:
ResourceConfigurationException
- if the data types do not match
-
getClassForParameterType
Gets the expected Java class for the given parameter type name.- Parameters:
paramType
- parameter type name from ConfigurationParameterDeclarations- Returns:
- expected Java class for parameter values of this type
-
buildFromXMLElement
public void buildFromXMLElement(Element aElement, XMLParser aParser, XMLParser.ParsingOptions aOptions) throws InvalidXMLException Overridden to validate configuration parameter data types immediately after parsing is complete.- Specified by:
buildFromXMLElement
in interfaceXMLizable
- Overrides:
buildFromXMLElement
in classMetaDataObject_impl
- Parameters:
aElement
- the XML element that represents this object.aParser
- a reference to the UIMAXMLParser
. TheXMLParser.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:
-
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 classMetaDataObject_impl
- Returns:
- information defining this object's XML representation
-
getXmlizationInfoForClass
Static method to get XmlizationInfo, used by subclasses to set up their own XmlizationInfo.- Returns:
- -
-