public abstract class AbstractParameterizer extends Object implements Parameterizer
Modifier and Type | Field and Description |
---|---|
private int |
state
Parameterization state.
|
private static int |
STATE_COMPLETE
Constant for "complete" state
|
private static int |
STATE_ERRORS
Constant for "errors" state
|
private static int |
STATE_FRESH
Constant for "fresh" state
|
private static int |
STATE_INIT
Constant for "initializing" state
|
Constructor and Description |
---|
AbstractParameterizer() |
Modifier and Type | Method and Description |
---|---|
void |
configure(Parameterization config)
Configure the class.
|
Object |
make(Parameterization config)
Method to configure a class, then instantiate when the configuration step
was successful.
|
protected abstract Object |
makeInstance()
Make an instance after successful configuration.
|
protected void |
makeOptions(Parameterization config)
Add all options.
|
private static final int STATE_FRESH
private static final int STATE_INIT
private static final int STATE_COMPLETE
private static final int STATE_ERRORS
private int state
protected void makeOptions(Parameterization config)
config
- Parameterization to add options to.public final void configure(Parameterization config)
Parameterizer
configure
in interface Parameterizer
config
- Parameterizationprotected abstract Object makeInstance()
public final Object make(Parameterization config)
Parameterization.tryInstantiate(Class)
!
Otherwise, null
will be returned, and the resulting errors can be
retrieved from the Parameterization
parameter object. In general,
you should be checking the Parameterization
object for errors
before accessing the returned value, since it may be null
unexpectedly otherwise.config
- Parameterizationnull