jas.util
Class ObjectFactory

java.lang.Object
  extended by jas.util.ObjectFactory

public class ObjectFactory
extends Object

The object factory is just a convenience class for creating objects from thier Class pointer. It hides some of the messiness of the java.lang.relect.* classes.


Constructor Summary
ObjectFactory(Class c)
          Create an ObjectFactory capable of creating objects of a specific class.
 
Method Summary
 boolean canBeCreatedFrom()
          Determines if object can be constrcted from the specified types of arguments
 boolean canBeCreatedFrom(Class c1)
          Determines if object can be constrcted from the specified types of arguments
 boolean canBeCreatedFrom(Class[] argc)
          Determines if object can be constrcted from the specified types of arguments
 boolean canBeCreatedFrom(Class c1, Class c2)
          Determines if object can be constrcted from the specified types of arguments
 boolean canBeCreatedFrom(Class c1, Class c2, Class c3)
          Determines if object can be constrcted from the specified types of arguments
 boolean canBeCreatedFrom(Class c1, Class c2, Class c3, Class c4)
          Determines if object can be constrcted from the specified types of arguments
 boolean checkAccess()
          Checks that the class is declared public.
 Object create()
          Creates an object from the specified arguments
 Object create(Object a1)
          Creates an object from the specified arguments
 Object create(Object[] args)
          Creates an object from the specified arguments
 Object create(Object a1, Object a2)
          Creates an object from the specified arguments
 Object create(Object a1, Object a2, Object a3)
          Creates an object from the specified arguments
 Object create(Object a1, Object a2, Object a3, Object a4)
          Creates an object from the specified arguments
 Class getSourceClass()
           
 boolean inheritsFrom(Class baseClass)
          Checks that the class inherits from baseClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectFactory

public ObjectFactory(Class c)
Create an ObjectFactory capable of creating objects of a specific class.

Parameters:
c - The class of objects to be created.
Method Detail

create

public Object create()
              throws ObjectFactoryException
Creates an object from the specified arguments

Throws:
ObjectFactoryException

create

public Object create(Object a1)
              throws ObjectFactoryException
Creates an object from the specified arguments

Throws:
ObjectFactoryException

create

public Object create(Object a1,
                     Object a2)
              throws ObjectFactoryException
Creates an object from the specified arguments

Throws:
ObjectFactoryException

create

public Object create(Object a1,
                     Object a2,
                     Object a3)
              throws ObjectFactoryException
Creates an object from the specified arguments

Throws:
ObjectFactoryException

checkAccess

public boolean checkAccess()
Checks that the class is declared public.


inheritsFrom

public boolean inheritsFrom(Class baseClass)
Checks that the class inherits from baseClass


create

public Object create(Object a1,
                     Object a2,
                     Object a3,
                     Object a4)
              throws ObjectFactoryException
Creates an object from the specified arguments

Throws:
ObjectFactoryException

create

public Object create(Object[] args)
              throws ObjectFactoryException
Creates an object from the specified arguments

Throws:
ObjectFactoryException

canBeCreatedFrom

public boolean canBeCreatedFrom()
Determines if object can be constrcted from the specified types of arguments


canBeCreatedFrom

public boolean canBeCreatedFrom(Class c1)
Determines if object can be constrcted from the specified types of arguments


canBeCreatedFrom

public boolean canBeCreatedFrom(Class c1,
                                Class c2)
Determines if object can be constrcted from the specified types of arguments


canBeCreatedFrom

public boolean canBeCreatedFrom(Class c1,
                                Class c2,
                                Class c3)
Determines if object can be constrcted from the specified types of arguments


canBeCreatedFrom

public boolean canBeCreatedFrom(Class c1,
                                Class c2,
                                Class c3,
                                Class c4)
Determines if object can be constrcted from the specified types of arguments


canBeCreatedFrom

public boolean canBeCreatedFrom(Class[] argc)
Determines if object can be constrcted from the specified types of arguments


getSourceClass

public Class getSourceClass()


Copyright © 2000-2009 FreeHEP. All Rights Reserved.