Package org.instancio.spi
Interface InstancioServiceProvider.GeneratorProvider
- Enclosing interface:
InstancioServiceProvider
public static interface InstancioServiceProvider.GeneratorProvider
Provides custom
Generator classes.
An implementation of this interface can be returned
via the InstancioServiceProvider.getGeneratorProvider() method.
- Since:
- 2.11.0
-
Method Summary
Modifier and TypeMethodDescriptiongetGenerator(Node node, Generators generators) Returns a generator spec for the specifiednode.
-
Method Details
-
getGenerator
Returns a generator spec for the specifiednode. The returned spec must also implement theGeneratorinterface.If the implementation does not define a generator for the given node, then a
nullcan be returned.- Parameters:
node- for which to return a generatorgenerators- provides access to built-in generators- Returns:
- generator spec for the given
node, ornull - Throws:
InstancioSpiException- if the returned generator spec does not implementGenerator- Since:
- 2.11.0
-