org.licas.data.gen

## Class ObjectDataGenerator

- java.lang.Object
- - org.licas.data.gen.DataGenerator
  - - org.licas.data.gen.ObjectDataGenerator

-     public class ObjectDataGenerator
      extends DataGenerator

  This class can generate a java object for testing purposes. A new instance of this class will parse the file specified into a java object, if a parser is available.
  Author:
    Kieran Greer

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.lang.String` | `urlPath` The path to a file to parse.

    - ### Fields inherited from class org.licas.data.gen.DataGenerator

      `adminXml, dataType, maxValue, minValue, rnd, seed`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ObjectDataGenerator(org.licas_xml.abs.Element adminXml)` Create a new instance of ObjectDataGenerator.
    `ObjectDataGenerator(long thisSeed, java.lang.String thisDataType)` Create a new instance of ObjectDataGenerator.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected static boolean` | `dataTypeOK(java.lang.String theDataType)` Return true if the data type is allowed by the data generator.
    `java.lang.Object` | `getNextValue()` Generate the next data value.
    `void` | `parseGenXml(org.licas_xml.abs.Element genXml)` Parse the data generator script to set the appropriate variable values.
    `void` | `setDataType(java.lang.String thisDataType)` Set the object data type, or its class name.
    `void` | `setUrlPath(java.lang.String thisUrlPath)` Set the file path to the file to parse.

    - ### Methods inherited from class org.licas.data.gen.DataGenerator

      `conditionsToXml, conditionsToXml, conditionsToXml, generateStringRange, getBaseElement, getDataType, getGeneratorClass, isAllowedDataType, setMaxValue, setMinValue`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### urlPath

          protected java.lang.String urlPath

      The path to a file to parse.

  - ### Constructor Detail

    - #### ObjectDataGenerator

          public ObjectDataGenerator(long thisSeed,
                                     java.lang.String thisDataType)
                              throws java.lang.Exception

      Create a new instance of ObjectDataGenerator.
      Parameters:
        `thisDataType` - the generator data type.
        `thisSeed` - to seed a random number generator. Can be 0 if not used.
      Throws:
        `java.lang.Exception` - any error.

    - #### ObjectDataGenerator

          public ObjectDataGenerator(org.licas_xml.abs.Element adminXml)
                              throws java.lang.Exception

      Create a new instance of ObjectDataGenerator.
      Parameters:
        `adminXml` - a script including the value ranges for the data. This would now be a full admin script, with an `Const`.`PARAMETERS` section for these values.
      Throws:
        `java.lang.Exception` - any error.

  - ### Method Detail

    - #### parseGenXml

          public void parseGenXml(org.licas_xml.abs.Element genXml)

      Parse the data generator script to set the appropriate variable values.
      Specified by:
        `parseGenXml` in class `DataGenerator`
      Parameters:
        `genXml` - the script to parse

    - #### getNextValue

          public java.lang.Object getNextValue()
                                        throws java.lang.Exception

      Generate the next data value.
      Specified by:
        `getNextValue` in class `DataGenerator`
      Returns:
        the next randomly generated data value.
      Throws:
        `java.lang.Exception` - any error.

    - #### setDataType

          public void setDataType(java.lang.String thisDataType)

      Set the object data type, or its class name.
      Parameters:
        `thisDataType` - the object data type.

    - #### setUrlPath

          public void setUrlPath(java.lang.String thisUrlPath)

      Set the file path to the file to parse.
      Parameters:
        `thisUrlPath` - the path to the object file to parse.

    - #### dataTypeOK

          protected static boolean dataTypeOK(java.lang.String theDataType)

      Return true if the data type is allowed by the data generator. True for this generator, for any data type.
      Parameters:
        `theDataType` - the data type to check for.
      Returns:
        true if this data generator can generate value of that type.