org.tm4j.vtl.factory
Class BaseFactory

java.lang.Object
  extended byorg.tm4j.vtl.factory.BaseFactory
All Implemented Interfaces:
org.apache.velocity.tools.view.tools.ViewTool

public class BaseFactory
extends java.lang.Object
implements org.apache.velocity.tools.view.tools.ViewTool

An implementation of AbstractFactory which uses a properties file to determine the actual Java class to be instantiated for a given object class name. The implementation of this factory class enables run-time class substitution.

Author:
Kal Ahmed
See Also:
AbstractFactory

Constructor Summary
BaseFactory()
          Creates an uninitialised factory object
 
Method Summary
static java.lang.Object create(java.lang.String typeName)
           
static java.lang.Object create(java.lang.String typeName, boolean mapToBase)
           
static java.lang.Object create(java.lang.String typeName, boolean mapToBase, java.lang.Object param1)
           
static java.lang.Object create(java.lang.String typeName, java.lang.Object param1)
           
static BaseFactory getInstance()
           
 void init(java.lang.Object arg0)
           
 void loadProperties(java.lang.String propertiesFileName)
           
 void setBasePackage(java.lang.String basePackage)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseFactory

public BaseFactory()
Creates an uninitialised factory object

Method Detail

loadProperties

public void loadProperties(java.lang.String propertiesFileName)
                    throws FactoryInitialisationException
Throws:
FactoryInitialisationException

setBasePackage

public void setBasePackage(java.lang.String basePackage)

create

public static java.lang.Object create(java.lang.String typeName)
                               throws FactoryInitialisationException,
                                      ObjectCreationException
Throws:
FactoryInitialisationException
ObjectCreationException

create

public static java.lang.Object create(java.lang.String typeName,
                                      boolean mapToBase)
                               throws FactoryInitialisationException,
                                      ObjectCreationException
Throws:
FactoryInitialisationException
ObjectCreationException

create

public static java.lang.Object create(java.lang.String typeName,
                                      java.lang.Object param1)
                               throws FactoryInitialisationException,
                                      ObjectCreationException
Throws:
FactoryInitialisationException
ObjectCreationException

create

public static java.lang.Object create(java.lang.String typeName,
                                      boolean mapToBase,
                                      java.lang.Object param1)
                               throws FactoryInitialisationException,
                                      ObjectCreationException
Throws:
FactoryInitialisationException
ObjectCreationException

getInstance

public static BaseFactory getInstance()
                               throws FactoryInitialisationException
Throws:
FactoryInitialisationException

init

public void init(java.lang.Object arg0)
Specified by:
init in interface org.apache.velocity.tools.view.tools.ViewTool