in src/main/java/org/apache/uima/json/jsoncas2/ser/FeatureStructureDeserializer.java [588:604]
private void deserializeFsReference(JsonParser aParser, DeserializationContext aCtxt,
FeatureStructure aFs, String aFieldName) throws IOException {
FeatureStructureToIdIndex idToFsIdx = FeatureStructureToIdIndex.get(aCtxt);
int targetFsId = aParser.getIntValue();
Optional<FeatureStructure> targetFs = idToFsIdx.get(targetFsId);
Feature feature = aFs.getType().getFeatureByBaseName(aFieldName);
if (targetFs.isPresent()) {
aFs.setFeatureValue(feature, targetFs.get());
} else {
FeatureStructure finalFs = aFs;
schedulePostprocessing(aCtxt, () -> {
finalFs.setFeatureValue(feature,
idToFsIdx.get(targetFsId).orElseThrow(() -> new NoSuchElementException(
"Unable to resolve ID [" + targetFsId + "] during post-processing")));
});
}
}