// Generate XCAS events and pipe them to XCASDeserializer
CasDataToXCas generator = new CasDataToXCas();
generator.setDocumentTextTypeName(this.getDocumentTextTypeName());
generator.setDocumentTextFeatureName(this.getDocumentTextFeatureName());
XCASDeserializer xcasDeser = new XCASDeserializer(aContainer.getTypeSystem());
xcasDeser.setDocumentTypeName(this.getDocumentTextTypeName());
// xcasDeser.setDocumentTextFeautre(this.getDocumentTextFeatureName()); NOT NEEDED
// to be lenient, install OutOfTypeSystemData object to collect data that doesn't
// fit into target CAS's type system.
OutOfTypeSystemData ootsd = null;
if (aLenient) {
ootsd = new OutOfTypeSystemData();
}
generator.setContentHandler(xcasDeser.getXCASHandler(aContainer, ootsd));
try {
generator.generateXCas(aData);
} catch (Exception e) {
throw new CollectionException(e);
}