Package persist.lint.api.spi
Interface SchemaValidatorFactory
- All Superinterfaces:
PersistenceLinterFactory,PersistenceServiceProvider
- All Known Implementing Classes:
JakartaSchemaValidatorFactory,LegacySchemaValidatorFactory
Factory for creating
SchemaValidator instances.
Implementations are discovered at runtime through the
ServiceLoader mechanism. Each implementation declares
the persistence namespace it supports (e.g. "javax" or
"jakarta") so that the correct validation strategy can be
resolved for the target JPA specification version.
- Since:
- 2.1.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionnewSchemaValidator(List<String> discoveredClassNames) Creates a newSchemaValidatorconfigured with the given entity class names.static SchemaValidatorFactorynewSchemaValidatorFactory(String jpaVersion) Discovers and returns theSchemaValidatorFactoryimplementation that matches the given JPA specification version.Methods inherited from interface persist.lint.api.spi.PersistenceLinterFactory
getSupportedNamespace
-
Method Details
-
newSchemaValidator
Creates a newSchemaValidatorconfigured with the given entity class names.- Parameters:
discoveredClassNames- fully qualified class names of the JPA entities to register in the metamodel- Returns:
- a ready-to-use schema validator
-
newSchemaValidatorFactory
Discovers and returns theSchemaValidatorFactoryimplementation that matches the given JPA specification version.The version string is mapped to a persistence namespace (
"javax"for versions 2.0–2.2,"jakarta"for versions 3.0–3.2) and the matching factory is located via theServiceLoaderAPI.- Parameters:
jpaVersion- the JPA specification version (e.g."2.2"or"3.1")- Returns:
- the factory implementation for the requested version
- Throws:
IllegalArgumentException- if the version is not recognizedIllegalStateException- if no provider is registered for the resolved namespace
-