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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildFromXMLElement(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 XmlizationInfoTo be implemented by subclasses to return information describing how to represent this object in XML.protected static XmlizationInfoStatic method to get XmlizationInfo, used by subclasses to set up their own XmlizationInfo.voidResolves any import declarations throughout this metadata.voidresolveImports(ResourceManager aResourceManager) Resolves any import declarations throughout this metadata.voidGets the configuration parameter declarations for this Resource.voidSets the configuration parameter settings for this Resource.voidsetCopyright(String aCopyright) Sets the copyright notice for this Resource.voidsetDescription(String aDescription) Sets the description of this Resource.voidSets the name of this Resource.voidSets the UUID (Universally Unique Identifier) for this Resource.voidSets the vendor of this Resource.voidsetVersion(String aVersion) Sets the version number of this Resource.protected voidValidate that a value is of an appropriate data type for assignment to the given parameter.voidValidates configuration parameter settings within this Resource MetaData, and throws an exception if they are not valid.protected voidvalidateConfigurationParameterSettings(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, writePropertyAsElementMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:ResourceMetaDataResolves 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:
resolveImportsin interfaceResourceMetaData- Throws:
InvalidXMLException- if either the import target does not exist or is invalid- See Also:
-
resolveImports
Description copied from interface:ResourceMetaDataResolves 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:
resolveImportsin 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:ResourceMetaDataGets the UUID (Universally Unique Identifier) for this Resource.- Specified by:
getUUIDin interfaceResourceMetaData- Returns:
- the UUID for this Resource
- See Also:
-
setUUID
Description copied from interface:ResourceMetaDataSets the UUID (Universally Unique Identifier) for this Resource.- Specified by:
setUUIDin interfaceResourceMetaData- Parameters:
aUUID- the UUID for this Resource- See Also:
-
getName
Description copied from interface:ResourceMetaDataGets the name of this Resource.- Specified by:
getNamein interfaceResourceMetaData- Returns:
- the name of this Resource
- See Also:
-
setName
Description copied from interface:ResourceMetaDataSets the name of this Resource.- Specified by:
setNamein interfaceResourceMetaData- Parameters:
aName- the name of this Resource- See Also:
-
getVersion
Description copied from interface:ResourceMetaDataGets the version number of this Resource.- Specified by:
getVersionin interfaceResourceMetaData- Returns:
- the version number of this Resource, as a String
- See Also:
-
setVersion
Description copied from interface:ResourceMetaDataSets the version number of this Resource.- Specified by:
setVersionin interfaceResourceMetaData- Parameters:
aVersion- the version number of this Resource, as a String- See Also:
-
getDescription
Description copied from interface:ResourceMetaDataGets the description of this Resource.- Specified by:
getDescriptionin interfaceResourceMetaData- Returns:
- the description of this Resource
- See Also:
-
setDescription
Description copied from interface:ResourceMetaDataSets the description of this Resource.- Specified by:
setDescriptionin interfaceResourceMetaData- Parameters:
aDescription- the description of this Resource- See Also:
-
getVendor
Description copied from interface:ResourceMetaDataGets the vendor of this Resource.- Specified by:
getVendorin interfaceResourceMetaData- Returns:
- the vendor of this Resource, as a String
- See Also:
-
setVendor
Description copied from interface:ResourceMetaDataSets the vendor of this Resource.- Specified by:
setVendorin interfaceResourceMetaData- Parameters:
aVendor- the vendor of this Resource, as a String- See Also:
-
getCopyright
Description copied from interface:ResourceMetaDataGets the copyright notice for this Resource.- Specified by:
getCopyrightin interfaceResourceMetaData- Returns:
- the copyright notice for this Resource
- See Also:
-
setCopyright
Description copied from interface:ResourceMetaDataSets the copyright notice for this Resource.- Specified by:
setCopyrightin interfaceResourceMetaData- Parameters:
aCopyright- the copyright notice for this Resource- See Also:
-
getConfigurationParameterSettings
Description copied from interface:ResourceMetaDataGets the configuration parameter settings for this Resource.- Specified by:
getConfigurationParameterSettingsin interfaceResourceMetaData- Returns:
- an object containing the settings for this Resource's configuration parameters.
- See Also:
-
setConfigurationParameterSettings
Description copied from interface:ResourceMetaDataSets the configuration parameter settings for this Resource.- Specified by:
setConfigurationParameterSettingsin interfaceResourceMetaData- Parameters:
aSettings- an object containing the settings for this Resource's configuration parameters.- See Also:
-
getConfigurationParameterDeclarations
Description copied from interface:ResourceMetaDataGets the configuration parameter declarations for this Resource.- Specified by:
getConfigurationParameterDeclarationsin interfaceResourceMetaData- Returns:
- an object containing the configuration parameter declarations
- See Also:
-
setConfigurationParameterDeclarations
Description copied from interface:ResourceMetaDataGets the configuration parameter declarations for this Resource.- Specified by:
setConfigurationParameterDeclarationsin 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:
validateConfigurationParameterSettingsin 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:
buildFromXMLElementin interfaceXMLizable- Overrides:
buildFromXMLElementin 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_implTo be implemented by subclasses to return information describing how to represent this object in XML.- Specified by:
getXmlizationInfoin 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:
- -
-