Boolean & Integers given default value when exporting CAS
Brought to you by:
uima_team
When exporting a CAS to xmi using the UIMA
applications (Document Analyser) we are finding that
Boolean & Integer types are given a default value
whereas Strings are not as they can be set as null.
Is this the expected behaviour?
E.g. I have a typed system named 'Person' with
attributes name:String & validName:Boolean.
Within the AE the 'validName' is not defined as
either a input or output and is not set within the
respective Annotator class. However in the xmi file
generated I am getting a result for both attributes
being 'name' and 'validName'.
If I change the the 'validName' attribute to be a
String, the attribute is not written to the xmi.
Thanks
Evan
Logged In: YES
user_id=1428720
Originator: NO
This is the expected behavior. The Boolean and Integer types in the CAS are like primitive Java boolean and int types in that they cannot take null as a value. This is apparent even if you do not do a serialization. If you try to get the value of an integer feature from an in-memory CAS, you will find that you will get a value of 0 for a feature that has not been assigned.