Package org.nuclos.api.provider
Class GenerationProvider
java.lang.Object
org.nuclos.api.provider.GenerationProvider
GenerationProvider
provides methods for executing nuclos generations
This Class is usually used in Rule-classes and allows API access only
- Author:
- Matthias Reichart
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <S extends BusinessObject,
T extends BusinessObject>
List<T>execute
(List<S> s, Class<? extends Generation<S, T>> genClass) Using the source objects this method runs the given generation and returns the new created target objects.static <S extends BusinessObject,
T extends BusinessObject>
Texecute
(S s, Class<? extends Generation<S, T>> genClass) Using the source object this method runs the given generation and returns the new created target object.void
setGenerationService
(GenerationService genService)
-
Constructor Details
-
GenerationProvider
GenerationProvider()
-
-
Method Details
-
setGenerationService
-
execute
public static <S extends BusinessObject,T extends BusinessObject> T execute(S s, Class<? extends Generation<S, T>> genClass) throws BusinessExceptionUsing the source object this method runs the given generation and returns the new created target object. The generation is type-safe, which determines the type of the source and the target object- Parameters:
s
- - type-specific source-objectgenClass
- Generation<S,T> - type-specific generation- Returns:
- T - target-object
- Throws:
BusinessException
-
execute
public static <S extends BusinessObject,T extends BusinessObject> List<T> execute(List<S> s, Class<? extends Generation<S, T>> genClass) throws BusinessExceptionUsing the source objects this method runs the given generation and returns the new created target objects. The generation is type-safe, which determines the type of the source and the target objects.
Note: If the generation object enables 'group by'-functionality, all grouping-arguments will be used. Otherwise for each source a target will be created and returned in the result list.- Parameters:
s
- List<S> s - type-specific source-objectgenClass
- Generation<S,T> genClass - type-specific generation- Returns:
- List<T> - List of target-objects
- Throws:
BusinessException
-