nl.beesting.beangenerator.generator
Class AbstractInstanceGenerator

java.lang.Object
  extended by nl.beesting.beangenerator.generator.AbstractInstanceGenerator
All Implemented Interfaces:
InstanceGenerator
Direct Known Subclasses:
ColorInstanceGenerator, DateInstanceGenerator, FloatingPointNumberInstanceGenerator, IntegralNumberInstanceGenerator, ListInstanceGenerator, PhoneticalNameGenerator, PrimaryKeyGenerator, RegularExpressionInstanceGenerator, StringInstanceGenerator, TextInstanceGenerator, WordListInstanceGenerator

public abstract class AbstractInstanceGenerator
extends java.lang.Object
implements InstanceGenerator

Abstract class that offers some usefull standard operations / implementations.


Field Summary
protected static java.lang.String FROM_PARAMETER
           
protected static java.lang.String UNTIL_PARAMETER
           
 
Constructor Summary
AbstractInstanceGenerator()
           
 
Method Summary
 void addSupportedTypes(java.lang.Class<?>[] newSupportedTypes)
           
 boolean checkSupport(java.lang.Class<?> type)
          Checks if the type is supported; if not a
protected abstract  java.lang.Object getDefaultFromValue()
           
protected abstract  java.lang.Object getDefaultUntilValue()
           
protected abstract  java.lang.Object getFromValue()
           
 java.util.Collection<ParameterDescriptor> getSupportedParameterDescriptors()
           
 java.util.Iterator<java.lang.Class<?>> getSupportedTypes()
           
protected abstract  java.lang.Object getUntilValue()
           
protected  double initializeParameterDouble(ParameterPair[] initParams, java.lang.String parameterName, boolean useMaxAsDefault)
           
protected  long initializeParameterLong(ParameterPair[] initParams, java.lang.String parameterName, boolean useMaxAsDefault)
           
protected  int initParameter(ParameterPair[] initParams, java.lang.String parameterName, int defaultValue)
           
protected  int initParameter(ParameterPair[] initParams, java.lang.String parameterName, int defaultValue, java.lang.String[] list)
           
 boolean isParameterSupported(ParameterPair parameter)
           
 boolean isParameterSupported(java.lang.String name, java.lang.Class<?> type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nl.beesting.beangenerator.generator.InstanceGenerator
generateInstance, generateInstance, init
 

Field Detail

FROM_PARAMETER

protected static final java.lang.String FROM_PARAMETER
See Also:
Constant Field Values

UNTIL_PARAMETER

protected static final java.lang.String UNTIL_PARAMETER
See Also:
Constant Field Values
Constructor Detail

AbstractInstanceGenerator

public AbstractInstanceGenerator()
Method Detail

getSupportedTypes

public java.util.Iterator<java.lang.Class<?>> getSupportedTypes()
Returns:
Returns the supportedTypes.

addSupportedTypes

public void addSupportedTypes(java.lang.Class<?>[] newSupportedTypes)
Parameters:
newSupportedTypes -

getSupportedParameterDescriptors

public java.util.Collection<ParameterDescriptor> getSupportedParameterDescriptors()
Returns:
Returns the supportedParameterDescriptors.

checkSupport

public boolean checkSupport(java.lang.Class<?> type)
Checks if the type is supported; if not a


isParameterSupported

public boolean isParameterSupported(ParameterPair parameter)

isParameterSupported

public boolean isParameterSupported(java.lang.String name,
                                    java.lang.Class<?> type)

getDefaultFromValue

protected abstract java.lang.Object getDefaultFromValue()

getDefaultUntilValue

protected abstract java.lang.Object getDefaultUntilValue()

getFromValue

protected abstract java.lang.Object getFromValue()

getUntilValue

protected abstract java.lang.Object getUntilValue()

initParameter

protected int initParameter(ParameterPair[] initParams,
                            java.lang.String parameterName,
                            int defaultValue)
                     throws java.lang.InstantiationError
Throws:
java.lang.InstantiationError

initParameter

protected int initParameter(ParameterPair[] initParams,
                            java.lang.String parameterName,
                            int defaultValue,
                            java.lang.String[] list)
                     throws java.lang.InstantiationError
Throws:
java.lang.InstantiationError

initializeParameterDouble

protected double initializeParameterDouble(ParameterPair[] initParams,
                                           java.lang.String parameterName,
                                           boolean useMaxAsDefault)
                                    throws java.lang.InstantiationError
Throws:
java.lang.InstantiationError

initializeParameterLong

protected long initializeParameterLong(ParameterPair[] initParams,
                                       java.lang.String parameterName,
                                       boolean useMaxAsDefault)
                                throws java.lang.InstantiationError
Throws:
java.lang.InstantiationError


Copyright 2008. All Rights Reserved.