Package cdc.args
Class AbstractFactory<T>
java.lang.Object
cdc.args.AbstractFactory<T>
- Type Parameters:
T- Type of created objects.
- All Implemented Interfaces:
Factory<T>
- Direct Known Subclasses:
AutoFactory
Base class for factory implementation.
- Author:
- Damien Carbonne
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractFactory(Class<T> objectClass) Creates a factory that does not accept any argument for creation.protectedAbstractFactory(Class<T> objectClass, Args meta) Creates a factory that does not accept any argument for creation.protectedAbstractFactory(Class<T> objectClass, Args meta, FormalArgs... creationFormalArgs) Creates a factory with an array of possible tuples for creation.protectedAbstractFactory(Class<T> objectClass, Args meta, List<FormalArgs> creationFormalArgs) Creates a factory with a list of possible tuples for creation.protectedAbstractFactory(Class<T> objectClass, FormalArgs... creationFormalArgs) protectedAbstractFactory(Class<T> objectClass, List<FormalArgs> creationFormalArgs) -
Method Summary
Modifier and TypeMethodDescriptionfinal TCreates aTinstance.protected abstract Tcreate(Args args, FormalArgs fargs) Creates an object.final List<FormalArgs>Returns a list of supported creation arguments.final ArgsgetMeta()toString()
-
Constructor Details
-
AbstractFactory
Creates a factory with a list of possible tuples for creation.- Parameters:
objectClass- The class of created objects.meta- The meta parameters associated to this factory.creationFormalArgs- A list of tuples of formal arguments that can be used for creation.
-
AbstractFactory
-
AbstractFactory
Creates a factory with an array of possible tuples for creation.- Parameters:
objectClass- The class of created objects.meta- The meta parameters associated to this factory.creationFormalArgs- An array of tuples of formal arguments that can be used for creation.
-
AbstractFactory
-
AbstractFactory
Creates a factory that does not accept any argument for creation.- Parameters:
meta- The meta parameters associated to this factory.objectClass- The class of created objects.
-
AbstractFactory
Creates a factory that does not accept any argument for creation.- Parameters:
objectClass- The class of created objects.
-
-
Method Details
-
getObjectClass
- Specified by:
getObjectClassin interfaceFactory<T>- Returns:
- The class of built objects.
-
getMeta
-
getCreationFormalArgsList
Description copied from interface:FactoryReturns a list of supported creation arguments.This list must not be empty.
If creation does not need any arguments, a list containing FormalArgs.NO_FARGS should be returned.- Specified by:
getCreationFormalArgsListin interfaceFactory<T>- Returns:
- A list of supported creation arguments.
-
create
Creates an object.This is the creation method that must be implemented.
- Parameters:
args- The effective arguments.fargs- The formal arguments that match the effective ones.- Returns:
- The create object.
-
create
Description copied from interface:FactoryCreates aTinstance. -
toString
-