|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nl.beesting.beangenerator.generator.AbstractInstanceGenerator nl.beesting.beangenerator.generator.DateInstanceGenerator
public class DateInstanceGenerator
Date instance generator; generates random date objects.
Supported types:
,
,
The default instance generator just creates a date between 1900 AD and 2100 AD. It is possible to change the between
values by defining two parameters called 'from' and 'until'. One can set the date to the current date by using 'now'
as a value. The date values must be specified in the following format (using the,
notation): dd-MM-yyyy HH:mm:ss the hour part being optional.
Field Summary | |
---|---|
static long |
YEAR1900_MILLIS
The year 1900 in millis |
static long |
YEAR2100_MILLIS
The Year 2100 in millis |
Fields inherited from class nl.beesting.beangenerator.generator.AbstractInstanceGenerator |
---|
FROM_PARAMETER, UNTIL_PARAMETER |
Constructor Summary | |
---|---|
DateInstanceGenerator()
|
Method Summary | |
---|---|
java.lang.Object |
generateInstance(java.lang.Class<?> type)
Create an instance for the given class. |
java.lang.Object |
generateInstance(java.lang.Class<?> type,
int modus)
Create an instance for the given class with an instance generator specific modus. |
protected java.lang.Object |
getDefaultFromValue()
|
protected java.lang.Object |
getDefaultUntilValue()
|
protected java.lang.Object |
getFromValue()
|
protected java.lang.Object |
getUntilValue()
|
void |
init(ParameterPair[] initParams)
Initializes the instnce generator with the given array of objects. |
static void |
main(java.lang.String[] args)
|
Methods inherited from class nl.beesting.beangenerator.generator.AbstractInstanceGenerator |
---|
addSupportedTypes, checkSupport, getSupportedParameterDescriptors, getSupportedTypes, initializeParameterDouble, initializeParameterLong, initParameter, initParameter, isParameterSupported, isParameterSupported |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long YEAR2100_MILLIS
public static final long YEAR1900_MILLIS
Constructor Detail |
---|
public DateInstanceGenerator()
Method Detail |
---|
public void init(ParameterPair[] initParams)
initParams
- the initial parameter used to set up this generatorpublic java.lang.Object generateInstance(java.lang.Class<?> type) throws TypeNotSupportedException
type
- the type
...
TypeNotSupportedException
public java.lang.Object generateInstance(java.lang.Class<?> type, int modus) throws TypeNotSupportedException
TypeNotSupportedException
protected java.lang.Object getFromValue()
getFromValue
in class AbstractInstanceGenerator
protected java.lang.Object getUntilValue()
getUntilValue
in class AbstractInstanceGenerator
protected java.lang.Object getDefaultFromValue()
getDefaultFromValue
in class AbstractInstanceGenerator
protected java.lang.Object getDefaultUntilValue()
getDefaultUntilValue
in class AbstractInstanceGenerator
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |