Package net.sf.basedb.util.listable
Class SourceItemTransformerChain
java.lang.Object
net.sf.basedb.util.listable.SourceItemTransformerChain
- All Implemented Interfaces:
SourceItemTransformer
public class SourceItemTransformerChain extends Object implements SourceItemTransformer
Chains together one or more source item transformers. Each step in the
chain should take over from the previous in the sense that the
SourceItemTransformer.getSourceItemType()
of step N+1
must match the SourceItemTransformer.getTargetItemType()
of step N.- Since:
- 3.5
- Author:
- Nicklas
-
Field Summary
-
Constructor Summary
Constructors Constructor Description SourceItemTransformerChain(List<SourceItemTransformer> chain)
Create a new source item transformer chain. -
Method Summary
Modifier and Type Method Description private Set<Integer>
appendFakeSources(Set<Integer> existing)
Item
getSourceItemType()
Get the source item type of the first step in the chain.Item
getTargetItemType()
Get the target item type of the last step in the chain.Set<Integer>
transform(TransformContext context, Set<Integer> source)
Transform the source items into target items by invoking each step in the transformer chain.
-
Field Details
-
chain
-
source
-
target
-
-
Constructor Details
-
SourceItemTransformerChain
Create a new source item transformer chain. The chain must contain at least one element and all steps must have matching source and target item types.- Throws:
IllegalArgumentException
- If the chain is null or empty or have non-matching transformation steps
-
-
Method Details
-
getSourceItemType
Get the source item type of the first step in the chain.- Specified by:
getSourceItemType
in interfaceSourceItemTransformer
-
getTargetItemType
Get the target item type of the last step in the chain.- Specified by:
getTargetItemType
in interfaceSourceItemTransformer
-
transform
Transform the source items into target items by invoking each step in the transformer chain.- Specified by:
transform
in interfaceSourceItemTransformer
-
appendFakeSources
-