Class RestrictionTransformer

java.lang.Object
net.sf.basedb.util.listable.AbstractSourceItemTransformer
net.sf.basedb.util.listable.RestrictionTransformer
All Implemented Interfaces:
SourceItemTransformer

public class RestrictionTransformer
extends AbstractSourceItemTransformer
Transformer implementation that is intended to provide a final filtering of target items. The transformer is used by wrapping an existing source item transformer implementation. The transform(TransformContext, Set) method will first call the wrapped transformer to get a list of target items and then apply the given filter before returning the result.
Since:
3.18
Author:
nicklas
  • Field Details

  • Constructor Details

    • RestrictionTransformer

      public RestrictionTransformer​(SourceItemTransformer transformer, Restriction restriction)
      Create a new transformer and apply the given restriction to items before they are returned. An ItemQuery for the correct target item type is automatically created from the given transformer. The restriction is applied to the query before it is executed.
    • RestrictionTransformer

      public RestrictionTransformer​(SourceItemTransformer transformer, ItemQuery<?> query)
      Create a new transformer and use the given query to find the target items. The query is expected to return the same type of items as the transformer and must have defined a parameter with the name 'ids' that take a list of id values. The list will be populated with the id values returned by the transformer.
  • Method Details