org.databene.benerator.wrapper
Class ConvertingGenerator<S,T>
java.lang.Object
org.databene.benerator.util.AbstractGenerator<P>
org.databene.benerator.wrapper.GeneratorWrapper<S,T>
org.databene.benerator.wrapper.ConvertingGenerator<S,T>
- All Implemented Interfaces:
- java.io.Closeable, Generator<T>, org.databene.commons.Resettable, org.databene.commons.ThreadAware
- Direct Known Subclasses:
- AsStringGenerator
public class ConvertingGenerator<S,T>
- extends GeneratorWrapper<S,T>
Reads products from a source Generator and applies a Converter to transform them into the target products.
Created: 12.06.2006 19:02:30
- Since:
- 0.1
- Author:
- Volker Bergmann
Field Summary |
protected org.databene.commons.Converter<?,?>[] |
converters
The converter to apply to the source's products |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
converters
protected org.databene.commons.Converter<?,?>[] converters
- The converter to apply to the source's products
ConvertingGenerator
public ConvertingGenerator(Generator<S> source,
org.databene.commons.Converter<?,?>... converters)
- Initializes all attributes
init
public void init(GeneratorContext context)
- Specified by:
init
in interface Generator<T>
- Overrides:
init
in class GeneratorWrapper<S,T>
getGeneratedType
public java.lang.Class<T> getGeneratedType()
- Description copied from interface:
Generator
- Declares the type of the objects returned by the generate() method.
generate
public ProductWrapper<T> generate(ProductWrapper<T> wrapper)
- Description copied from interface:
Generator
- Returns an instance of the generic type E, using the
ProductWrapper
instance provided as argument.
The wrapper may wrap a null value as a regular generator product.
If the generator is not available (any more), it returns null instead of
the ProductWrapper instance.
toString
public java.lang.String toString()
- Overrides:
toString
in class GeneratorWrapper<S,T>
Copyright © 2013. All Rights Reserved.