// Fetches the newly created annotated object and it's class.
final Object target = invocationContext.getTarget();
final Class<?> targetClass = target.getClass();
final FXMLComponent annotation = targetClass.getAnnotation(FXMLComponent.class);
if (annotation == null) {
throw new IllegalStateException(String.format("No @FXMLComponent annotation could be retrieved from class %s.", targetClass.getName()));
}
final FXMLLoader fxmlLoader = new CdiFXMLLoader();
CdiFXMLLoaderFactory.initializeFXMLLoader(
fxmlLoader,
targetClass,
annotation.location(),
annotation.resources(),
annotation.charset());
fxmlLoader.setRoot(target);
fxmlLoader.setController(target);
fxmlLoader.load();
}