org.objectweb.jonathan.libs.kernel.decoders
Class JImplicitFactory
- Component, Factory, Forkable, Initializer, MultiFactory
public class JImplicitFactory
Runtime implicit factory component. Provides the basic behaviour of a
MultiFactory
: holds a set of implementation alternatives
(given at the object's creation) and instantiates one of them, according
to a given chosen alternative ID.
JImplicitFactory(List _alternatives) - Creates a new implicit factory whose implementation alternatives
are listed in _alternatives as JAlternatives.
|
Component | duplicate() - Creates a new implicit factory holding the same implementation
alternatives.
|
void | initialize(Object _obj, Context _c, int _alternative) - Implementation of the Initializer interface's initialize method.
|
Object | newObject(Context _c) - From Factory interface.
|
Object | newObject(Context _c, int _alternative, Instanciable _instance) - Returns a new instance of the implicit factory's implementation
alternative whose ID is
_alternative .
|
String | toString()
|
duplicate , fork , getComponent , getElement , getFactoryValue , getIntValue , getReference , getType , getValue , getValue , internalFork , reset , setReference , toString |
JImplicitFactory
public JImplicitFactory(List _alternatives)
Creates a new implicit factory whose implementation alternatives
are listed in _alternatives as JAlternatives.
duplicate
public Component duplicate()
Creates a new implicit factory holding the same implementation
alternatives.
- duplicate in interface JComponent
initialize
public void initialize(Object _obj,
Context _c,
int _alternative)
throws JonathanException
Implementation of the Initializer interface's initialize method.
Initializes an instance of the implicit factory's implementation
alternative whose ID is _alternative
by calling its
setters. In the single implementation
alternative case, it works only if the single alternative's ID is the
given one (although initialize(Object,Context)
would do it
anyway).
- initialize in interface Initializer
_obj
- the object to initialize_c
- where the initialisation parameters are found_alternative
- the alternative to instantiate
JonathanException
- if something goes wrong.
newObject
public Object newObject(Context _c)
throws JonathanException
From Factory interface.
Returns a new instance of the single alternative's implementation
by calling its constructor; _c
is the local Context
containing the required instanciation parameters.
- newObject in interface Factory
_c
- contains the instanciation parameter
- an new instance of the implicit factory's single alternative
JonathanException
- if something goes wrong.
newObject
public Object newObject(Context _c,
int _alternative,
Instanciable _instance)
throws JonathanException
Returns a new instance of the implicit factory's implementation
alternative whose ID is _alternative
. In the single implementation
alternative case, it works only if the single alternative's ID is the
given one (although newObject(Context)
would do it anyway).
- newObject in interface MultiFactory
_c
- where the instanciation parameters are found_alternative
- the alternative to instantiate_instance
- the method's caller.
- an new
_alternative
's instance
JonathanException
- if something goes wrong.
toString
public String toString()
- toString in interface JComponent