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.
Basic design and Goals
Goals
- New JCasGen generated code generates 1 class instead of 2, per type
- Old JCas generated cover classes having 2 classes per CAS type need to be converted, and the conversion will result in a single merged source (no simple backwards compatibility)
Basic design
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.
The JCas initialization code would be modified to load the Xyz$Xyz_Type which would be the new name.
Access to the _Type object
The user can still get access to the _Type class instance for a particular type and (j)cas by doing the same source code expression; only the import would change. The source code expression is
(MyParticularType_Type)aJCas.getType(MyParticularType.type)
. The import for this _Type would reference the outer class.innerclass_Type.
Built-ins and Supertypes
We would migrate the existing JCas cover classes for existing types in the current format of two separate classes to the new form of one source class.