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 |
provide(Generators provided)
Used to supply the available generators to this one.
|
canShrink, compatibleWithTypeParameter, configurationAnnotationsOn, configure, doShrink, gen, narrow, numberOfNeededComponents, shrink, types
public 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 type
public final boolean hasComponents()
hasComponents
in class Generator<T>
Generator.addComponentGenerators(java.util.List)
public void addComponentGenerators(List<Generator<?>> newComponents)
Generator
Adds 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 provide(Generators provided)
Generator
public void configure(AnnotatedType annotatedType)
Generator
Configures 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 argument© Copyright 2010-2016 Paul R. Holser, Jr. All rights reserved. Licensed under The MIT License. pholser@alumni.rice.edu