org.apache.uima.resource.metadata.impl

## 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:
    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 inherited from class org.apache.uima.resource.metadata.impl.MetaDataObject_impl

      `serialContext`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ResourceMetaData_impl()` Creates a new `ResourceMetaData_impl`.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `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.
    `ConfigurationParameterDeclarations` | `getConfigurationParameterDeclarations()` Gets the configuration parameter declarations for this Resource.
    `ConfigurationParameterSettings` | `getConfigurationParameterSettings()` Gets the configuration parameter settings for this Resource.
    `String` | `getCopyright()` Gets the copyright notice for this Resource.
    `String` | `getDescription()` Gets the description of this Resource.
    `String` | `getName()` Gets the name of this Resource.
    `String` | `getUUID()` Gets the UUID (Universally Unique Identifier) for this Resource.
    `String` | `getVendor()` Gets the vendor of this Resource.
    `String` | `getVersion()` Gets the version number of this Resource.
    `protected XmlizationInfo` | `getXmlizationInfo()` To be implemented by subclasses to return information describing how to represent this object in XML.
    `protected static XmlizationInfo` | `getXmlizationInfoForClass()` Static method to get XmlizationInfo, used by subclasses to set up their own XmlizationInfo.
    `void` | `resolveImports()` Resolves any import declarations throughout this metadata.
    `void` | `resolveImports(ResourceManager aResourceManager)` Resolves any import declarations throughout this metadata.
    `void` | `setConfigurationParameterDeclarations(ConfigurationParameterDeclarations aDeclarations)` Gets the configuration parameter declarations for this Resource.
    `void` | `setConfigurationParameterSettings(ConfigurationParameterSettings aSettings)` 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` | `setName(String aName)` Sets the name of this Resource.
    `void` | `setUUID(String aUUID)` Sets the UUID (Universally Unique Identifier) for this Resource.
    `void` | `setVendor(String aVendor)` Sets the vendor of this Resource.
    `void` | `setVersion(String aVersion)` Sets the version number of this Resource.
    `protected void` | `validateConfigurationParameterDataTypeMatch(ConfigurationParameter aParam, NameValuePair aNVP)` Validate that a value is of an appropriate data type for assignment to the given parameter.
    `void` | `validateConfigurationParameterSettings()` 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`

    - ### Methods inherited from interface org.apache.uima.util.XMLizable

      `buildFromXMLElement, toXML, toXML, toXML, toXML`

- - ### Constructor Detail

    - #### ResourceMetaData_impl

          public ResourceMetaData_impl()

      Creates a new `ResourceMetaData_impl`.

  - ### Method Detail

    - #### 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
      See Also:
        `ResourceMetaData.resolveImports()`

    - #### 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.setDataPath(String)` method.
      Throws:
        `InvalidXMLException` - if either the import target does not exist or is invalid
      See Also:
        `ResourceMetaData.resolveImports(ResourceManager)`

    - #### 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
      See Also:
        `ResourceMetaData.getUUID()`

    - #### 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
      See Also:
        `ResourceMetaData.setUUID(String)`

    - #### 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
      See Also:
        `ResourceMetaData.getName()`

    - #### 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
      See Also:
        `ResourceMetaData.setName(String)`

    - #### 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
      See Also:
        `ResourceMetaData.getVersion()`

    - #### 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
      See Also:
        `ResourceMetaData.setVersion(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
      See Also:
        `ResourceMetaData.getDescription()`

    - #### 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
      See Also:
        `ResourceMetaData.setDescription(String)`

    - #### 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
      See Also:
        `ResourceMetaData.getVendor()`

    - #### 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
      See Also:
        `ResourceMetaData.setVendor(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
      See Also:
        `ResourceMetaData.getCopyright()`

    - #### 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
      See Also:
        `ResourceMetaData.setCopyright(String)`

    - #### 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.
      See Also:
        `ResourceMetaData.getConfigurationParameterSettings()`

    - #### 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.
      See Also:
        `ResourceMetaData.setConfigurationParameterSettings(ConfigurationParameterSettings)`

    - #### 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
      See Also:
        `ResourceMetaData.getConfigurationParameterDeclarations()`

    - #### 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
      See Also:
        `ResourceMetaData.setConfigurationParameterDeclarations(ConfigurationParameterDeclarations)`

    - #### 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:
        `ResourceMetaData.validateConfigurationParameterSettings()`

    - #### 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:
        `XMLizable.buildFromXMLElement(org.w3c.dom.Element, org.apache.uima.util.XMLParser)`

    - #### 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:
        -

Copyright © 2006–2022 The Apache Software Foundation. All rights reserved.