org.databene.benerator.util
Class GeneratingConverter<S,G,T>

java.lang.Object
  extended by org.databene.commons.converter.AbstractConverter<S,T>
      extended by org.databene.commons.converter.ThreadSafeConverter<S,T>
          extended by org.databene.benerator.util.GeneratingConverter<S,G,T>
All Implemented Interfaces:
java.lang.Cloneable, org.databene.commons.context.ContextAware, org.databene.commons.Converter<S,T>, org.databene.commons.ThreadAware
Direct Known Subclasses:
NoiseInducer

public abstract class GeneratingConverter<S,G,T>
extends org.databene.commons.converter.ThreadSafeConverter<S,T>
implements org.databene.commons.context.ContextAware

Converter implementation which makes use of a Generator.

Created: 27.07.2011 08:44:40

Since:
0.7.0
Author:
Volker Bergmann

Field Summary
protected  GeneratorContext context
           
protected  Generator<G> generator
           
 
Fields inherited from class org.databene.commons.converter.AbstractConverter
sourceType, targetType
 
Constructor Summary
GeneratingConverter(java.lang.Class<S> sourceType, java.lang.Class<T> targetType, Generator<G> generator)
           
 
Method Summary
 T convert(S sourceValue)
           
protected abstract  T doConvert(S sourceValue)
           
protected  ProductWrapper<G> generate()
           
protected  void initialize(S sourceValue)
           
 void setContext(org.databene.commons.Context context)
           
 
Methods inherited from class org.databene.commons.converter.ThreadSafeConverter
clone, isParallelizable, isThreadSafe
 
Methods inherited from class org.databene.commons.converter.AbstractConverter
getSourceType, getTargetType
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

generator

protected Generator<G> generator

context

protected GeneratorContext context
Constructor Detail

GeneratingConverter

public GeneratingConverter(java.lang.Class<S> sourceType,
                           java.lang.Class<T> targetType,
                           Generator<G> generator)
Method Detail

setContext

public void setContext(org.databene.commons.Context context)
Specified by:
setContext in interface org.databene.commons.context.ContextAware

convert

public final T convert(S sourceValue)
Specified by:
convert in interface org.databene.commons.Converter<S,T>

doConvert

protected abstract T doConvert(S sourceValue)

initialize

protected void initialize(S sourceValue)

generate

protected ProductWrapper<G> generate()


Copyright © 2013. All Rights Reserved.