org.apache.uima.fit.factory

## Class ExternalResourceFactory

- java.lang.Object
- - org.apache.uima.fit.factory.ExternalResourceFactory

-     public final class ExternalResourceFactory
      extends Object

  Helper methods for external resources.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `PARAM_RESOURCE_NAME`
    `static String` | `PREFIX_SEPARATOR` Used to separate resource name from key for nested resource.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `bindExternalResource(org.apache.uima.resource.ExternalResourceDescription aRes, String aBindTo, org.apache.uima.resource.ExternalResourceDescription aNestedRes)` Create a new external resource binding.
    `static void` | `bindExternalResource(org.apache.uima.resource.ResourceCreationSpecifier aDesc, String aBindTo, org.apache.uima.resource.ExternalResourceDescription aRes)` Create a new external resource binding.
    `static void` | `bindExternalResource(org.apache.uima.resource.ResourceCreationSpecifier aDesc, String aBindTo, String aRes)` Create a new external resource binding.
    `static void` | `bindExternalResource(org.apache.uima.resource.metadata.ResourceManagerConfiguration aResMgrCfg, String aBindTo, org.apache.uima.resource.ExternalResourceDescription aRes)` Create a new external resource binding.
    `static void` | `bindExternalResource(org.apache.uima.resource.metadata.ResourceManagerConfiguration aResMgrCfg, String aBindTo, String aRes)` Create a new external resource binding.
    `static void` | `bindResource(org.apache.uima.resource.ResourceSpecifier aDesc, Class<?> aApi, Class<? extends org.apache.uima.resource.Resource> aRes, String... aParams)` Scan the given resource specifier for external resource dependencies and whenever a dependency with a compatible type is found, the resource will be bound.
    `static void` | `bindResource(org.apache.uima.resource.ResourceSpecifier aDesc, Class<?> aApi, Class<? extends org.apache.uima.resource.SharedResourceObject> aRes, String aUrl, Object... aParams)` Scan the given resource specifier for external resource dependencies and whenever a dependency is encountered that has a key equal to the API class name, the resource will be bound.
    `static void` | `bindResource(org.apache.uima.resource.ResourceSpecifier aDesc, Class<? extends org.apache.uima.resource.Resource> aRes, String... aParams)` Scan the given resource specifier for external resource dependencies and whenever a dependency with a compatible type is found, the resource will be bound.
    `static void` | `bindResource(org.apache.uima.resource.ResourceSpecifier aDesc, Class<? extends org.apache.uima.resource.SharedResourceObject> aRes, String aUrl, Object... aParams)` Scan the given resource specifier for external resource dependencies and whenever a dependency with a compatible type is found, the resource will be bound.
    `static void` | `bindResource(org.apache.uima.resource.ResourceSpecifier aDesc, org.apache.uima.resource.ExternalResourceDescription aResDesc)` Scan the given resource specifier for external resource dependencies and whenever a dependency with a compatible type is found, the given resource is bound to it.
    `static void` | `bindResource(org.apache.uima.resource.ResourceSpecifier aDesc, String aKey, Class<? extends org.apache.uima.resource.Resource> aRes, String... aParams)` Scan the given resource specifier for external resource dependencies and whenever a dependency with the given key is encountered, the given resource is bound to it.
    `static void` | `bindResource(org.apache.uima.resource.ResourceSpecifier aDesc, String aKey, Class<? extends org.apache.uima.resource.SharedResourceObject> aRes, String aUrl, Object... aParams)` Scan the given resource specifier for external resource dependencies and whenever a dependency with the given key is encountered the resource will be bound.
    `static void` | `bindResource(org.apache.uima.resource.ResourceSpecifier aDesc, String aKey, org.apache.uima.resource.ExternalResourceDescription aResDesc)` Scan the given resource specifier for external resource dependencies and whenever a dependency with the given key is encountered, the given resource is bound to it.
    `static void` | `bindResource(org.apache.uima.resource.ResourceSpecifier aDesc, String aKey, File aFile)` Scan the given resource specifier for external resource dependencies and whenever a dependency is encounter that has the specified key, the resource will be bound.
    `static void` | `bindResource(org.apache.uima.resource.ResourceSpecifier aDesc, String aKey, String aUrl)` Scan the given resource specifier for external resource dependencies and whenever a dependency is encounter that has the specified key, the resource will be bound.
    `static void` | `bindResource(org.apache.uima.resource.ResourceSpecifier aDesc, String aKey, URL aUrl)` Scan the given resource specifier for external resource dependencies and whenever a dependency is encounter that has the specified key, the resource will be bound.
    `static void` | `createDependency(org.apache.uima.resource.ResourceSpecifier aDesc, String aKey, Class<?> aApi)` Create a new dependency for the specified resource and bind it.
    `static void` | `createDependencyAndBind(org.apache.uima.analysis_engine.AnalysisEngineDescription aDesc, String aKey, Class<? extends org.apache.uima.resource.SharedResourceObject> aImpl, String aUrl, Object... aParams)` Create a new dependency for the specified resource and bind it.
    `static void` | `createDependencyAndBind(org.apache.uima.resource.ResourceSpecifier aDesc, String aKey, Class<? extends org.apache.uima.resource.Resource> aImpl, Class<?> aApi, String... aParams)` Create a new dependency for the specified resource and bind it.
    `static void` | `createDependencyAndBind(org.apache.uima.resource.ResourceSpecifier aDesc, String aKey, Class<? extends org.apache.uima.resource.Resource> aImpl, String... aParams)` Create a new dependency for the specified resource and bind it.
    `static org.apache.uima.resource.metadata.ExternalResourceBinding` | `createExternalResourceBinding(String aKey, org.apache.uima.resource.ExternalResourceDescription aResource)` Create an external resource binding.
    `static org.apache.uima.resource.metadata.ExternalResourceBinding` | `createExternalResourceBinding(String aKey, String aResourceKey)` Create an external resource binding.
    `static org.apache.uima.resource.ExternalResourceDependency[]` | `createExternalResourceDependencies(Class<?> cls)`
    `static org.apache.uima.resource.ExternalResourceDependency` | `createExternalResourceDependency(Field field)` Creates an ExternalResourceDependency for a field annotated with `ExternalResource`.
    `static org.apache.uima.resource.ExternalResourceDependency` | `createExternalResourceDependency(String aKey, Class<?> aInterface, boolean aOptional, String aDescription)` Creates an ExternalResourceDependency for a given key and interface
    `static org.apache.uima.resource.ExternalResourceDescription` | `createExternalResourceDescription(Class<? extends org.apache.uima.resource.Resource> aInterface, Object... aParams)` Create an external resource description for a custom resource.
    `static org.apache.uima.resource.ExternalResourceDescription` | `createExternalResourceDescription(Class<? extends org.apache.uima.resource.SharedResourceObject> aInterface, File aFile, Object... aParams)` Create an external resource description for a `SharedResourceObject`.
    `static org.apache.uima.resource.ExternalResourceDescription` | `createExternalResourceDescription(Class<? extends org.apache.uima.resource.SharedResourceObject> aInterface, String aUrl, Object... aParams)` Create an external resource description for a `SharedResourceObject`.
    `static org.apache.uima.resource.ExternalResourceDescription` | `createExternalResourceDescription(Class<? extends org.apache.uima.resource.SharedResourceObject> aInterface, URL aUrl, Object... aParams)` Create an external resource description for a `SharedResourceObject`.
    `static org.apache.uima.resource.ExternalResourceDescription` | `createExternalResourceDescription(String aName, Class<? extends org.apache.uima.resource.Resource> aInterface, Object... aParams)` Create an external resource description for a custom resource.
    `static org.apache.uima.resource.ExternalResourceDescription` | `createExternalResourceDescription(String aName, Class<? extends org.apache.uima.resource.SharedResourceObject> aInterface, String aUrl, Object... aParams)` Create an external resource description for a `SharedResourceObject`.
    `static org.apache.uima.resource.ExternalResourceDescription` | `createExternalResourceDescription(String aName, String aUrl)` Create an external resource description for a file addressable via an URL.
    `static <R extends org.apache.uima.resource.Resource> R` | `createResource(Class<R> resourceClass, Object... params)` Create an instance of a UIMA shared/external resource class.
    `static <R extends org.apache.uima.resource.Resource> R` | `createResource(Class<R> resourceClass, org.apache.uima.resource.ResourceManager resMgr, Object... params)` Create an instance of a UIMA shared/external resource class.
    `protected static Map<String,org.apache.uima.resource.ExternalResourceDescription>` | `extractExternalResourceParameters(Object[] configurationData)` Extracts the external resource from the configuration parameters and nulls out these parameters.
    `protected static String` | `getImplementationName(org.apache.uima.resource.ExternalResourceDescription aDesc)` Find the name of the class implementing this resource.
    `static boolean` | `isExternalResourceField(Field field)` This method determines if the field is annotated with `ExternalResource`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### PARAM_RESOURCE_NAME

          public static final String PARAM_RESOURCE_NAME

      See Also:
        Constant Field Values

    - #### PREFIX_SEPARATOR

          public static final String PREFIX_SEPARATOR

      Used to separate resource name from key for nested resource.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### isExternalResourceField

          public static boolean isExternalResourceField(Field field)

      This method determines if the field is annotated with `ExternalResource`.
      Parameters:
        `field` - the field to analyze
      Returns:
        whether the field is marked as an external resource

    - #### createExternalResourceDescription

          public static org.apache.uima.resource.ExternalResourceDescription createExternalResourceDescription(Class<? extends org.apache.uima.resource.Resource> aInterface,
                                                                                                               Object... aParams)

      Create an external resource description for a custom resource.
      Parameters:
        `aInterface` - the interface the resource should implement.
        `aParams` - parameters passed to the resource when it is created.
      Returns:
        the description.
      See Also:
        `CustomResourceSpecifier`

    - #### createExternalResourceDescription

          public static org.apache.uima.resource.ExternalResourceDescription createExternalResourceDescription(String aName,
                                                                                                               Class<? extends org.apache.uima.resource.Resource> aInterface,
                                                                                                               Object... aParams)

      Create an external resource description for a custom resource.
      Parameters:
        `aName` - the name of the resource (the key).
        `aInterface` - the interface the resource should implement.
        `aParams` - parameters passed to the resource when it is created.
      Returns:
        the description.
      See Also:
        `CustomResourceSpecifier`

    - #### createExternalResourceDescription

          public static org.apache.uima.resource.ExternalResourceDescription createExternalResourceDescription(Class<? extends org.apache.uima.resource.SharedResourceObject> aInterface,
                                                                                                               String aUrl,
                                                                                                               Object... aParams)

      Create an external resource description for a `SharedResourceObject`.
      Parameters:
        `aInterface` - the interface the resource should implement.
        `aUrl` - the URL from which the resource is initialized.
        `aParams` - parameters passed to the resource when it is created.
      Returns:
        the description.
      See Also:
        `ConfigurableDataResourceSpecifier`, `SharedResourceObject`

    - #### createExternalResourceDescription

          public static org.apache.uima.resource.ExternalResourceDescription createExternalResourceDescription(Class<? extends org.apache.uima.resource.SharedResourceObject> aInterface,
                                                                                                               URL aUrl,
                                                                                                               Object... aParams)

      Create an external resource description for a `SharedResourceObject`.
      Parameters:
        `aInterface` - the interface the resource should implement.
        `aUrl` - the URL from which the resource is initialized.
        `aParams` - parameters passed to the resource when it is created.
      Returns:
        the description.
      See Also:
        `ConfigurableDataResourceSpecifier`, `SharedResourceObject`

    - #### createExternalResourceDescription

          public static org.apache.uima.resource.ExternalResourceDescription createExternalResourceDescription(Class<? extends org.apache.uima.resource.SharedResourceObject> aInterface,
                                                                                                               File aFile,
                                                                                                               Object... aParams)

      Create an external resource description for a `SharedResourceObject`.
      Parameters:
        `aInterface` - the interface the resource should implement.
        `aFile` - the file from which the resource is initialized.
        `aParams` - parameters passed to the resource when it is created.
      Returns:
        the description.
      See Also:
        `ConfigurableDataResourceSpecifier`, `SharedResourceObject`

    - #### createExternalResourceDescription

          public static org.apache.uima.resource.ExternalResourceDescription createExternalResourceDescription(String aName,
                                                                                                               Class<? extends org.apache.uima.resource.SharedResourceObject> aInterface,
                                                                                                               String aUrl,
                                                                                                               Object... aParams)

      Create an external resource description for a `SharedResourceObject`.
      Parameters:
        `aName` - the name of the resource (the key).
        `aInterface` - the interface the resource should implement.
        `aUrl` - the URL from which the resource is initialized.
        `aParams` - parameters passed to the resource when it is created.
      Returns:
        the description.
      See Also:
        `ConfigurableDataResourceSpecifier`, `SharedResourceObject`

    - #### createExternalResourceDescription

          public static org.apache.uima.resource.ExternalResourceDescription createExternalResourceDescription(String aName,
                                                                                                               String aUrl)

      Create an external resource description for a file addressable via an URL.
      Parameters:
        `aName` - the name of the resource (the key).
        `aUrl` - a URL.
      Returns:
        the description.
      See Also:
        `FileResourceSpecifier`

    - #### createExternalResourceBinding

          public static org.apache.uima.resource.metadata.ExternalResourceBinding createExternalResourceBinding(String aKey,
                                                                                                                org.apache.uima.resource.ExternalResourceDescription aResource)

      Create an external resource binding.
      Parameters:
        `aKey` - the key to bind to.
        `aResource` - the resource to bind.
      Returns:
        the description.

    - #### createExternalResourceBinding

          public static org.apache.uima.resource.metadata.ExternalResourceBinding createExternalResourceBinding(String aKey,
                                                                                                                String aResourceKey)

      Create an external resource binding.
      Parameters:
        `aKey` - the key to bind to.
        `aResourceKey` - the resource key to bind.
      Returns:
        the description.

    - #### createExternalResourceDependency

          public static org.apache.uima.resource.ExternalResourceDependency createExternalResourceDependency(Field field)

      Creates an ExternalResourceDependency for a field annotated with `ExternalResource`.
      Parameters:
        `field` - the field to analyze
      Returns:
        a external resource dependency

    - #### createExternalResourceDependency

          public static org.apache.uima.resource.ExternalResourceDependency createExternalResourceDependency(String aKey,
                                                                                                             Class<?> aInterface,
                                                                                                             boolean aOptional,
                                                                                                             String aDescription)

      Creates an ExternalResourceDependency for a given key and interface
      Parameters:
        `aKey` - the resource key
        `aInterface` - the resource interface
        `aOptional` - determines whether the dependency is optional
        `aDescription` - a description of the resource
      Returns:
        the external resource dependency

    - #### createExternalResourceDependencies

          public static org.apache.uima.resource.ExternalResourceDependency[] createExternalResourceDependencies(Class<?> cls)
                                                                                                          throws org.apache.uima.resource.ResourceInitializationException

      Parameters:
        `cls` - the class to analyze
      Returns:
        the external resource dependencies
      Throws:
        `org.apache.uima.resource.ResourceInitializationException` - if the external resource dependencies could not be created

    - #### bindResource

          public static void bindResource(org.apache.uima.resource.ResourceSpecifier aDesc,
                                          String aKey,
                                          URL aUrl)
                                   throws org.apache.uima.util.InvalidXMLException

      Scan the given resource specifier for external resource dependencies and whenever a dependency is encounter that has the specified key, the resource will be bound.

      Caveat: If you use this method, you may expect that `DataResource.getUrl()` or `DataResource.getUri()` will return the same URL that you have specified here. This may NOT be the case. UIMA will internally try to resolve the URL via a `ResourceManager`. If it cannot resolve a remove URL, this mechanism will think it may be a local file and will return some local path - or it may redirect it to some location as though fit by the `ResourceManager`.

      Parameters:
        `aDesc` - a description.
        `aKey` - the key to bind to.
        `aUrl` - a URL.
      Throws:
        `org.apache.uima.util.InvalidXMLException` - if import resolution failed
      See Also:
        `FileResourceSpecifier`

    - #### bindResource

          public static void bindResource(org.apache.uima.resource.ResourceSpecifier aDesc,
                                          String aKey,
                                          File aFile)
                                   throws org.apache.uima.util.InvalidXMLException

      Scan the given resource specifier for external resource dependencies and whenever a dependency is encounter that has the specified key, the resource will be bound.

      Caveat: If you use this method, you may expect that `DataResource.getUrl()` or `DataResource.getUri()` will return the URL of the file that you have specified here. This may NOT be the case. UIMA will internally try to resolve the URL via a `ResourceManager`. If it cannot resolve a remove URL, this mechanism will think it may be a local file and will return some local path - or it may redirect it to some location as though fit by the `ResourceManager`.

      Parameters:
        `aDesc` - a description.
        `aKey` - the key to bind to.
        `aFile` - a file.
      Throws:
        `org.apache.uima.util.InvalidXMLException` - if import resolution failed
      See Also:
        `FileResourceSpecifier`

    - #### bindResource

          public static void bindResource(org.apache.uima.resource.ResourceSpecifier aDesc,
                                          String aKey,
                                          String aUrl)
                                   throws org.apache.uima.util.InvalidXMLException

      Scan the given resource specifier for external resource dependencies and whenever a dependency is encounter that has the specified key, the resource will be bound.

      Caveat: If you use this method, you may expect that `DataResource.getUrl()` or `DataResource.getUri()` will return the same URL that you have specified here. This is may NOT be the case. UIMA will internally try to resolve the URL via a `ResourceManager`. If it cannot resolve a remove URL, this mechanism will think it may be a local file and will return some local path - or it may redirect it to some location as though fit by the `ResourceManager`.

      Parameters:
        `aDesc` - a description.
        `aKey` - the key to bind to.
        `aUrl` - a URL.
      Throws:
        `org.apache.uima.util.InvalidXMLException` - if import resolution failed
      See Also:
        `FileResourceSpecifier`

    - #### bindResource

          public static void bindResource(org.apache.uima.resource.ResourceSpecifier aDesc,
                                          Class<? extends org.apache.uima.resource.Resource> aRes,
                                          String... aParams)
                                   throws org.apache.uima.util.InvalidXMLException,
                                          ClassNotFoundException

      Scan the given resource specifier for external resource dependencies and whenever a dependency with a compatible type is found, the resource will be bound.
      Parameters:
        `aDesc` - a description.
        `aRes` - the resource to bind.
        `aParams` - parameters passed to the resource when it is created.
      Throws:
        `org.apache.uima.util.InvalidXMLException` - if import resolution failed
        `ClassNotFoundException` - if the resource implementation class or interface class could not be accessed
      See Also:
        `CustomResourceSpecifier`

    - #### bindResource

          public static void bindResource(org.apache.uima.resource.ResourceSpecifier aDesc,
                                          Class<?> aApi,
                                          Class<? extends org.apache.uima.resource.Resource> aRes,
                                          String... aParams)
                                   throws org.apache.uima.util.InvalidXMLException,
                                          ClassNotFoundException

      Scan the given resource specifier for external resource dependencies and whenever a dependency with a compatible type is found, the resource will be bound.
      Parameters:
        `aDesc` - a description.
        `aApi` - the resource interface.
        `aRes` - the resource to bind.
        `aParams` - parameters passed to the resource when it is created.
      Throws:
        `org.apache.uima.util.InvalidXMLException` - if import resolution failed
        `ClassNotFoundException` - if the resource implementation class or interface class could not be accessed
      See Also:
        `CustomResourceSpecifier`

    - #### bindResource

          public static void bindResource(org.apache.uima.resource.ResourceSpecifier aDesc,
                                          Class<? extends org.apache.uima.resource.SharedResourceObject> aRes,
                                          String aUrl,
                                          Object... aParams)
                                   throws org.apache.uima.util.InvalidXMLException,
                                          ClassNotFoundException

      Scan the given resource specifier for external resource dependencies and whenever a dependency with a compatible type is found, the resource will be bound.
      Parameters:
        `aDesc` - a description.
        `aRes` - the resource to bind.
        `aUrl` - the URL from which the resource is initialized.
        `aParams` - parameters passed to the resource when it is created.
      Throws:
        `org.apache.uima.util.InvalidXMLException` - if import resolution failed
        `ClassNotFoundException` - if the resource implementation class or interface class could not be accessed
      See Also:
        `SharedResourceObject`

    - #### bindResource

          public static void bindResource(org.apache.uima.resource.ResourceSpecifier aDesc,
                                          Class<?> aApi,
                                          Class<? extends org.apache.uima.resource.SharedResourceObject> aRes,
                                          String aUrl,
                                          Object... aParams)
                                   throws org.apache.uima.util.InvalidXMLException

      Scan the given resource specifier for external resource dependencies and whenever a dependency is encountered that has a key equal to the API class name, the resource will be bound.
      Parameters:
        `aDesc` - a description.
        `aApi` - the resource interface.
        `aRes` - the resource to bind.
        `aUrl` - the URL from which the resource is initialized.
        `aParams` - parameters passed to the resource when it is created.
      Throws:
        `org.apache.uima.util.InvalidXMLException` - if import resolution failed
      See Also:
        `SharedResourceObject`

    - #### bindResource

          public static void bindResource(org.apache.uima.resource.ResourceSpecifier aDesc,
                                          String aKey,
                                          Class<? extends org.apache.uima.resource.SharedResourceObject> aRes,
                                          String aUrl,
                                          Object... aParams)
                                   throws org.apache.uima.util.InvalidXMLException

      Scan the given resource specifier for external resource dependencies and whenever a dependency with the given key is encountered the resource will be bound.
      Parameters:
        `aDesc` - a description.
        `aKey` - the key to bind to.
        `aRes` - the resource to bind.
        `aUrl` - the URL from which the resource is initialized.
        `aParams` - parameters passed to the resource when it is created.
      Throws:
        `org.apache.uima.util.InvalidXMLException` - if import resolution failed
      See Also:
        `SharedResourceObject`

    - #### bindResource

          public static void bindResource(org.apache.uima.resource.ResourceSpecifier aDesc,
                                          String aKey,
                                          Class<? extends org.apache.uima.resource.Resource> aRes,
                                          String... aParams)
                                   throws org.apache.uima.util.InvalidXMLException

      Scan the given resource specifier for external resource dependencies and whenever a dependency with the given key is encountered, the given resource is bound to it.
      Parameters:
        `aDesc` - a description.
        `aKey` - the key to bind to.
        `aRes` - the resource to bind.
        `aParams` - parameters passed to the resource when it is created.
      Throws:
        `org.apache.uima.util.InvalidXMLException` - if import resolution failed
      See Also:
        `CustomResourceSpecifier`

    - #### bindResource

          public static void bindResource(org.apache.uima.resource.ResourceSpecifier aDesc,
                                          org.apache.uima.resource.ExternalResourceDescription aResDesc)
                                   throws org.apache.uima.util.InvalidXMLException,
                                          ClassNotFoundException

      Scan the given resource specifier for external resource dependencies and whenever a dependency with a compatible type is found, the given resource is bound to it.
      Parameters:
        `aDesc` - a description.
        `aResDesc` - the resource description.
      Throws:
        `org.apache.uima.util.InvalidXMLException` - if import resolution failed
        `ClassNotFoundException` - if the resource implementation class or interface class could not be accessed

    - #### bindResource

          public static void bindResource(org.apache.uima.resource.ResourceSpecifier aDesc,
                                          String aKey,
                                          org.apache.uima.resource.ExternalResourceDescription aResDesc)
                                   throws org.apache.uima.util.InvalidXMLException

      Scan the given resource specifier for external resource dependencies and whenever a dependency with the given key is encountered, the given resource is bound to it.
      Parameters:
        `aDesc` - a description.
        `aKey` - the key to bind to.
        `aResDesc` - the resource description.
      Throws:
        `org.apache.uima.util.InvalidXMLException` - if import resolution failed

    - #### createDependencyAndBind

          public static void createDependencyAndBind(org.apache.uima.resource.ResourceSpecifier aDesc,
                                                     String aKey,
                                                     Class<? extends org.apache.uima.resource.Resource> aImpl,
                                                     String... aParams)
                                              throws org.apache.uima.util.InvalidXMLException

      Create a new dependency for the specified resource and bind it. This method is helpful for UIMA components that do not use the uimaFIT `ExternalResource` annotation, because no external resource dependencies can be automatically generated by uimaFIT for such components.
      Parameters:
        `aDesc` - a description.
        `aKey` - the key to bind to.
        `aImpl` - the resource implementation.
        `aParams` - additional parameters supported by the resource.
      Throws:
        `org.apache.uima.util.InvalidXMLException` - if import resolution failed

    - #### createDependencyAndBind

          public static void createDependencyAndBind(org.apache.uima.resource.ResourceSpecifier aDesc,
                                                     String aKey,
                                                     Class<? extends org.apache.uima.resource.Resource> aImpl,
                                                     Class<?> aApi,
                                                     String... aParams)
                                              throws org.apache.uima.util.InvalidXMLException

      Create a new dependency for the specified resource and bind it. This method is helpful for UIMA components that do not use the uimaFIT `ExternalResource` annotation, because no external resource dependencies can be automatically generated by uimaFIT for such components.
      Parameters:
        `aDesc` - a description.
        `aKey` - the key to bind to.
        `aImpl` - the resource implementation.
        `aApi` - the resource interface
        `aParams` - additional parameters supported by the resource.
      Throws:
        `org.apache.uima.util.InvalidXMLException` - if import resolution failed

    - #### createDependency

          public static void createDependency(org.apache.uima.resource.ResourceSpecifier aDesc,
                                              String aKey,
                                              Class<?> aApi)

      Create a new dependency for the specified resource and bind it. This method is helpful for UIMA components that do not use the uimaFIT `ExternalResource` annotation, because no external resource dependencies can be automatically generated by uimaFIT for such components.
      Parameters:
        `aDesc` - a description.
        `aKey` - the key to bind to.
        `aApi` - the resource API.

    - #### createDependencyAndBind

          public static void createDependencyAndBind(org.apache.uima.analysis_engine.AnalysisEngineDescription aDesc,
                                                     String aKey,
                                                     Class<? extends org.apache.uima.resource.SharedResourceObject> aImpl,
                                                     String aUrl,
                                                     Object... aParams)
                                              throws org.apache.uima.util.InvalidXMLException

      Create a new dependency for the specified resource and bind it. This method is helpful for UIMA components that do not use the uimaFIT `ExternalResource` annotation, because no external resource dependencies can be automatically generated by uimaFIT for such components.
      Parameters:
        `aDesc` - a description.
        `aKey` - the key to bind to.
        `aImpl` - the resource implementation.
        `aUrl` - the resource URL.
        `aParams` - additional parameters supported by the resource.
      Throws:
        `org.apache.uima.util.InvalidXMLException` - if import resolution failed

    - #### bindExternalResource

          public static void bindExternalResource(org.apache.uima.resource.metadata.ResourceManagerConfiguration aResMgrCfg,
                                                  String aBindTo,
                                                  org.apache.uima.resource.ExternalResourceDescription aRes)

      Create a new external resource binding.
      Parameters:
        `aResMgrCfg` - the resource manager to create the binding in.
        `aBindTo` - what key to bind to.
        `aRes` - the resource that should be bound.

    - #### bindExternalResource

          public static void bindExternalResource(org.apache.uima.resource.ExternalResourceDescription aRes,
                                                  String aBindTo,
                                                  org.apache.uima.resource.ExternalResourceDescription aNestedRes)

      Create a new external resource binding.
      Parameters:
        `aRes` - the resource to bind to
        `aBindTo` - what key to bind to.
        `aNestedRes` - the resource that should be bound.

    - #### bindExternalResource

          public static void bindExternalResource(org.apache.uima.resource.ResourceCreationSpecifier aDesc,
                                                  String aBindTo,
                                                  org.apache.uima.resource.ExternalResourceDescription aRes)

      Create a new external resource binding.
      Parameters:
        `aDesc` - the specifier to create the binding in.
        `aBindTo` - what key to bind to.
        `aRes` - the resource that should be bound.

    - #### bindExternalResource

          public static void bindExternalResource(org.apache.uima.resource.metadata.ResourceManagerConfiguration aResMgrCfg,
                                                  String aBindTo,
                                                  String aRes)

      Create a new external resource binding.
      Parameters:
        `aResMgrCfg` - the resource manager to create the binding in.
        `aBindTo` - what key to bind to.
        `aRes` - the resource that should be bound.

    - #### bindExternalResource

          public static void bindExternalResource(org.apache.uima.resource.ResourceCreationSpecifier aDesc,
                                                  String aBindTo,
                                                  String aRes)

      Create a new external resource binding.
      Parameters:
        `aDesc` - the specifier to create the binding in.
        `aBindTo` - what key to bind to.
        `aRes` - the resource that should be bound.

    - #### getImplementationName

          protected static String getImplementationName(org.apache.uima.resource.ExternalResourceDescription aDesc)

      Find the name of the class implementing this resource. The location where this name is stored varies, depending if the resource extends `SharedResourceObject` or implements `Resource`.
      Parameters:
        `aDesc` - the external resource description.
      Returns:
        the implementation name.

    - #### extractExternalResourceParameters

          protected static Map<String,org.apache.uima.resource.ExternalResourceDescription> extractExternalResourceParameters(Object[] configurationData)

      Extracts the external resource from the configuration parameters and nulls out these parameters. Mind that the array passed to this method is modified by the method.
      Parameters:
        `configurationData` - the configuration parameters.
      Returns:
        extRes the external resource parameters.

    - #### createResource

          public static <R extends org.apache.uima.resource.Resource> R createResource(Class<R> resourceClass,
                                                                                       Object... params)
                                                                                throws org.apache.uima.resource.ResourceInitializationException

      Create an instance of a UIMA shared/external resource class.
      Type Parameters:
        `R` - the resource type.
      Parameters:
        `resourceClass` - the class implementing the resource.
        `params` - parameters passed to the resource when it is created. Each parameter consists of two arguments, the first being the name and the second being the parameter value
      Returns:
        the resource instance.
      Throws:
        `org.apache.uima.resource.ResourceInitializationException` - if there was a problem instantiating the resource.

    - #### createResource

          public static <R extends org.apache.uima.resource.Resource> R createResource(Class<R> resourceClass,
                                                                                       org.apache.uima.resource.ResourceManager resMgr,
                                                                                       Object... params)
                                                                                throws org.apache.uima.resource.ResourceInitializationException

      Create an instance of a UIMA shared/external resource class.
      Type Parameters:
        `R` - the resource type.
      Parameters:
        `resourceClass` - the class implementing the resource.
        `resMgr` - a resource manager (optional).
        `params` - parameters passed to the resource when it is created. Each parameter consists of two arguments, the first being the name and the second being the parameter value
      Returns:
        the resource instance.
      Throws:
        `org.apache.uima.resource.ResourceInitializationException` - if there was a problem instantiating the resource.

Copyright © 2012–2020 The Apache Software Foundation. All rights reserved.