You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Merging the JCas Cover Class and its _Type class

This page has design notes for merging the Xyz and Xyz_Type classes generated by JCasGen, and changes to the JCasImpl needed to support this.

The basic idea is to have one source file for both the Xyz and Xyz_Type classes. The methodology is to have the _Type class be a static inner class of the Type class.

Then the JCas initialization code would be modified to try and load the _Type (as it does now, for backwards compatibility) as well as the Xyz$Xyz_Type which would be the new name. Or perhaps we could avoid directly loading the _Type, and just have the loading of the Xyz class cause the loading of the other (I think there is some issue here, though).

It seems that the user can still get access to the _Type class instance for a particular type and (j)cas by doing
(MyParticularType_Type)aJCas.getType(MyParticularType.type). The import for this _Type would reference the outer class.innerclass_Type.

  • No labels