You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by "Richard Eckart de Castilho (JIRA)" <de...@uima.apache.org> on 2013/03/30 16:57:15 UTC

[jira] [Commented] (UIMA-2586) @ExternalResource - key should default to name of annotated field instead of the field type name

    [ https://issues.apache.org/jira/browse/UIMA-2586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13618109#comment-13618109 ] 

Richard Eckart de Castilho commented on UIMA-2586:
--------------------------------------------------

Changed the behavior so that

{noformat}
bindResource(desc, DummyResource.class);
{noformat}

scans for a resource with a compatible type. For reason of supporting POJO injection and ResourceLocators, resources using Object as API are never bound. (uimaFIT uses Object as API spec if the field annotated with @ExternalResource is neither a Resource nor a SharedResourceObject).

So basically, the code using this method of binding should still work (the test cases certainly do), but the internal handling is slightly different than with the old uimaFIT.
                
> @ExternalResource - key should default to name of annotated field instead of the field type name
> ------------------------------------------------------------------------------------------------
>
>                 Key: UIMA-2586
>                 URL: https://issues.apache.org/jira/browse/UIMA-2586
>             Project: UIMA
>          Issue Type: Improvement
>          Components: uimaFIT
>            Reporter: Richard Eckart de Castilho
>            Assignee: Richard Eckart de Castilho
>             Fix For: 2.0.0uimaFIT
>
>
> While analyzing some comments on uimaFIT recently on the UIMA users mailing list, it occurred to me that the default value for "key" should probably be the name of the annotated field, not the name of the type of the annotated field. That means
> {code}
>   public static final String FOO_KEY = "foo";
>   @ExternalResource(key = FOO_KEY)
>   private Foo foo;
> {code}
> could be written as simply
> {code}
>   @ExternalResource
>   private Foo foo;
> {code}
> However, this would mean that 
> {code}
>   bindResource(desc, DummyResource.class);
> {code}
> wouldn't work anymore, because this kind of binding relies on the fact that the key defaults to the field type name. I think though, that this is a rather rare case.
> Btw. the UIMA mailing list post is: 
> http://mail-archives.apache.org/mod_mbox/uima-user/201103.mbox/%3cloom.20110321T183824-248@post.gmane.org%3e
> Google Code Issue: https://code.google.com/p/uimafit/issues/detail?id=71

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira