Globally configure generator
I'm looking for a way to globally configure a generator.
For example, I want every LocalDateTime in every POJO to be between 2000/2100.
Is it possible without rewriting every generators for those POJO ?
@Allsimon Thanks for bringing this up. Currently there is no such feature. Generators are configured for each use via some set of configuration annotations they support. For example, the LocalDateTimeGenerator can accept an @InRange marker to specify an interval. I'm hoping to make this a little less cumbersome by allowing them to be collected on a meta-annotation, if I can find time to get to #173.
I think what you're asking for is very useful. Do you have a particular strategy in mind?
What kind of API are you planning to implement with #173 ?
I was thinking about GeneratorConfiguration chaining, something looking like this:
@From(MoneyGenerator.class)
@Children(class = Integer.class, configuration = Positive.class)
@Children(class = Double.class, configuration = CustomConf.class)
public @interface SmallChange {
}
@Allsimon My intent behind #173 is to be able to find @Property as a meta-annotation and/or on enclosing elements, such as a class, package, or module (to allow for configuration at greater scope than individual property methods); and to find configuration annotations for a parameter as meta-annotations deeper than one level. I don't anticipate changing how programmers write tests with this change. Does that help?