org.databene.benerator.primitive.regex
Class RegexStringGenerator

java.lang.Object
  extended by org.databene.benerator.util.AbstractGenerator<P>
      extended by org.databene.benerator.wrapper.GeneratorWrapper<E,E>
          extended by org.databene.benerator.wrapper.GeneratorProxy<java.lang.String>
              extended by org.databene.benerator.primitive.regex.RegexStringGenerator
All Implemented Interfaces:
java.io.Closeable, Generator<java.lang.String>, org.databene.commons.Resettable, org.databene.commons.ThreadAware

public class RegexStringGenerator
extends GeneratorProxy<java.lang.String>

Generates Strings that comply to a regular expression.

Created: 18.07.2006 19:32:52

Since:
0.1
Author:
Volker Bergmann

Field Summary
 
Fields inherited from class org.databene.benerator.wrapper.GeneratorWrapper
source
 
Fields inherited from class org.databene.benerator.util.AbstractGenerator
context, state
 
Constructor Summary
RegexStringGenerator()
          Initializes the generator to an empty regular expression, a maxQuantity of 30 and the fallback locale
RegexStringGenerator(int maxQuantity)
          Initializes the generator to an empty regular expression and the fallback locale
RegexStringGenerator(java.lang.String pattern)
          Initializes the generator to a maxQuantity of 30 and the fallback locale
RegexStringGenerator(java.lang.String pattern, int quantityLimit)
          Initializes the generator to the fallback locale
RegexStringGenerator(java.lang.String pattern, java.lang.Integer quantityLimit, boolean unique)
          Initializes the generator with the String representation of a regular expression
 
Method Summary
 java.util.Locale getLocale()
           
 int getMaxQuantity()
           
 java.lang.String getPattern()
          Sets the String representation of the regular expression
 void init(GeneratorContext context)
          ensures consistency of the generators state
 void setLocale(java.util.Locale locale)
           
 void setMaxQuantity(int quantityLimit)
           
 void setPattern(java.lang.String pattern)
          Returns the String representation of the regular expression
 java.lang.String toString()
           
 
Methods inherited from class org.databene.benerator.wrapper.GeneratorProxy
generate, getGeneratedType
 
Methods inherited from class org.databene.benerator.wrapper.GeneratorWrapper
close, equals, getSource, hashCode, isParallelizable, isThreadSafe, reset, setSource
 
Methods inherited from class org.databene.benerator.util.AbstractGenerator
assertInitialized, assertNotInitialized, wasInitialized
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RegexStringGenerator

public RegexStringGenerator()
Initializes the generator to an empty regular expression, a maxQuantity of 30 and the fallback locale


RegexStringGenerator

public RegexStringGenerator(int maxQuantity)
Initializes the generator to an empty regular expression and the fallback locale


RegexStringGenerator

public RegexStringGenerator(java.lang.String pattern)
Initializes the generator to a maxQuantity of 30 and the fallback locale


RegexStringGenerator

public RegexStringGenerator(java.lang.String pattern,
                            int quantityLimit)
Initializes the generator to the fallback locale


RegexStringGenerator

public RegexStringGenerator(java.lang.String pattern,
                            java.lang.Integer quantityLimit,
                            boolean unique)
Initializes the generator with the String representation of a regular expression

Method Detail

getPattern

public java.lang.String getPattern()
Sets the String representation of the regular expression


setPattern

public void setPattern(java.lang.String pattern)
Returns the String representation of the regular expression


getLocale

public java.util.Locale getLocale()

setLocale

public void setLocale(java.util.Locale locale)

getMaxQuantity

public int getMaxQuantity()

setMaxQuantity

public void setMaxQuantity(int quantityLimit)

init

public void init(GeneratorContext context)
ensures consistency of the generators state

Specified by:
init in interface Generator<java.lang.String>
Overrides:
init in class GeneratorWrapper<java.lang.String,java.lang.String>

toString

public java.lang.String toString()
Overrides:
toString in class GeneratorWrapper<java.lang.String,java.lang.String>


Copyright © 2011. All Rights Reserved.