public class JAssemblage extends LazyComponent implements Instanciable, MultiFactory, Initializer
LazyComponent
implementation.
Provides the basic behaviour of a
MultiFactory
too: holds a set of implementation alternatives.Modifier and Type | Field and Description |
---|---|
protected int |
alternative |
protected Component |
configuration |
protected Element |
configuration_element |
protected Component |
factory |
protected Element |
factory_element |
protected Element |
self |
initialized
int_value, reference, type, value
Constructor and Description |
---|
JAssemblage(Component _factory,
Component _configuration) |
JAssemblage(Component _factory,
Component _configuration,
int _alt) |
JAssemblage(Component _factory,
Component _configuration,
int _alt,
java.util.List _alternatives)
Creates a new assemblage whose alternatives
are listed in _alternatives as JAlternatives.
|
JAssemblage(Component _factory,
Component _configuration,
java.util.List _alternatives)
Creates a new assemblage whose alternatives
are listed in _alternatives as JAlternatives.
|
Modifier and Type | Method and Description |
---|---|
Component |
duplicate() |
Element |
getElement(Name _name)
Returns the element in the target component identified by
name ,
null if no element exists under name name . |
java.lang.Object |
getFactoryValue()
Return a wrapper of this JComponent value for factory aspects.
|
java.lang.Object |
getInstance()
From Instanciable interface.
|
protected void |
initialize()
JAssemblage specific initialization code.
|
void |
initialize(java.lang.Object _obj,
Context _c,
int _alternative)
Implementation of the Initializer interface's initialize method.
|
boolean |
isInstanciated()
From Instanciable interface.
|
java.lang.Object |
newObject(Context _c,
int _alternative,
Instanciable _instance)
Implementation of the MultiFactory interface's newObject method.
|
java.lang.String |
toString() |
getIntValue, getType, getValue
fork, getComponent, getReference, getValue, internalFork, reset, setReference
protected Component factory
protected Component configuration
protected Element factory_element
protected Element configuration_element
protected Element self
protected int alternative
public JAssemblage(Component _factory, Component _configuration, java.util.List _alternatives)
public JAssemblage(Component _factory, Component _configuration, int _alt, java.util.List _alternatives)
public Component duplicate()
duplicate
in class JComponent
public Element getElement(Name _name)
Component
name
,
null if no element exists under name name
.getElement
in interface Component
getElement
in class JComponent
_name
- the name of the element to be retrieved;public java.lang.String toString()
toString
in class JComponent
public java.lang.Object getFactoryValue() throws JonathanException
getFactoryValue
in interface Component
getFactoryValue
in class JComponent
JonathanException
public java.lang.Object newObject(Context _c, int _alternative, Instanciable _instance) throws JonathanException
_alternative
.newObject
in interface MultiFactory
_c
- where the instanciation parameters are found_alternative
- the alternative to instantiate_instance
- the method's caller._alternative
's instanceJonathanException
- if something goes wrong.public void initialize(java.lang.Object _obj, Context _c, int _alternative) throws JonathanException
_alternative
by calling its
setters.initialize
in interface Initializer
_obj
- the object to initialize_c
- where the initialisation parameters are found_alternative
- the alternative to instantiateJonathanException
- if something goes wrong.protected final void initialize()
LazyComponent
.initialize
in class LazyComponent
public boolean isInstanciated()
isInstanciated
in interface Instanciable
public java.lang.Object getInstance()
getInstance
in interface Instanciable