Class ResourceMetaData_impl
- java.lang.Object
-
- org.apache.uima.resource.metadata.impl.MetaDataObject_impl
-
- org.apache.uima.resource.metadata.impl.ResourceMetaData_impl
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,MetaDataObject,ResourceMetaData,XMLizable
- Direct Known Subclasses:
AnalysisEngineMetaData_impl
public class ResourceMetaData_impl extends MetaDataObject_impl implements ResourceMetaData
Reference implementation ofResourceMetaData.- See Also:
- Serialized Form
-
-
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 Modifier and Type Field Description private ConfigurationParameterDeclarationsmConfigurationParameterDeclarationsConfiguration Parameter Declarations for the Resourceprivate ConfigurationParameterSettingsmConfigurationParameterSettingsConfiguration Parameter Settings for the Resourceprivate java.lang.StringmCopyrightCopyright notice for the Resourceprivate java.lang.StringmDescriptionDescription of the Resourceprivate java.lang.StringmNameName of the Resourceprivate java.lang.StringmUUIDUUID of the Resourceprivate java.lang.StringmVendorVendor of the Resourceprivate java.lang.StringmVersionVersion number of the Resource(package private) static longserialVersionUIDprivate static XmlizationInfoXMLIZATION_INFO-
Fields inherited from class org.apache.uima.resource.metadata.impl.MetaDataObject_impl
serialContext
-
-
Constructor Summary
Constructors Constructor Description ResourceMetaData_impl()Creates a newResourceMetaData_impl.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuildFromXMLElement(org.w3c.dom.Element aElement, XMLParser aParser, XMLParser.ParsingOptions aOptions)Overridden to validate configuration parameter data types immediately after parsing is complete.protected java.lang.Class<?>getClassForParameterType(java.lang.String paramType)Gets the expected Java class for the given parameter type name.ConfigurationParameterDeclarationsgetConfigurationParameterDeclarations()Gets the configuration parameter declarations for this Resource.ConfigurationParameterSettingsgetConfigurationParameterSettings()Gets the configuration parameter settings for this Resource.java.lang.StringgetCopyright()Gets the copyright notice for this Resource.java.lang.StringgetDescription()Gets the description of this Resource.java.lang.StringgetName()Gets the name of this Resource.java.lang.StringgetUUID()Gets the UUID (Universally Unique Identifier) for this Resource.java.lang.StringgetVendor()Gets the vendor of this Resource.java.lang.StringgetVersion()Gets the version number of this Resource.protected XmlizationInfogetXmlizationInfo()To be implemented by subclasses to return information describing how to represent this object in XML.protected static XmlizationInfogetXmlizationInfoForClass()Static method to get XmlizationInfo, used by subclasses to set up their own XmlizationInfo.voidresolveImports()Resolves any import declarations throughout this metadata.voidresolveImports(ResourceManager aResourceManager)Resolves any import declarations throughout this metadata.voidsetConfigurationParameterDeclarations(ConfigurationParameterDeclarations aDeclarations)Gets the configuration parameter declarations for this Resource.voidsetConfigurationParameterSettings(ConfigurationParameterSettings aSettings)Sets the configuration parameter settings for this Resource.voidsetCopyright(java.lang.String aCopyright)Sets the copyright notice for this Resource.voidsetDescription(java.lang.String aDescription)Sets the description of this Resource.voidsetName(java.lang.String aName)Sets the name of this Resource.voidsetUUID(java.lang.String aUUID)Sets the UUID (Universally Unique Identifier) for this Resource.voidsetVendor(java.lang.String aVendor)Sets the vendor of this Resource.voidsetVersion(java.lang.String aVersion)Sets the version number of this Resource.protected voidvalidateConfigurationParameterDataTypeMatch(ConfigurationParameter aParam, NameValuePair aNVP)Validate that a value is of an appropriate data type for assignment to the given parameter.voidvalidateConfigurationParameterSettings()Validates configuration parameter settings within this Resource MetaData, and throws an exception if they are not valid.protected voidvalidateConfigurationParameterSettings(NameValuePair[] aNVPs, java.lang.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, getAttributes, getAttributeValue, getInfoset, getMatchingNode, getPropertyDescriptors, getPropertyXmlInfo, getRelativePathBase, getSerialContext, getSourceUrl, getSourceUrlString, getUnfilteredAttributes, 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
-
-
-
-
Field Detail
-
serialVersionUID
static final long serialVersionUID
- See Also:
- Constant Field Values
-
mUUID
private java.lang.String mUUID
UUID of the Resource
-
mName
private java.lang.String mName
Name of the Resource
-
mDescription
private java.lang.String mDescription
Description of the Resource
-
mVersion
private java.lang.String mVersion
Version number of the Resource
-
mVendor
private java.lang.String mVendor
Vendor of the Resource
-
mCopyright
private java.lang.String mCopyright
Copyright notice for the Resource
-
mConfigurationParameterDeclarations
private ConfigurationParameterDeclarations mConfigurationParameterDeclarations
Configuration Parameter Declarations for the Resource
-
mConfigurationParameterSettings
private ConfigurationParameterSettings mConfigurationParameterSettings
Configuration Parameter Settings for the Resource
-
XMLIZATION_INFO
private static final XmlizationInfo XMLIZATION_INFO
-
-
Method Detail
-
resolveImports
public void resolveImports() throws InvalidXMLExceptionDescription 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:
ResourceMetaData.resolveImports()
-
resolveImports
public void resolveImports(ResourceManager aResourceManager) throws InvalidXMLException
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:
ResourceMetaData.resolveImports(ResourceManager)
-
getUUID
public java.lang.String 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:
ResourceMetaData.getUUID()
-
setUUID
public void setUUID(java.lang.String aUUID)
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:
ResourceMetaData.setUUID(String)
-
getName
public java.lang.String getName()
Description copied from interface:ResourceMetaDataGets the name of this Resource.- Specified by:
getNamein interfaceResourceMetaData- Returns:
- the name of this Resource
- See Also:
ResourceMetaData.getName()
-
setName
public void setName(java.lang.String aName)
Description copied from interface:ResourceMetaDataSets the name of this Resource.- Specified by:
setNamein interfaceResourceMetaData- Parameters:
aName- the name of this Resource- See Also:
ResourceMetaData.setName(String)
-
getVersion
public java.lang.String 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:
ResourceMetaData.getVersion()
-
setVersion
public void setVersion(java.lang.String aVersion)
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:
ResourceMetaData.setVersion(String)
-
getDescription
public java.lang.String getDescription()
Description copied from interface:ResourceMetaDataGets the description of this Resource.- Specified by:
getDescriptionin interfaceResourceMetaData- Returns:
- the description of this Resource
- See Also:
ResourceMetaData.getDescription()
-
setDescription
public void setDescription(java.lang.String aDescription)
Description copied from interface:ResourceMetaDataSets the description of this Resource.- Specified by:
setDescriptionin interfaceResourceMetaData- Parameters:
aDescription- the description of this Resource- See Also:
ResourceMetaData.setDescription(String)
-
getVendor
public java.lang.String 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:
ResourceMetaData.getVendor()
-
setVendor
public void setVendor(java.lang.String aVendor)
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:
ResourceMetaData.setVendor(String)
-
getCopyright
public java.lang.String 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:
ResourceMetaData.getCopyright()
-
setCopyright
public void setCopyright(java.lang.String aCopyright)
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:
ResourceMetaData.setCopyright(String)
-
getConfigurationParameterSettings
public ConfigurationParameterSettings 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:
ResourceMetaData.getConfigurationParameterSettings()
-
setConfigurationParameterSettings
public void setConfigurationParameterSettings(ConfigurationParameterSettings aSettings)
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:
ResourceMetaData.setConfigurationParameterSettings(ConfigurationParameterSettings)
-
getConfigurationParameterDeclarations
public ConfigurationParameterDeclarations 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:
ResourceMetaData.getConfigurationParameterDeclarations()
-
setConfigurationParameterDeclarations
public void setConfigurationParameterDeclarations(ConfigurationParameterDeclarations aDeclarations)
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:
ResourceMetaData.setConfigurationParameterDeclarations(ConfigurationParameterDeclarations)
-
validateConfigurationParameterSettings
public void validateConfigurationParameterSettings() throws ResourceConfigurationExceptionValidates 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:
ResourceMetaData.validateConfigurationParameterSettings()
-
validateConfigurationParameterSettings
protected void validateConfigurationParameterSettings(NameValuePair[] aNVPs, java.lang.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
protected java.lang.Class<?> getClassForParameterType(java.lang.String paramType)
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(org.w3c.dom.Element aElement, XMLParser aParser, XMLParser.ParsingOptions aOptions) throws InvalidXMLExceptionOverridden 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:
XMLizable.buildFromXMLElement(org.w3c.dom.Element, org.apache.uima.util.XMLParser)
-
getXmlizationInfo
protected XmlizationInfo 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
protected static XmlizationInfo getXmlizationInfoForClass()
Static method to get XmlizationInfo, used by subclasses to set up their own XmlizationInfo.- Returns:
- -
-
-