public abstract class AbstractGenericHintFactory<T>
extends org.codehaus.cargo.util.log.LoggedObject
RegistrationKey. This abstract factory class is
extended by all the different Cargo factories.| Modifier and Type | Class and Description |
|---|---|
static interface |
AbstractGenericHintFactory.GenericParameters
Generic class to be extended by implementors of
AbstractGenericHintFactory in order
to provide possible additional parameters. |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractGenericHintFactory()
Place to register default configurations.
|
| Modifier and Type | Method and Description |
|---|---|
protected T |
createImplementation(RegistrationKey key,
AbstractGenericHintFactory.GenericParameters parameters,
String implementationConceptName)
Generic method to create an implementation based on the registered implementation classes.
|
protected abstract T |
createInstance(Constructor<? extends T> constructor,
String hint,
AbstractGenericHintFactory.GenericParameters parameters)
Create an implementation class instance.
|
protected abstract Constructor<? extends T> |
getConstructor(Class<? extends T> implementationClass,
String hint,
AbstractGenericHintFactory.GenericParameters parameters)
Create a constructor.
|
protected Class<? extends T> |
getMapping(RegistrationKey key) |
protected Map<RegistrationKey,Class<? extends T>> |
getMappings() |
protected boolean |
hasMapping(RegistrationKey key) |
protected void |
registerImplementation(RegistrationKey key,
Class<? extends T> implementationClass)
Register an implementation class for a given key.
|
protected AbstractGenericHintFactory()
protected boolean hasMapping(RegistrationKey key)
key - the key associated with the implementation classprotected Class<? extends T> getMapping(RegistrationKey key)
key - the key associated with the implementation class to returnprotected Map<RegistrationKey,Class<? extends T>> getMappings()
RegistrationKey.protected void registerImplementation(RegistrationKey key, Class<? extends T> implementationClass)
key - the key under which to register the implementation classimplementationClass - the implementation class to registerprotected T createImplementation(RegistrationKey key, AbstractGenericHintFactory.GenericParameters parameters, String implementationConceptName)
key - the key under which the implementation class is registeredparameters - the additional parameters necessary to create the constructor objectimplementationConceptName - the name of what the implementation class is representing.
This is used in exception text messages to provide message customization. For
example "container", "configuration", "deployable', etc.protected abstract Constructor<? extends T> getConstructor(Class<? extends T> implementationClass, String hint, AbstractGenericHintFactory.GenericParameters parameters) throws NoSuchMethodException
implementationClass - implementation class for which to create the constructorhint - the hint to differentiate this implementation class from othersparameters - additional parameters necessary to create the constructor objectNoSuchMethodException - in case of errorprotected abstract T createInstance(Constructor<? extends T> constructor, String hint, AbstractGenericHintFactory.GenericParameters parameters) throws Exception
constructor - the constructor to use for creating the instancehint - the hint to differentiate this implementation class from othersparameters - additional parameters necessary to create the instanceException - in case of errorCopyright © 2004–2015 Github. All rights reserved.