|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.pholser.junit.quickcheck.generator.Generator<T>
com.pholser.junit.quickcheck.generator.ComponentizedGenerator<T>
T - type of theory parameter to apply this generator's values topublic abstract class ComponentizedGenerator<T>
Produces values for theory parameters of types that have components that would also need generation, such as arrays, lists, and predicates.
| Constructor Summary | |
|---|---|
protected |
ComponentizedGenerator(Class<T> type)
|
| Method Summary | |
|---|---|
void |
addComponentGenerators(List<Generator<?>> components)
Adds component generators to this generator. |
boolean |
canGenerateForParametersOfTypes(List<org.javaruntype.type.TypeParameter<?>> typeParameters)
|
List<Generator<?>> |
componentGenerators()
|
void |
configure(Map<Class<? extends Annotation>,Annotation> configurationsByType)
Tells this generator to configure itself using annotations from a theory parameter. |
boolean |
hasComponents()
|
| Methods inherited from class com.pholser.junit.quickcheck.generator.Generator |
|---|
canRegisterAsType, compatibleWithTypeParameter, generate, numberOfNeededComponents, types |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected ComponentizedGenerator(Class<T> type)
type - class token for type of theory parameter this generator is applicable to| Method Detail |
|---|
public final boolean hasComponents()
hasComponents in class Generator<T>Generator.addComponentGenerators(java.util.List)public void addComponentGenerators(List<Generator<?>> components)
GeneratorAdds component generators to this generator.
Some generators need component generators to create proper values. For example, lists 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>components - component generators to addpublic List<Generator<?>> componentGenerators()
public boolean canGenerateForParametersOfTypes(List<org.javaruntype.type.TypeParameter<?>> typeParameters)
canGenerateForParametersOfTypes in class Generator<T>typeParameters - a list of generic type parameters
public void configure(Map<Class<? extends Annotation>,Annotation> configurationsByType)
GeneratorTells this generator to configure itself using annotations from a theory parameter.
The annotations fed to this method will be those annotations on the theory parameter that are themselves
marked with GeneratorConfiguration.
By default, the generator will configure itself by:
public method on the generator named configure, that accepts a single
parameter of the annotation typeconfigure method reflectively, passing the annotation as the argument
configure in class Generator<T>configurationsByType - a map of configuration annotations, keyed by annotation type
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||