Class JsonSchemaPropertyValidatorFactory
java.lang.Object
org.apache.juneau.bean.jsonschema.JsonSchemaPropertyValidatorFactory
- All Implemented Interfaces:
PropertyValidatorFactory
public final class JsonSchemaPropertyValidatorFactory
extends Object
implements PropertyValidatorFactory
PropertyValidatorFactory implementation backed by the typed JsonSchema bean.
This factory is registered as a ServiceLoader provider for
PropertyValidatorFactory via META-INF/services/org.apache.juneau.commons.bean.PropertyValidatorFactory.
Marshalling-side code discovers it through PropertyValidators.factory() at runtime.
The factory converts the supplied JSON-Schema-shaped map into a JsonSchema bean via
JsonSchemaBeanGenerator.toBean(JsonMap) and wraps it in a JsonSchemaValidator.
- Since:
- 10.0.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
JsonSchemaPropertyValidatorFactory
public JsonSchemaPropertyValidatorFactory()Public no-arg constructor required byServiceLoader.
-
-
Method Details
-
create
Description copied from interface:PropertyValidatorFactoryBuilds a validator from a JSON-Schema-shaped map of constraints.- Specified by:
createin interfacePropertyValidatorFactory- Parameters:
schemaMap- A map mirroring the JSON Schema constraint shape (the same shape produced bySchemaAnnotation.asMap()). May be empty, in which case implementations should returnnull .propertyType- The Java type of the property being validated. May be used by the factory to choose narrower numeric or collection validators. May benull .- Returns:
- A validator, or
null if the map carries no actionable constraints.
-