use of de.tudarmstadt.ukp.clarin.webanno.api.annotation.event.FeatureValueUpdatedEvent in project webanno by webanno.
the class TypeAdapter_ImplBase method setFeatureValue.
@Override
public void setFeatureValue(AnnotatorState aState, JCas aJcas, int aAddress, AnnotationFeature aFeature, Object aValue) {
FeatureStructure fs = selectByAddr(aJcas, aAddress);
Object oldValue = getValue(fs, aFeature);
featureSupportRegistry.getFeatureSupport(aFeature).setFeatureValue(aJcas, aFeature, aAddress, aValue);
Object newValue = getValue(fs, aFeature);
if (!Objects.equals(oldValue, newValue)) {
publishEvent(new FeatureValueUpdatedEvent(this, aState.getDocument(), aState.getUser().getUsername(), fs, aFeature, newValue, oldValue));
}
}
Aggregations