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:
Serializable, Cloneable, MetaDataObject, ResourceMetaData, XMLizable
Direct Known Subclasses:
AnalysisEngineMetaData_impl

public class ResourceMetaData_impl extends MetaDataObject_impl implements ResourceMetaData
Reference implementation of ResourceMetaData.
See Also:
  • Constructor Details

    • ResourceMetaData_impl

      public ResourceMetaData_impl()
      Creates a new ResourceMetaData_impl.
  • Method Details

    • resolveImports

      public void resolveImports() throws InvalidXMLException
      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 interface ResourceMetaData
      Throws:
      InvalidXMLException - if either the import target does not exist or is invalid
    • resolveImports

      public void resolveImports(ResourceManager aResourceManager) throws InvalidXMLException
      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 interface ResourceMetaData
      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 the ResourceManager.setDataPathElements(java.lang.String...) method.
      Throws:
      InvalidXMLException - if either the import target does not exist or is invalid
    • getUUID

      public String getUUID()
      Description copied from interface: ResourceMetaData
      Gets the UUID (Universally Unique Identifier) for this Resource.
      Specified by:
      getUUID in interface ResourceMetaData
      Returns:
      the UUID for this Resource
    • setUUID

      public void setUUID(String aUUID)
      Description copied from interface: ResourceMetaData
      Sets the UUID (Universally Unique Identifier) for this Resource.
      Specified by:
      setUUID in interface ResourceMetaData
      Parameters:
      aUUID - the UUID for this Resource
    • getName

      public String getName()
      Description copied from interface: ResourceMetaData
      Gets the name of this Resource.
      Specified by:
      getName in interface ResourceMetaData
      Returns:
      the name of this Resource
    • setName

      public void setName(String aName)
      Description copied from interface: ResourceMetaData
      Sets the name of this Resource.
      Specified by:
      setName in interface ResourceMetaData
      Parameters:
      aName - the name of this Resource
    • getVersion

      public String getVersion()
      Description copied from interface: ResourceMetaData
      Gets the version number of this Resource.
      Specified by:
      getVersion in interface ResourceMetaData
      Returns:
      the version number of this Resource, as a String
    • setVersion

      public void setVersion(String aVersion)
      Description copied from interface: ResourceMetaData
      Sets the version number of this Resource.
      Specified by:
      setVersion in interface ResourceMetaData
      Parameters:
      aVersion - the version number of this Resource, as a String
    • getDescription

      public String getDescription()
      Description copied from interface: ResourceMetaData
      Gets the description of this Resource.
      Specified by:
      getDescription in interface ResourceMetaData
      Returns:
      the description of this Resource
    • setDescription

      public void setDescription(String aDescription)
      Description copied from interface: ResourceMetaData
      Sets the description of this Resource.
      Specified by:
      setDescription in interface ResourceMetaData
      Parameters:
      aDescription - the description of this Resource
    • getVendor

      public String getVendor()
      Description copied from interface: ResourceMetaData
      Gets the vendor of this Resource.
      Specified by:
      getVendor in interface ResourceMetaData
      Returns:
      the vendor of this Resource, as a String
    • setVendor

      public void setVendor(String aVendor)
      Description copied from interface: ResourceMetaData
      Sets the vendor of this Resource.
      Specified by:
      setVendor in interface ResourceMetaData
      Parameters:
      aVendor - the vendor of this Resource, as a String
    • getCopyright

      public String getCopyright()
      Description copied from interface: ResourceMetaData
      Gets the copyright notice for this Resource.
      Specified by:
      getCopyright in interface ResourceMetaData
      Returns:
      the copyright notice for this Resource
    • setCopyright

      public void setCopyright(String aCopyright)
      Description copied from interface: ResourceMetaData
      Sets the copyright notice for this Resource.
      Specified by:
      setCopyright in interface ResourceMetaData
      Parameters:
      aCopyright - the copyright notice for this Resource
    • getConfigurationParameterSettings

      public ConfigurationParameterSettings getConfigurationParameterSettings()
      Description copied from interface: ResourceMetaData
      Gets the configuration parameter settings for this Resource.
      Specified by:
      getConfigurationParameterSettings in interface ResourceMetaData
      Returns:
      an object containing the settings for this Resource's configuration parameters.
    • setConfigurationParameterSettings

      public void setConfigurationParameterSettings(ConfigurationParameterSettings aSettings)
      Description copied from interface: ResourceMetaData
      Sets the configuration parameter settings for this Resource.
      Specified by:
      setConfigurationParameterSettings in interface ResourceMetaData
      Parameters:
      aSettings - an object containing the settings for this Resource's configuration parameters.
    • getConfigurationParameterDeclarations

      public ConfigurationParameterDeclarations getConfigurationParameterDeclarations()
      Description copied from interface: ResourceMetaData
      Gets the configuration parameter declarations for this Resource.
      Specified by:
      getConfigurationParameterDeclarations in interface ResourceMetaData
      Returns:
      an object containing the configuration parameter declarations
    • setConfigurationParameterDeclarations

      public void setConfigurationParameterDeclarations(ConfigurationParameterDeclarations aDeclarations)
      Description copied from interface: ResourceMetaData
      Gets the configuration parameter declarations for this Resource.
      Specified by:
      setConfigurationParameterDeclarations in interface ResourceMetaData
      Parameters:
      aDeclarations - an object containing the configuration parameter declarations
    • validateConfigurationParameterSettings

      public void validateConfigurationParameterSettings() throws ResourceConfigurationException
      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 interface ResourceMetaData
      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 settings
      aGroupName - the group
      aParamDecls - 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 parameter
      aNVP - name value pair containing candidate value
      Throws:
      ResourceConfigurationException - if the data types do not match
    • getClassForParameterType

      protected Class<?> getClassForParameterType(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(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 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:
    • 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
    • getXmlizationInfoForClass

      protected static XmlizationInfo getXmlizationInfoForClass()
      Static method to get XmlizationInfo, used by subclasses to set up their own XmlizationInfo.
      Returns:
      -