Class ResourceCreationSpecifierFactory

java.lang.Object
org.apache.uima.fit.factory.ResourceCreationSpecifierFactory

public final class ResourceCreationSpecifierFactory extends Object
  • Method Details

    • createResourceCreationSpecifier

      public static ResourceCreationSpecifier createResourceCreationSpecifier(URL descriptorURL, Object[] parameters) throws InvalidXMLException, IOException
      Parse a ResourceCreationSpecifier from the URL of an XML descriptor file, setting additional configuration parameters as necessary.
      Parameters:
      descriptorURL - The URL of the XML descriptor file.
      parameters - Any additional configuration parameters to be set. These should be supplied as (name, value) pairs, so there should always be an even number of parameters.
      Returns:
      The ResourceCreationSpecifier for the XML descriptor with all the configuration parameters set.
      Throws:
      IOException - if an I/O error occurs
      InvalidXMLException - if the input XML is not valid or does not specify a valid ResourceSpecifier
    • createResourceCreationSpecifier

      public static ResourceCreationSpecifier createResourceCreationSpecifier(XMLInputSource xmlInput, Object[] parameters) throws InvalidXMLException
      Parse a ResourceCreationSpecifier from XML descriptor file input, setting additional configuration parameters as necessary.
      Parameters:
      xmlInput - The descriptor file as an XMLInputSource.
      parameters - Any additional configuration parameters to be set. These should be supplied as (name, value) pairs, so there should always be an even number of parameters.
      Returns:
      The ResourceCreationSpecifier for the XML descriptor with all the configuration parameters set.
      Throws:
      InvalidXMLException - if the input XML is not valid or does not specify a valid ResourceSpecifier
    • createResourceCreationSpecifier

      public static ResourceCreationSpecifier createResourceCreationSpecifier(String descriptorPath, Object[] parameters) throws InvalidXMLException, IOException
      Parse a ResourceCreationSpecifier from an XML descriptor file, setting additional configuration parameters as necessary.
      Parameters:
      descriptorPath - The path to the XML descriptor file.
      parameters - Any additional configuration parameters to be set. These should be supplied as (name, value) pairs, so there should always be an even number of parameters.
      Returns:
      The ResourceCreationSpecifier for the XML descriptor with all the configuration parameters set.
      Throws:
      IOException - if an I/O error occurs
      InvalidXMLException - if the input XML is not valid or does not specify a valid ResourceSpecifier
    • setConfigurationParameters

      public static void setConfigurationParameters(ResourceCreationSpecifier specifier, Object... configurationData)
      Create configuration parameter declarations and settings from a list of (name, value) pairs.
      Parameters:
      specifier - The ResourceCreationSpecifier whose parameters are to be set.
      configurationData - The configuration parameters to be set. These should be supplied as (name, value) pairs, so there should always be an even number of parameters.
    • setConfigurationParameters

      public static void setConfigurationParameters(ResourceCreationSpecifier specifier, ConfigurationParameter[] configurationParameters, Object[] configurationValues)
      Parameters:
      specifier - The ResourceCreationSpecifier whose parameters are to be set.
      configurationParameters - the configuration parameter declarations.
      configurationValues - the configuration parameter values.
    • setConfigurationParameters

      public static void setConfigurationParameters(ResourceMetaData metaData, ConfigurationParameter[] configurationParameters, Object[] configurationValues)
      This method sets the configuration parameters of a resource. The length of configurationParameters and configurationValues should be equal
      Parameters:
      metaData - The ResourceMetaData whose parameters are to be set.
      configurationParameters - an array of configuration parameters
      configurationValues - an array of configuration parameter values