You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by re...@apache.org on 2020/02/07 13:52:21 UTC

[uima-uimafit] branch sync-v2-to-master created (now f071cc4)

This is an automated email from the ASF dual-hosted git repository.

rec pushed a change to branch sync-v2-to-master
in repository https://gitbox.apache.org/repos/asf/uima-uimafit.git.


      at f071cc4  Merge branch 'master-v2' into sync-v2-to-master

This branch includes the following new commits:

     new 1b317de  Merge branch 'master-v2' into sync-v2-to-master
     new f071cc4  Merge branch 'master-v2' into sync-v2-to-master

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[uima-uimafit] 02/02: Merge branch 'master-v2' into sync-v2-to-master

Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rec pushed a commit to branch sync-v2-to-master
in repository https://gitbox.apache.org/repos/asf/uima-uimafit.git

commit f071cc480da1f8be8d8eb6f332882c1488fb88ac
Merge: 1b317de 36de13c
Author: Richard Eckart de Castilho <re...@apache.org>
AuthorDate: Fri Feb 7 14:51:31 2020 +0100

    Merge branch 'master-v2' into sync-v2-to-master
    
    * master-v2:
      [UIMA-6186] Factory methods for resource instances
      [UIMA-6186] Factory methods for resource instances

 .../java/org/apache/uima/fit/factory/ExternalResourceFactory.java   | 6 +++---
 .../org/apache/uima/fit/factory/ResourceManagerFactoryTest.java     | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --cc uimafit-core/src/main/java/org/apache/uima/fit/factory/ExternalResourceFactory.java
index 6a1dc2b,86869ad..e55aedb
--- a/uimafit-core/src/main/java/org/apache/uima/fit/factory/ExternalResourceFactory.java
+++ b/uimafit-core/src/main/java/org/apache/uima/fit/factory/ExternalResourceFactory.java
@@@ -1292,9 -1295,9 +1292,9 @@@ public final class ExternalResourceFact
     *           if there was a problem instantiating the resource.
     */
    @SuppressWarnings("unchecked")
