FxWeaver { protected String buildFxmlReference(Class<?> c) { return Optional.ofNullable(c.getAnnotation(FxmlView.class)).map(FxmlView::value) .map(s -> s.isEmpty() ? null : s) .orElse(c.getSimpleName() + ".fxml"); } FxWeaver(Callback<Class<?>, Object> beanFactory, Runnable closeCommand); V loadView(Class<C> controllerClass); V loadView(Class<C> controllerClass, ResourceBundle resourceBundle); V loadView(Class<C> controllerClass, String location); V loadView(Class<C> controllerClass, String location, ResourceBundle resourceBundle); C loadController(Class<C> controllerClass, String location); C loadController(Class<C> controllerClass, String location, ResourceBundle resourceBundle); C loadController(Class<C> controllerClass); C loadController(Class<C> controllerClass, ResourceBundle resourceBundle); C getBean(Class<C> beanType); FxControllerAndView<C, V> load(Class<C> controllerClass); FxControllerAndView<C, V> load(Class<C> controllerClass,
                                                              ResourceBundle resourceBundle); void shutdown();  }
@Test public void testFindFxmlName() throws Exception { assertThat(fxWeaver.buildFxmlReference(FxmlViewClassNonAnnotated.class)) .isEqualTo("FxmlViewClassNonAnnotated.fxml"); assertThat(fxWeaver.buildFxmlReference(FxmlViewClassAnnotated.class)) .isEqualTo("FxmlViewClassAnnotated.fxml"); assertThat(fxWeaver.buildFxmlReference(FxmlViewClassAnnotatedWithValue.class)) .isEqualTo("foo.fxml"); }