It is possible to customize the generated JCas classes, yes. You can e.g. add 
own methods or even own fields. However, own fields would not be saved/loaded 
when you persist a CAS e.g. to XMI.

As a case for a custom method, consider e.g. the DKPro Core Token 
"setText(string)" method [1].
If the "string" passed to the method differs from the covered text of the 
Token, then a new
"Form" annotation with the value "string" is created, linked to the Token.

Another case would be the "links()" method on the DKPro Core CorefChain type. 
It returns all
elements in the respective coreference chain as a List thus saving the user to 
manually iterate
over the whole chain to reach all elements.

FSList and friends are built-in types of UIMA Core - you can't modify these. 
But uimaFIT provides
several methods to make working with these things much more convenient. See

- and its methods to create FSList 
etc from Java collections
- has select methods to retrieve elements 
from FSList etc
- has methods to conveniently get/set feature 
values including multi-valued features.


-- Richard


> On 30.11.2016, at 20:25, David Fox <> wrote:
> Does the UIMA Java framework support modifying or extend the java class 
> generated by JCasGen corresponding to a custom Type?   If so, are there any 
> common circumstances where this is necessary?
> I didn’t see anything in the examples or documentation about modifying the 
> generated classes, but I also didn’t see anything saying you couldn’t.  I 
> suspect that this is not supported (and that otherwise you wouldn’t be able 
> to pass a CAS between distributed UIMA AS components, or between a Java 
> annotator and a C++ one).  But it would be nice to know for certain.
> The reason I ask is that the set of data structures supported by UIMA types 
> (individual FS references,  FSList linked lists, and FSArray arrays) is 
> fairly limited compared to modern programming languages, which often directly 
> support associative arrays, trees, and graphs.  I’m trying to understand 
> whether this is a restriction on the implementation of custom types (which it 
> would be if modifying/extending the generated class was not supported), or 
> just on the public interface accessible via the UIMA API.
> David

Reply via email to