Class PopulateStoreFromDefine<V extends BeanInitialization>
Object
PopulateStoreFromDefine<V>
- Type Parameters:
V- initialization-parameters for provider
Helps populates a
NamedProviderStore from the contents of a Define.
Objects can be added directly (no initialization) or with initialization.
- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionPopulateStoreFromDefine(Define define, BeanInitializer<?> propertyInitializer, Logger logger) Creates a newPopulateStoreFromDefineinstance. -
Method Summary
Modifier and TypeMethodDescription<S extends InitializableBean<S,V>>
voidcopyInitialize(Class<?> defineClass, NamedProviderStore<S> destination) Copies objects of a particular class from the define and initializes.<S extends InitializableBean<?,V> & Provider<T>, T>
voidcopyProviderInitialize(Class<?> defineClass, NamedProviderStore<T> destination) Copies objects of a particular class (which must be aProvider) fromdefineand initializes each.<S extends AnchorBean<S>>
voidcopyWithoutInitialize(Class<?> defineClass, NamedProviderStore<S> destination) Copies objects of a particular class from the define without performing any initialization.
-
Constructor Details
-
PopulateStoreFromDefine
public PopulateStoreFromDefine(Define define, BeanInitializer<?> propertyInitializer, Logger logger) Creates a newPopulateStoreFromDefineinstance.- Parameters:
define- Define source for objects.propertyInitializer- Initializes the properties of objects, where initialization is required.logger- Passed to objects added with initialization.
-
-
Method Details
-
copyWithoutInitialize
public <S extends AnchorBean<S>> void copyWithoutInitialize(Class<?> defineClass, NamedProviderStore<S> destination) throws OperationFailedException Copies objects of a particular class from the define without performing any initialization.- Type Parameters:
S- type of objects- Parameters:
defineClass- class to identify objects indefine.destination- where to copy to.- Throws:
OperationFailedException- if the identifier already exists, or otherwise the add operation fails.
-
copyInitialize
public <S extends InitializableBean<S,V>> void copyInitialize(Class<?> defineClass, NamedProviderStore<S> destination) throws OperationFailedException Copies objects of a particular class from the define and initializes.- Type Parameters:
S- type of objects- Parameters:
defineClass- class to identify objects indefine.destination- where to copy to.- Throws:
OperationFailedException- if a copied identifier already exists, or otherwise the add operation fails.
-
copyProviderInitialize
public <S extends InitializableBean<?,V> & Provider<T>, void copyProviderInitializeT> (Class<?> defineClass, NamedProviderStore<T> destination) throws OperationFailedException Copies objects of a particular class (which must be aProvider) fromdefineand initializes each.Specifically, each object will be lazily initialized once when first retrieved from the store.
- Type Parameters:
S- type of provider-objectsT- type of objects created by the provider- Parameters:
defineClass- class to identify objects indefine.destination- where to copy to.- Throws:
OperationFailedException- if a copied identifier already exists, or otherwise the add operation fails.
-