T - type of property parameter to apply this generator's values topublic abstract class ComponentizedGenerator<T> extends Generator<T>
| Modifier | Constructor and Description |
|---|---|
protected |
ComponentizedGenerator(Class<T> type) |
| Modifier and Type | Method and Description |
|---|---|
void |
addComponentGenerators(List<Generator<?>> newComponents)
Adds component generators to this generator.
|
boolean |
canGenerateForParametersOfTypes(List<org.javaruntype.type.TypeParameter<?>> typeParameters) |
boolean |
canRegisterAsType(Class<?> type)
Tells whether this generator is allowed to be used for property
parameters of the given type.
|
protected List<Generator<?>> |
componentGenerators() |
void |
configure(AnnotatedType annotatedType)
Configures this generator using annotations from a given annotated
type.
|
boolean |
hasComponents() |
void |
provideRepository(GeneratorRepository provided)
Used to supply the available generators to this one.
|
canShrink, compatibleWithTypeParameter, configurationAnnotationsOn, configure, doShrink, generate, narrow, numberOfNeededComponents, shrink, typespublic boolean canRegisterAsType(Class<?> type)
Generators of this type do not get called upon to generate values
for parameters of type Object.
canRegisterAsType in class Generator<T>type - type against which to test this generatortrue if the generator is allowed to participate in
generating values for property parameters of typepublic final boolean hasComponents()
hasComponents in class Generator<T>Generator.addComponentGenerators(java.util.List)public void addComponentGenerators(List<Generator<?>> newComponents)
GeneratorAdds component generators to this generator.
Some generators need component generators to create proper values. For example, list generators require a single component generator in order to generate elements that have the type of the list parameter's type argument.
addComponentGenerators in class Generator<T>newComponents - component generators to addpublic boolean canGenerateForParametersOfTypes(List<org.javaruntype.type.TypeParameter<?>> typeParameters)
canGenerateForParametersOfTypes in class Generator<T>typeParameters - a list of generic type parameterspublic void provideRepository(GeneratorRepository provided)
GeneratorprovideRepository in class Generator<T>provided - repository of available generatorspublic void configure(AnnotatedType annotatedType)
GeneratorConfigures this generator using annotations from a given annotated type.
This method considers only annotations that are themselves marked
with GeneratorConfiguration.
By default, the generator will configure itself using this procedure:
public method on the generator named
configure, that accepts a single parameter of the
annotation typeconfigure method reflectively, passing the
annotation as the argumentCopyright © 2016. All rights reserved.