com.bm.datagen.utils
Class GeneratorDependencyInjector

java.lang.Object
  extended by com.bm.datagen.utils.GeneratorDependencyInjector

public class GeneratorDependencyInjector
extends java.lang.Object

This class is used to enable dependency injections in generators e.g. a Generator can obtain a reference to a used property -> all references are set before the call of the next value method

Author:
Daniel Wiese

Constructor Summary
GeneratorDependencyInjector()
           
 
Method Summary
 void callCleanup(Generator<?> toInvoke)
          Invokes all annotated clean up methods.
 void callPrepare(Generator<?> toInvoke)
          Invokes all annotated Prepare methods at the current generator.
 void inject(Generator<?> toInject)
          This class injects the preset values if the registered annotations are present.
 void setEntityManager(javax.persistence.EntityManager em)
          The entity manager to inject.
 void setInstance(java.lang.Object instance)
          The current object to inject.
 void setIntrospector(Introspector<?> introspector)
          The current introspector.
 void setProperty(Property property)
          The property to inject.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeneratorDependencyInjector

public GeneratorDependencyInjector()
Method Detail

inject

public void inject(Generator<?> toInject)
This class injects the preset values if the registered annotations are present.

Parameters:
toInject - - the Generator where the values should be injected

callPrepare

public void callPrepare(Generator<?> toInvoke)
Invokes all annotated Prepare methods at the current generator.

Parameters:
toInvoke - - the generator wich method gets invoked

callCleanup

public void callCleanup(Generator<?> toInvoke)
Invokes all annotated clean up methods.

Parameters:
toInvoke - - the cleanup method of the generator.

setInstance

public void setInstance(java.lang.Object instance)
The current object to inject.

Parameters:
instance - The instance to set.

setIntrospector

public void setIntrospector(Introspector<?> introspector)
The current introspector.

Parameters:
introspector - The introspector to set.

setEntityManager

public void setEntityManager(javax.persistence.EntityManager em)
The entity manager to inject.

Parameters:
em - The entity manager to inject.

setProperty

public void setProperty(Property property)
The property to inject.

Parameters:
property - The property to set.


Copyright © 2008. All Rights Reserved.