private ObservableToggleManager createManagerFromConfig() { try { List<Element> elements = DataFXConfiguration.getInstance().getElements("features"); if (elements == null) { throw new RuntimeException("Can't load config. Features section not specified!"); } if (elements.isEmpty()) { throw new RuntimeException("Can't load config. Features section not specified!"); } if (elements.size() > 1) { throw new RuntimeException("Can't load config. Features section must only be specified once!"); } Class<? extends Feature> featureClass = (Class<? extends Feature>) Class.forName(elements.get(0).getElementsByTagName("featureEnum").item(0).getTextContent()); return new ObservableToggleManager(featureClass); } catch (Exception e) { throw new RuntimeException("Can't generate Feature Manager", e); } }
private ObservableToggleManager createManagerFromConfig() { try { List<Element> elements = DataFXConfiguration.getInstance().getElements("features"); if (elements == null) { throw new RuntimeException("Can't load config. Features section not specified!"); } if (elements.isEmpty()) { throw new RuntimeException("Can't load config. Features section not specified!"); } if (elements.size() > 1) { throw new RuntimeException("Can't load config. Features section must only be specified once!"); } Class<? extends Feature> featureClass = (Class<? extends Feature>) Class.forName(elements.get(0).getElementsByTagName("featureEnum").item(0).getTextContent()); return new ObservableToggleManager(featureClass); } catch (Exception e) { throw new RuntimeException("Can't generate Feature Manager", e); } }