-   public static <R> R createExternalResource(Class<? extends Resource> resourceClass,
+   public static <R extends Resource> R createResource(Class<R> resourceClass,
            ResourceManager resMgr, Object... params) throws ResourceInitializationException {
 -    ExternalResourceDescription res = createExternalResourceDescription(resourceClass, params);
 +    ExternalResourceDescription res = createResourceDescription(resourceClass, params);
      return (R) produceResource(resourceClass, res.getResourceSpecifier(), resMgr, emptyMap());
    }
    


[uima-uimafit] 01/02: Merge branch 'master-v2' into sync-v2-to-master

Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rec pushed a commit to branch sync-v2-to-master
in repository https://gitbox.apache.org/repos/asf/uima-uimafit.git

commit 1b317de0ceab64b467318452ab2fc06afea9e9a6
Merge: 100dd61 a2dec8a
Author: Richard Eckart de Castilho <re...@apache.org>
AuthorDate: Mon Feb 3 08:39:08 2020 +0100

    Merge branch 'master-v2' into sync-v2-to-master
    
    * master-v2:
      [UIMA-6186] Factory methods for resource instances
      [UIMA-6169] Support Charset-typed parameters in components
    
    # Conflicts:
    #	uimafit-core/pom.xml
    #	uimafit-core/src/main/java/org/apache/uima/fit/factory/ExternalResourceFactory.java

 uimafit-core/pom.xml                               |   6 +
 .../ConfigurationParameterInitializer.java         |  74 ++--
 .../uima/fit/factory/ExternalResourceFactory.java  |  60 +++-
 ...{PropertyEditorUtil.java => ChatsetEditor.java} |  29 +-
 .../propertyeditors/PropertyEditorUtil.java        |   3 +
 .../ConfigurationParameterInitializerTest.java     | 385 ++++++++++++++++++++-
 .../fit/factory/ResourceManagerFactoryTest.java    |  55 +++
 .../tools.uimafit.configurationparameters.xml      |  21 +-
 8 files changed, 569 insertions(+), 64 deletions(-)

diff --cc uimafit-core/pom.xml
index f5dac3a,2e78eee..54b3f84
--- a/uimafit-core/pom.xml
+++ b/uimafit-core/pom.xml
@@@ -56,10 -62,12 +56,16 @@@
        <artifactId>spring-beans</artifactId>
      </dependency>
      <dependency>
 +      <groupId>org.slf4j</groupId>
 +      <artifactId>slf4j-api</artifactId>
 +    </dependency>
 +    <dependency>
+       <groupId>org.apache.commons</groupId>
+       <artifactId>commons-collections4</artifactId>
+       <version>4.4</version>
+       <scope>test</scope>
+     </dependency>
+     <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-test</artifactId>
        <scope>test</scope>
diff --cc uimafit-core/src/main/java/org/apache/uima/fit/factory/ExternalResourceFactory.java
index 91491d4,46abee8..6a1dc2b
--- a/uimafit-core/src/main/java/org/apache/uima/fit/factory/ExternalResourceFactory.java
+++ b/uimafit-core/src/main/java/org/apache/uima/fit/factory/ExternalResourceFactory.java
@@@ -36,7 -38,7 +38,6 @@@ import java.util.Map
  import java.util.Map.Entry;
  import java.util.concurrent.atomic.AtomicLong;
  
- import org.apache.commons.lang3.ArrayUtils;
 -import org.apache.commons.lang.ArrayUtils;
  import org.apache.uima.UIMAFramework;
  import org.apache.uima.analysis_engine.AnalysisEngineDescription;
  import org.apache.uima.collection.CollectionReaderDescription;
@@@ -1233,8 -1236,7 +1233,7 @@@ public final class ExternalResourceFact
     * uimaFIT internal use. This method is required by the ConfigurationParameterFactory, so it is
     * package private instead of private.
     */
-   static ResourceValueType getResourceParameterType(Object aValue)
-   {
 -  static ResourceValueType getExternalResourceParameterType(Object aValue) {
++  static ResourceValueType getResourceParameterType(Object aValue) {
      if (aValue == null) {
        return ResourceValueType.NO_RESOURCE;
      }
@@@ -1261,6 -1260,48 +1257,48 @@@
    }
    
    /**
+    * Create an instance of a UIMA shared/external resource class.
+    * 
+    * @param <R>
+    *          the resource type.
+    * @param resourceClass
+    *          the class implementing the resource.
+    * @param 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
+    * @return the resource instance.
+    * @throws ResourceInitializationException
+    *           if there was a problem instantiating the resource.
+    */
+   public static <R> R createExternalResource(Class<? extends Resource> resourceClass,
+           Object... params) throws ResourceInitializationException {
+     return createExternalResource(resourceClass, null, params);
+   }
+ 
+   /**
+    * Create an instance of a UIMA shared/external resource class.
+    * 
+    * @param <R>
+    *          the resource type.
+    * @param resourceClass
+    *          the class implementing the resource.
+    * @param resMgr
+    *          a resource manager (optional).
+    * @param 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
+    * @return the resource instance.
+    * @throws ResourceInitializationException
+    *           if there was a problem instantiating the resource.
+    */
+   @SuppressWarnings("unchecked")
+   public static <R> R createExternalResource(Class<? extends Resource> resourceClass,
+           ResourceManager resMgr, Object... params) throws ResourceInitializationException {
 -    ExternalResourceDescription res = createExternalResourceDescription(resourceClass, params);
++    ExternalResourceDescription res = createResourceDescription(resourceClass, params);
+     return (R) produceResource(resourceClass, res.getResourceSpecifier(), resMgr, emptyMap());
+   }
+   
+   /**
     * Types of external resource values.
     */
    static enum ResourceValueType {