uima-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Eckart de Castilho (Commented) (JIRA)" <...@uima.apache.org>
Subject [jira] [Commented] (UIMA-2147) Generate static fields for type names and feature names in JCas wrappers
Date Tue, 04 Oct 2011 18:29:34 GMT

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

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

At least Annotation which has the type "uima.tcas.Annotation". I don't know if there are others.
In uimaFIT, we have a few lines of code to get the Type object for a particular type name
and here we had to add special handling for this:

{noformat}
String UIMA_BUILTIN_JCAS_PREFIX = "org.apache.uima.jcas.";
if (typeName.startsWith(UIMA_BUILTIN_JCAS_PREFIX)) {
  typeName = "uima." + typeName.substring(UIMA_BUILTIN_JCAS_PREFIX.length());
}
Type t = cas.getTypeSystem().getType(typeName);
{noformat}
                
> 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

        

Mime
View raw message