org.progeeks.tool.gen
Class MapGenerator
java.lang.Object
org.progeeks.tool.gen.BaseDataGenerator
org.progeeks.tool.gen.MapGenerator
- All Implemented Interfaces:
- DataGenerator
public class MapGenerator
- extends BaseDataGenerator
Creates a Map of objects. The number of items in the map is determined by the
countGenerator
. countGenerator
must return an object of type
Integer. The keyGenerator
and valueGenerator
create the key and
values, respectively. Since the value will often be dependant on the key, the generator adds both
the map and the current key to the context before calling the valueGenerator
.
- Version:
- $Revision: 1.6 $
- Author:
- esword
Field Summary |
protected static Log |
log
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected static final Log log
MapGenerator
public MapGenerator()
generateRealData
protected java.lang.Object generateRealData(DataGeneratorContext context)
- Description copied from class:
BaseDataGenerator
- Left for sub-classes. Subclasses should usually not return null from this.
- Specified by:
generateRealData
in class BaseDataGenerator
testData
protected boolean testData(java.lang.Object testItem,
DataGeneratorContext context)
- Description copied from class:
BaseDataGenerator
- Left for sub-classes. Subclasses do not have to check for null.
- Specified by:
testData
in class BaseDataGenerator
getCountGenerator
public DataGenerator getCountGenerator()
- Returns:
- Returns the countGenerator.
getValueGenerator
public DataGenerator getValueGenerator()
- Returns:
- Returns the valueGenerator.
setCountGenerator
public void setCountGenerator(DataGenerator countGenerator)
- Parameters:
countGenerator
- The countGenerator to set.
setValueGenerator
public void setValueGenerator(DataGenerator dataGenerator)
- Parameters:
valueGenerator
- The valueGenerator to set.
getKeyGenerator
public DataGenerator getKeyGenerator()
- Returns:
- Returns the keyGenerator.
setKeyGenerator
public void setKeyGenerator(DataGenerator keyGenerator)
- Parameters:
keyGenerator
- The keyGenerator to set.
setDataClass
public void setDataClass(java.lang.String dataClass)
- Enforces that
dataClass
implements Map.
- Specified by:
setDataClass
in interface DataGenerator
- Overrides:
setDataClass
in class BaseDataGenerator
- Parameters:
dataClass
- The dataClass to set.
Copyright © 2002-2003 Paul Speed. All Rights Reserved.