Generate typed Java ViewModels and discover declarative registry defaults

This commit is contained in:
2026-11-13 20:06:26 +01:00
parent adf432b98b
commit 8be0aec287
36 changed files with 1123 additions and 17 deletions
@@ -28,6 +28,14 @@ final class ControllerMetadata {
selected = null;
}
}
if (model != null) {
try {
selected = ViewModelDefaults.select(model, selected, model.getClassLoader());
} catch (RuntimeException | java.util.ServiceConfigurationError e) {
problems.add(problem("ERROR", "ViewModel registry selection failed: " + e.getMessage()));
selected = null;
}
}
viewModel = selected;
if (selected == null || selected == ViewModel.class) return;
if (selected.isInterface() || Modifier.isAbstract(selected.getModifiers())) {