Generate versioned Model metadata and consume it in shared binding discovery

This commit is contained in:
2026-11-13 19:08:30 +01:00
parent 9bc4569407
commit adf432b98b
20 changed files with 700 additions and 15 deletions
@@ -26,4 +26,11 @@
<scope>test</scope>
</dependency>
</dependencies>
<build><plugins><plugin>
<groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths><path><groupId>de.neitzel.fxdesigner</groupId><artifactId>designer-model-processor</artifactId><version>0.1.0-SNAPSHOT</version></path></annotationProcessorPaths>
<compilerArgs><arg>-Adesigner.models=fixture.model.Person,fixture.model.Address</arg></compilerArgs>
</configuration>
</plugin></plugins></build>
</project>
@@ -70,6 +70,15 @@ public final class PreviewChecks {
xml = new String(in.readAllBytes(), java.nio.charset.StandardCharsets.UTF_8);
}
var metadata = BindingDiscovery.inspect(xml, "home", "both", loader);
check(
metadata.diagnostics().contains("Generated Model metadata 1.0: fixture.model.Person"),
"Generated Person metadata not used: " + metadata.diagnostics());
check(
metadata.diagnostics().contains("Generated Model metadata 1.0: fixture.model.Address"),
"Generated nested metadata not used");
check(
metadata.problems().stream().noneMatch(p -> p.message().contains("metadata rejected")),
"Generated metadata rejected");
check(
metadata.attributes().stream().anyMatch(a -> a.path().equals("home.street")),
"Nested metadata");