/** * @deprecated The UI class {@link AnnotatorState} should not be passed here. Use * {@link #delete(SourceDocument, String, JCas, VID)} instead. */ @Deprecated default void setFeatureValue(AnnotatorState aState, JCas aJCas, int aAddress, AnnotationFeature aFeature, Object aValue) { setFeatureValue(aState.getDocument(), aState.getUser().getUsername(), aJCas, aAddress, aFeature, aValue); }
/** * @deprecated The UI class {@link AnnotatorState} should not be passed here. Use * {@link #delete(SourceDocument, String, JCas, VID)} instead. */ @Deprecated default void setFeatureValue(AnnotatorState aState, JCas aJCas, int aAddress, AnnotationFeature aFeature, Object aValue) { setFeatureValue(aState.getDocument(), aState.getUser().getUsername(), aJCas, aAddress, aFeature, aValue); }
private void writeFeatureEditorModelsToCas(TypeAdapter aAdapter, JCas aJCas) throws IOException { List<FeatureState> featureStates = featureList.getModelObject(); LOG.trace("writeFeatureEditorModelsToCas()"); List<AnnotationFeature> features = new ArrayList<>(); for (FeatureState featureState : featureStates) { features.add(featureState.feature); // For string features with extensible tagsets, extend the tagset if (CAS.TYPE_NAME_STRING.equals(featureState.feature.getType())) { String value = (String) featureState.value; if (value != null && featureState.feature.getTagset() != null && featureState.feature.getTagset().isCreateTag() && !annotationService.existsTag(value, featureState.feature.getTagset())) { Tag selectedTag = new Tag(); selectedTag.setName(value); selectedTag.setTagSet(featureState.feature.getTagset()); annotationService.createTag(selectedTag); } } LOG.trace("writeFeatureEditorModelsToCas() " + featureState.feature.getUiName() + " = " + featureState.value); aAdapter.setFeatureValue(sourceDocument.getObject(), username.getObject(), aJCas, getModelObject().getId(), featureState.feature, featureState.value); } }
private void writeFeatureEditorModelsToCas(TypeAdapter aAdapter, JCas aJCas) throws IOException { List<FeatureState> featureStates = featureList.getModelObject(); LOG.trace("writeFeatureEditorModelsToCas()"); List<AnnotationFeature> features = new ArrayList<>(); for (FeatureState featureState : featureStates) { features.add(featureState.feature); // For string features with extensible tagsets, extend the tagset if (CAS.TYPE_NAME_STRING.equals(featureState.feature.getType())) { String value = (String) featureState.value; if (value != null && featureState.feature.getTagset() != null && featureState.feature.getTagset().isCreateTag() && !annotationService.existsTag(value, featureState.feature.getTagset())) { Tag selectedTag = new Tag(); selectedTag.setName(value); selectedTag.setTagSet(featureState.feature.getTagset()); annotationService.createTag(selectedTag); } } LOG.trace("writeFeatureEditorModelsToCas() " + featureState.feature.getUiName() + " = " + featureState.value); aAdapter.setFeatureValue(sourceDocument.getObject(), username.getObject(), aJCas, getModelObject().getId(), featureState.feature, featureState.value); } }
aAdapter.setFeatureValue(state.getDocument(), state.getUser().getUsername(), aJCas, state.getSelection().getAnnotation().getId(), featureState.feature, featureState.value);
adapter.setFeatureValue(state.getDocument(), state.getUser().getUsername(), jCas, getAddr(arc), featureState.feature, featureState.value);