org.progeeks.tool.gen
Interface DataGeneratorContext

All Known Implementing Classes:
DefaultGeneratorContext

public interface DataGeneratorContext

Provides references information to a DataGenerator about the environment in which it is creating data. This is most useful to ConditionalGenerator s which need to know about the value of other properties in an object or even other objects.

The context is basically a stack of reference levels, where each level is a step in a series of object creation calls. Each time a DataGenerator is called (specifically, a ComplexObjectDataGenerator), the object which it creates should be pushed onto the stack before any sub-generators are called. Once the object is fully created and initialized, it should be removed from the context.

When a DataGenerator needs to reference an item in its context, it can ask for it by level, where level 0 is the last item added to the context, 1 is the parent of that item, etc.

Version:
$Revision: 1.1 $
Author:
esword

Method Summary
 void addLevel(java.lang.Object obj)
           
 java.lang.Object getLast()
           
 java.lang.Object getLevel(int i)
           
 void removeLast()
           
 

Method Detail

addLevel

void addLevel(java.lang.Object obj)

removeLast

void removeLast()

getLast

java.lang.Object getLast()

getLevel

java.lang.Object getLevel(int i)


Copyright © 2002-2003 Paul Speed. All Rights Reserved.