Package repackaged.nl.flotsam.xeger
Class Xeger
java.lang.Object
repackaged.nl.flotsam.xeger.Xeger
An object that will generate text from a regular expression. In a way, it's the
opposite of a regular expression matcher: an instance of this class will produce text
that is guaranteed to match the regular expression passed in.
slight modifications by Marcin Grzejszczak
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Xeger
Constructs a new instance, accepting the regular expression and the randomizer.- Parameters:
regex- The regular expression. (Notnull.)random- The object that will randomize the way the String is generated. (Notnull.)- Throws:
IllegalArgumentException- If the regular expression is invalid.
-
Xeger
AsXeger(String, java.util.Random), creating aRandominstance implicityly.- Parameters:
regex- as string
-
-
Method Details
-
generate
Generates a random String that is guaranteed to match the regular expression passed to the constructor.- Returns:
- generated regexp
-
getRandom
-
setRandom
-