|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpl.kernelpanic.dbmonster.generator.BasicDataGenerator
pl.kernelpanic.dbmonster.generator.StringGenerator
String generator. Recognizes the following properties:
minLength | minimal length of generated string (default: 0) |
maxLength | maximum length of generated string (default: 255) |
allowSpaces | should this column contain spaces? (default: true ) |
excludeChars | characters that should not appear in generated string (no default value) |
nulls | How many nulls on average should this generator produce
per every 100 rows (default: 0 ) |
Field Summary |
Fields inherited from class pl.kernelpanic.dbmonster.generator.BasicDataGenerator |
column, nulls |
Constructor Summary | |
StringGenerator()
|
Method Summary | |
Object |
generate()
Generates random string. |
boolean |
getAllowSpaces()
Return allowSpaces parameter. |
String |
getExcludeChars()
Returns an exclude chars. |
int |
getMaxLength()
Returns the maximal length of the string. |
int |
getMinLength()
Returns the minimal length of the string. |
void |
initialize(DBMonsterContext ctx)
Initializes the generator. |
void |
reset()
Resets the generator. |
void |
setAllowSpaces(boolean spaces)
Sets the allowSpaces parameter. |
void |
setExcludeChars(String chars)
Sets the excluded characters. |
void |
setMaxLength(int length)
Sets the maximal length of the string. |
void |
setMinLength(int length)
Sets the minimal length of the string. |
Methods inherited from class pl.kernelpanic.dbmonster.generator.BasicDataGenerator |
getColumn, getNulls, setColumn, setNulls |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StringGenerator()
Method Detail |
public final void initialize(DBMonsterContext ctx) throws Exception
initialize
in interface Initializable
ctx
- context
Exception
- of errorspublic final Object generate()
generate
in interface DataGenerator
null
.public final int getMinLength()
public final void setMinLength(int length)
length
- minimal lengthpublic final int getMaxLength()
public final void setMaxLength(int length)
length
- maximal lengthpublic final boolean getAllowSpaces()
true
if generated string
can contain spaces.public final void setAllowSpaces(boolean spaces)
spaces
- true
or false
public final String getExcludeChars()
public final void setExcludeChars(String chars)
chars
- the characters to excludepublic final void reset()
reset
in interface DataGenerator
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |