use of de.tudarmstadt.ukp.clarin.webanno.api.annotation.feature.editor.NumberFeatureEditor in project webanno by webanno.
the class PrimitiveUimaFeatureSupport method createEditor.
@Override
public FeatureEditor createEditor(String aId, MarkupContainer aOwner, AnnotationActionHandler aHandler, final IModel<AnnotatorState> aStateModel, final IModel<FeatureState> aFeatureStateModel) {
FeatureState featureState = aFeatureStateModel.getObject();
final FeatureEditor editor;
switch(featureState.feature.getMultiValueMode()) {
case NONE:
switch(featureState.feature.getType()) {
case CAS.TYPE_NAME_INTEGER:
{
editor = new NumberFeatureEditor(aId, aOwner, aFeatureStateModel);
break;
}
case CAS.TYPE_NAME_FLOAT:
{
editor = new NumberFeatureEditor(aId, aOwner, aFeatureStateModel);
break;
}
case CAS.TYPE_NAME_BOOLEAN:
{
editor = new BooleanFeatureEditor(aId, aOwner, aFeatureStateModel);
break;
}
case CAS.TYPE_NAME_STRING:
{
editor = new TextFeatureEditor(aId, aOwner, aFeatureStateModel);
break;
}
default:
throw unsupportedFeatureTypeException(featureState);
}
break;
case // fallthrough
ARRAY:
throw unsupportedLinkModeException(featureState);
default:
throw unsupportedMultiValueModeException(featureState);
}
return editor;
}
Aggregations