org.databene.benerator.wrapper
Class AccessingGenerator<S,P>

java.lang.Object
  extended by org.databene.benerator.util.AbstractGenerator<E>
      extended by org.databene.benerator.util.UnsafeGenerator<P>
          extended by org.databene.benerator.wrapper.AccessingGenerator<S,P>
All Implemented Interfaces:
java.io.Closeable, Generator<P>, org.databene.commons.Resettable, org.databene.commons.ThreadAware

public class AccessingGenerator<S,P>
extends UnsafeGenerator<P>

Returns the results of an accessor that is applied on a constant provider object.

Created: 22.08.2007 19:05:40

Author:
Volker Bergmann

Field Summary
 
Fields inherited from class org.databene.benerator.util.AbstractGenerator
context, logger, state
 
Constructor Summary
AccessingGenerator(java.lang.Class<P> targetType, org.databene.commons.Accessor<S,P> accessor, S provider)
           
 
Method Summary
 ProductWrapper<P> generate(ProductWrapper<P> wrapper)
          Returns an instance of the generic type E, using the ProductWrapper instance provided as argument.
 java.lang.Class<P> getGeneratedType()
          Declares the type of the objects returned by the generate() method.
 java.lang.String toString()
           
 
Methods inherited from class org.databene.benerator.util.UnsafeGenerator
isParallelizable, isThreadSafe
 
Methods inherited from class org.databene.benerator.util.AbstractGenerator
assertInitialized, assertNotInitialized, close, getResultWrapper, init, reset, wasInitialized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AccessingGenerator

public AccessingGenerator(java.lang.Class<P> targetType,
                          org.databene.commons.Accessor<S,P> accessor,
                          S provider)
Method Detail

generate

public ProductWrapper<P> generate(ProductWrapper<P> 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.


getGeneratedType

public java.lang.Class<P> getGeneratedType()
Description copied from interface: Generator
Declares the type of the objects returned by the generate() method.


toString

public java.lang.String toString()
Overrides:
toString in class AbstractGenerator<P>


Copyright © 2013. All Rights Reserved.