use of io.jmix.ui.component.formatter.FormatterLoadFactory in project jmix by jmix-framework.
the class AbstractComponentLoader method loadFormatter.
@Nullable
protected Formatter<?> loadFormatter(Element element) {
Element formatterElement = element.element("formatter");
if (formatterElement == null) {
return null;
}
int size = formatterElement.elements().size();
if (size != 1) {
throw new GuiDevelopmentException("Only one formatter needs to be defined. " + "The current number of formatters is " + size, getContext(), "Component ID", resultComponent.getId());
}
Element childElement = formatterElement.elements().get(0);
FormatterLoadFactory loadFactory = applicationContext.getBean(FormatterLoadFactory.class);
if (loadFactory.isFormatter(childElement)) {
return loadFactory.createFormatter(childElement);
}
return null;
}
Aggregations