org.databene.domain.br
Class CNPJGenerator

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<E>
              extended by org.databene.benerator.sample.WeightedCSVSampleGenerator<java.lang.String>
                  extended by org.databene.domain.br.CNPJGenerator
All Implemented Interfaces:
java.io.Closeable, Generator<java.lang.String>, NonNullGenerator<java.lang.String>, org.databene.commons.Resettable, org.databene.commons.ThreadAware

public class CNPJGenerator
extends WeightedCSVSampleGenerator<java.lang.String>
implements NonNullGenerator<java.lang.String>

Generates Brazilian CNPJ numbers. CNPJ stands for Cadastro Nacional da Pessoa Jurídica and is a tax payer number assigned to a legal person (Pessoa Jurídica).

Author:
Eric Chaves
See Also:
"http://en.wikipedia.org/wiki/Cadastro_de_Pessoas_F%C3%ADsicas"

Field Summary
 
Fields inherited from class org.databene.benerator.sample.WeightedCSVSampleGenerator
separator, uri
 
Fields inherited from class org.databene.benerator.wrapper.GeneratorProxy
generatedType
 
Fields inherited from class org.databene.benerator.util.AbstractGenerator
context, logger, state
 
Constructor Summary
CNPJGenerator()
           
CNPJGenerator(boolean formatted)
           
 
Method Summary
 java.lang.String generate()
           
 ProductWrapper<java.lang.String> generate(ProductWrapper<java.lang.String> wrapper)
          Returns an instance of the generic type E, using the ProductWrapper instance provided as argument.
 
Methods inherited from class org.databene.benerator.sample.WeightedCSVSampleGenerator
getEncoding, getSeparator, getUri, init, setEncoding, setSeparator, setUri
 
Methods inherited from class org.databene.benerator.wrapper.GeneratorProxy
getGeneratedType, toString
 
Methods inherited from class org.databene.benerator.wrapper.GeneratorWrapper
close, equals, generateFromSource, getSource, getSourceWrapper, hashCode, isParallelizable, isThreadSafe, reset, setSource
 
Methods inherited from class org.databene.benerator.util.AbstractGenerator
assertInitialized, assertNotInitialized, getResultWrapper, wasInitialized
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.databene.benerator.Generator
close, getGeneratedType, init, wasInitialized
 
Methods inherited from interface org.databene.commons.ThreadAware
isParallelizable, isThreadSafe
 
Methods inherited from interface org.databene.commons.Resettable
reset
 

Constructor Detail

CNPJGenerator

public CNPJGenerator()

CNPJGenerator

public CNPJGenerator(boolean formatted)
Method Detail

generate

public java.lang.String generate()
Specified by:
generate in interface NonNullGenerator<java.lang.String>

generate

public ProductWrapper<java.lang.String> generate(ProductWrapper<java.lang.String> wrapper)
Description copied from interface: Generator
Returns an instance of the generic type E, using the ProductWrapper instance provided as argument. The wrapper may wrap a null value as a regular generator product. If the generator is not available (any more), it returns null instead of the ProductWrapper instance.

Specified by:
generate in interface Generator<java.lang.String>
Overrides:
generate in class GeneratorProxy<java.lang.String>


Copyright © 2013. All Rights Reserved.