Interface InstancioServiceProvider


public interface InstancioServiceProvider
Instancio Service Provider Interface for providing custom:

All of the above are default methods that return null. Implementations of this class can override one or more methods as needed. Instancio will invoke each of the above methods only once, therefore, these methods may contain initialisation logic.

This class uses the ServiceLoader mechanism. Therefore, implementations must be registered explicitly.

  • for a module using the Java module system by adding provides org.instancio.spi.InstancioServiceProvider with fully.qualified.ImplementationName;
  • otherwise in non-modular code or when read by non-modular code, by placing a file named org.instancio.spi.InstancioServiceProvider under /META-INF/services; The file must contain the fully-qualified name of the implementing class.

Note: only InstancioServiceProvider (and not the interfaces defined within it) can be registered via the ServiceLoader.

Since:
2.11.0