com.bitmechanic.maxq.generator
Class GeneratorFactory

java.lang.Object
  extended by com.bitmechanic.maxq.generator.GeneratorFactory

public class GeneratorFactory
extends java.lang.Object

Factory for IScriptGenerator instances. This loads files using configuration information found in the properties file specified by the system property generator.properties.file.

If no file is specified the configuration will look for a file called maxq.properties, and if this isn't found, the JythonCodeGenerator will be used.

The properties file will be used to specify the class name of the IScriptGenerator to be used, and any properties that are specific to the class.

Author:
Robert Dawson robert@rojotek.com

Field Summary
static java.lang.String GENERATOR_CLASSNAMES_PROPERTY
          property specifying the name of the test script class to use.
static java.lang.String JYTHON_CLASSNAME
          generator that outputs Jython code.
 
Method Summary
static java.lang.String getClassDescription(java.lang.String className)
          Returns a description of the generator in className, for use in the GUI.
static java.lang.String[] getClasses()
          Returns a list of class names to offer the user as generators.
static IScriptGenerator newGenerator(java.lang.String className, IScriptAdapter adapter)
          Retrieves the test script implementation object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GENERATOR_CLASSNAMES_PROPERTY

public static final java.lang.String GENERATOR_CLASSNAMES_PROPERTY
property specifying the name of the test script class to use. The test script class is any class that implements the IScriptGenerator interface

See Also:
Constant Field Values

JYTHON_CLASSNAME

public static final java.lang.String JYTHON_CLASSNAME
generator that outputs Jython code.

See Also:
Constant Field Values
Method Detail

getClasses

public static java.lang.String[] getClasses()
Returns a list of class names to offer the user as generators.


getClassDescription

public static java.lang.String getClassDescription(java.lang.String className)
                                            throws java.lang.ClassNotFoundException,
                                                   java.lang.IllegalAccessException,
                                                   java.lang.reflect.InvocationTargetException
Returns a description of the generator in className, for use in the GUI.

Throws:
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException

newGenerator

public static IScriptGenerator newGenerator(java.lang.String className,
                                            IScriptAdapter adapter)
Retrieves the test script implementation object. Use the property generator.classname from the properties file.

Returns:
Return a IScriptGenerator instance, configured using the properties file.