imx.loggui.lib
Class DefaultCreator

java.lang.Object
  extended by imx.loggui.lib.DefaultCreator
All Implemented Interfaces:
CreatorInterface

public class DefaultCreator
extends java.lang.Object
implements CreatorInterface

This object can create a new instance from a given Class type. The class needs to have a public constructor, which takes no parameter.


Constructor Summary
DefaultCreator(java.lang.Class creationType, java.lang.String name)
           
DefaultCreator(java.lang.Object singleton, java.lang.String name)
          If the class is a singleton, which can not be created with Class.newInstance(), you can here determine the singleton to be returned by the Creator.
 
Method Summary
 java.lang.Object create()
          Returns a new instance of the class set in the constructor.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultCreator

public DefaultCreator(java.lang.Class creationType,
                      java.lang.String name)
Parameters:
creationType - The class of which this creator should create instances
name - The name of this Creator (shown in the selection list of the new button).

DefaultCreator

public DefaultCreator(java.lang.Object singleton,
                      java.lang.String name)
If the class is a singleton, which can not be created with Class.newInstance(), you can here determine the singleton to be returned by the Creator.

Parameters:
singleton -
name -
Method Detail

create

public java.lang.Object create()
                        throws java.lang.InstantiationException,
                               java.lang.IllegalAccessException
Returns a new instance of the class set in the constructor. If the class is a singleton, the singleton is returned, if you created this object properly with the singleton constructor.

Specified by:
create in interface CreatorInterface
Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object