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

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

One scenario that I remember immediately is writing test cases for code that - 
in general - should be type-system agnostic, but I have JCas wrappers available 
for the types that I use for testing. In that case it would be convenient to 
use constants at least for features instead of having to define constants in 
the test case or even use string literals.

The TYPE_NAME field would be useful for type that have JCas wrappers but are 
built into UIMA. In that case the classname is sometimes not equivalent to the 
CAS type name.

Reconsidering the request, however, a TYPE_NAME constant may be problematic 
because it would have to change for sub-types. I still think constants for the 
feature names would be nice though.
                
> Generate static fields for type names and feature names in JCas wrappers
> ------------------------------------------------------------------------
>
>                 Key: UIMA-2147
>                 URL: https://issues.apache.org/jira/browse/UIMA-2147
>             Project: UIMA
>          Issue Type: Improvement
>          Components: Core Java Framework
>    Affects Versions: 2.3.1
>            Reporter: Richard Eckart de Castilho
>
> It would be convient if the JCas wrapper generator would create static final 
> String fields for feature names and for the type name, e.g.
> public static final String TYPE_NAME = "my.jcastypes.Type";
> public static final String FEAT_BEGIN = "begin";
> This would allow cleaner programming with JCas wrappers in cases where the 
> names are required. In particular it would allow to detect certain errors at 
> compile-time and facilitate refactoring.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to