[
https://issues.apache.org/jira/browse/UIMA-2147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13605277#comment-13605277
]
Marshall Schor commented on UIMA-2147:
--------------------------------------
The JCas system already generates non-static fields for each feature which
reference the corresponding Feature.
These are non-static, because the feature instance can't be known until the
type system is created at run time.
The naming convention for these is "casFeat_" + theShortFeatureName. Currently
these are "package-private" variables. See line 102 in JCas_TypeTemplate.java
in uimaj-tools/src/main/java/org/apache/uima/tools/jcasgen.
Does the annotation system need static variables?
If so, I'd like a naming convention that avoided any confusion with the other
generated field names, something that indicated that the value wasn't actually
the Feature, but rather the short name of the feature. If not, then perhaps it
could make use of the existing field for each feature.
> 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
For more information on JIRA, see: http://www.atlassian.com/software/jira