public abstract class RandomPattern extends java.lang.Object implements Pattern
A random pattern will generate a random string and the string will satisfy the pattern definition.
This class implements the Pattern interface.
Constructor and Description |
---|
RandomPattern()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
protected char[] | getCharacterSetConfiguration()
This method reads the random character set from the configuration file
|
java.lang.String | getCode()
This method gets the generated random code
|
char[] | getCodeset()
This method gets the character set
|
char | getMaskCharacter()
This method gets the mask character
|
protected char | getMaskConfiguration()
This method reads the mask character from the configuration file
|
java.lang.String | getPatternDefinition()
This method gets the pattern definition
|
java.math.BigDecimal | getPatternSpace()
This method calculates the total number of all random codes
|
void | setCharacterSet(char[] charactersetIn)
This method sets the character set
|
void | setMaskCharacter(char maskIn)
This method sets the mask character
|
void | setPatternDefinition(java.lang.String patternDefIn)
This method sets the pattern definition
|
boolean | validatePattern()
This method validates the pattern definition
|
public java.lang.String getCode()
public java.math.BigDecimal getPatternSpace()
public boolean validatePattern()
If the pattern definition is null or the length of the pattern definition is zero, it will return false.
If any character inside the pattern is not the mask character, it will return false.
If all above conditions are not satisfied, the method will read the length of the pattern and return true.
public java.lang.String getPatternDefinition()
public char getMaskCharacter()
public void setMaskCharacter(char maskIn)
public void setPatternDefinition(java.lang.String patternDefIn)
public char[] getCodeset()
public void setCharacterSet(char[] charactersetIn)
protected char[] getCharacterSetConfiguration()
If the field is not in the configuration file, this method will return an empty char[] array.
protected char getMaskConfiguration()
If the field is not in the configuration file, this method will return 0.