Class PropertyValidators

java.lang.Object
org.apache.juneau.commons.bean.PropertyValidators

public final class PropertyValidators extends Object
Discovery helper for PropertyValidatorFactory via ServiceLoader.

Used by the marshalling side (e.g. MarshalledPropertyPostProcessor) to obtain a validator factory at BeanMeta construction time without taking a hard compile-time dependency on the juneau-bean-jsonschema module.

If no factory is registered, factory() returns null and schema-validation mode becomes a silent no-op. Callers can override the resolved factory at runtime via setFactory(PropertyValidatorFactory) as an escape hatch for multi-classloader / OSGi environments where ServiceLoader discovery does not see provider jars on the consumer classloader.

Since:
10.0.0
See Also:
  • Method Details

    • factory

      Returns the registered factory, or null if none is on the classpath.
      Returns:
      The factory, or null.
    • setFactory

      public static void setFactory(PropertyValidatorFactory value)
      Overrides the factory resolved via ServiceLoader.

      Pass null to disable schema validation entirely.

      Parameters:
      value - The factory to use, or null to disable.