Package net.sf.basedb.util.listable
Class TransformContext
java.lang.Object
net.sf.basedb.util.listable.TransformContext
Transformation context that can be used to keep track of vital
information when doing multi-step transformations.
- Since:
- 3.5
- Author:
- Nicklas
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
private boolean
private final DbControl
private Collection<Include>
-
Constructor Summary
ConstructorDescriptionCreates a new transformation context that will use the given DbControl for database access. -
Method Summary
Modifier and TypeMethodDescriptionAvoid collected items by removing them from the source set.Store collected items for later use if collecting has been enabled.getCache()
Get a cache that can be used for storing transformation results for some time.Get the DbControl to use in this transformation context.Include options when executing queries to find parent/child items.boolean
boolean
void
Clear all collected items and disable both 'collecting' and 'avoiding'.void
Shortcut for enabling 'avoiding' and disabling 'collecting'.void
setAvoiding
(boolean avoiding) Enable/disable avoiding of returning any source items that has been previously collected.void
Shortcut for enabling 'collecting' and disabling 'avoiding'.void
setCollecting
(boolean collecting) Enable/disable collecting of all source items that the transformers in this context are using.void
setInclude
(Collection<Include> include)
-
Field Details
-
dc
-
include
-
collecting
private boolean collecting -
avoiding
private boolean avoiding -
collectedByItemType
-
-
Constructor Details
-
TransformContext
Creates a new transformation context that will use the given DbControl for database access.
-
-
Method Details
-
getDbControl
Get the DbControl to use in this transformation context. -
getInclude
Include options when executing queries to find parent/child items. Default is Include.ALL. -
setInclude
-
getCache
Get a cache that can be used for storing transformation results for some time. The cache is stored in the current session and is lost if the user logs out.- Since:
- 3.16
-
setCollecting
public void setCollecting(boolean collecting) Enable/disable collecting of all source items that the transformers in this context are using.- Since:
- 3.19.5
-
setCollecting
public void setCollecting()Shortcut for enabling 'collecting' and disabling 'avoiding'.- Since:
- 3.19.5
-
isCollecting
public boolean isCollecting() -
setAvoiding
public void setAvoiding(boolean avoiding) Enable/disable avoiding of returning any source items that has been previously collected.- Since:
- 3.19.5
-
setAvoiding
public void setAvoiding()Shortcut for enabling 'avoiding' and disabling 'collecting'.- Since:
- 3.19.5
-
isAvoiding
public boolean isAvoiding() -
resetCollected
public void resetCollected()Clear all collected items and disable both 'collecting' and 'avoiding'.- Since:
- 3.19.5
-
collect
Store collected items for later use if collecting has been enabled.- Returns:
- The source items
-
avoid
Avoid collected items by removing them from the source set. Note that this method modified the source set directly.- Returns:
- The source set
-