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 theGenerator
interface.If the implementation does not define a generator for the given node, then a
null
can be returned.- Parameters:
generators
- provides access to built-in generatorsnode
- for which to return a generator- Returns:
- generator spec for the given
node
, ornull
- Throws:
InstancioSpiException
- if the returned generator spec does not implementGenerator
- Since:
- 2.11.0
-