in uimafit-core/src/main/java/org/apache/uima/fit/internal/propertyeditors/GetAsTextStringEditor.java [52:70]
public void setValue(Object value) {
if (value == null || value instanceof String) {
super.setValue(value);
} else {
PropertyEditor editor = editorRegistry.findCustomEditor(value.getClass(), null);
if (editor == null) {
editor = editorRegistrySupport.getDefaultEditor(value.getClass());
}
if (editor != null) {
editor.setValue(value);
super.setValue(editor.getAsText());
} else if (Enum.class.isAssignableFrom(value.getClass())) {
super.setValue(String.valueOf(value));
} else {
throw new IllegalArgumentException(
"Unable to convert " + value.getClass() + " to String. No PropertyEditor found.");
}
}
}