mandala.jacob
Class Instanciator

java.lang.Object
  extended bymandala.jacob.Instanciator
All Implemented Interfaces:
Serializable

public class Instanciator
extends Object
implements Serializable

Allows instanciation of objects.

Version:
$Revision: 1.1 $
Author:
eipi
See Also:
ActiveMap, Serialized Form

Field Summary
protected  ConstructorOp constructor
           
 
Method Summary
 boolean equals(Object o)
           
 ActiveMap getActiveMap()
           
 ConstructorOp getConstructor()
           
static StoredObjectReference getInstance(ActiveMap activeMap)
          Describe getInstance method here.
static StoredObjectReference getInstance(ActiveMap activeMap, ConstructorOp constructor)
          Describe getInstance method here.
 int hashCode()
           
 Object instanciate(ConstructorOp constructor, Object[] args)
          Instanciate a new object and associates it with a new key.
 Object instanciate(Object[] args)
          Equivalent to instanciate(getConstructorOp(), args).
 Object instanciateWith(ConstructorOp constructor, Object[] keys)
          Instanciate a new object with parameters taken from the active map and associates it with a new key.
 Object instanciateWith(Object[] keys)
          Equivalent to instanciateWith(getConstructorOp(), args).
 ConstructorOp setConstructor(ConstructorOp constructor)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

constructor

protected ConstructorOp constructor
Method Detail

getInstance

public static StoredObjectReference getInstance(ActiveMap activeMap,
                                                ConstructorOp constructor)

Describe getInstance method here.

Parameters:
activeMap - an ActiveMap value
constructor - a ConstructorOp value
Returns:
a StoredObjectReference value

equals

public boolean equals(Object o)

hashCode

public int hashCode()

getInstance

public static StoredObjectReference getInstance(ActiveMap activeMap)

Describe getInstance method here.

Parameters:
activeMap - an ActiveMap value
Returns:
a StoredObjectReference value

getConstructor

public ConstructorOp getConstructor()

setConstructor

public ConstructorOp setConstructor(ConstructorOp constructor)

getActiveMap

public ActiveMap getActiveMap()

instanciate

public Object instanciate(Object[] args)
                   throws InstantiationException,
                          IllegalAccessException,
                          IllegalArgumentException,
                          InvocationTargetException

Equivalent to instanciate(getConstructorOp(), args).

Throws:
InstantiationException
IllegalAccessException
IllegalArgumentException
InvocationTargetException
See Also:
instanciate(ConstructorOp, Object[])

instanciate

public Object instanciate(ConstructorOp constructor,
                          Object[] args)
                   throws InstantiationException,
                          IllegalAccessException,
                          IllegalArgumentException,
                          InvocationTargetException

Instanciate a new object and associates it with a new key.

Parameters:
constructor - the constructor to use for the instanciation
args - the arguments used for the instanciation
Returns:
the key which the new object is to be associated with
Throws:
InstantiationException - if the class that declares the underlying constructor represents an abstract class.
InvocationTargetException - if the underlying constructor throws an exception.
ExceptionInInitializerError - if the initialization provoked by this method fails.
ClassCastException - if the class of the specified key or value prevents it from being stored in this map.
IllegalArgumentException - if some aspect of this key or value prevents it from being stored in this map.
NullPointerException - this map does not permit null keys or values, and the specified key or value is null.
IllegalAccessException - if the underlying constructor is inaccessible.
IllegalArgumentException - if the number of actual and formal parameters differ, or if an unwrapping or method invocation conversion fails.
Since:
2.2
See Also:
Map.put(Object, Object), ConstructorOp.newInstance(Object[])

instanciateWith

public Object instanciateWith(Object[] keys)
                       throws InstantiationException,
                              IllegalAccessException,
                              IllegalArgumentException,
                              InvocationTargetException

Equivalent to instanciateWith(getConstructorOp(), args).

Throws:
InstantiationException
IllegalAccessException
IllegalArgumentException
InvocationTargetException
See Also:
instanciate(ConstructorOp, Object[])

instanciateWith

public Object instanciateWith(ConstructorOp constructor,
                              Object[] keys)
                       throws InstantiationException,
                              IllegalAccessException,
                              IllegalArgumentException,
                              InvocationTargetException

Instanciate a new object with parameters taken from the active map and associates it with a new key.

The key arguments represent the stored objects to use for the instanciation.

Parameters:
constructor - the constructor to use for the instanciation
keys - the mapping of the stored objects used for the instanciation
Returns:
the key which the new object is to be associated with
Throws:
InstantiationException - if the class that declares the underlying constructor represents an abstract class.
InvocationTargetException - if the underlying constructor throws an exception.
ExceptionInInitializerError - if the initialization provoked by this method fails.
ClassCastException - if the class of the specified key or value prevents it from being stored in this map.
IllegalArgumentException - if some aspect of this key or value prevents it from being stored in this map.
NullPointerException - this map does not permit null keys or values, and the specified key or value is null.
IllegalAccessException - if the underlying constructor is inaccessible.
IllegalArgumentException - if the number of actual and formal parameters differ, or if an unwrapping or method invocation conversion fails.
Since:
2.2
See Also:
Map.put(Object, Object), ConstructorOp.newInstance(Object[])

toString

public String toString()


Mandala help mailing list