public class InheritedValueLoader<T> extends AbstractPropagateLoader<T>
mySpec
Constructor and Description |
---|
InheritedValueLoader(AttributeSpec<T> spec,
AttributeSpec<T> valueSpec,
boolean forceParentValue) |
Modifier and Type | Method and Description |
---|---|
Set<AttributeSpec<?>> |
getAttributeDependencies()
Returns attributes that need to be loaded prior to calling this loader's loading function.
|
BiFunction<StructureRow,PropagateAttributeContext,AttributeValue<T>> |
loadChildren(AttributeValue<T> parentValue,
PropagateAttributeContext.Parent parentContext)
Provider of a loading function for the children of the given parent row.
|
getAttributeSpec, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isLoadingSuperRoot
getCachingStrategy
isWholeForestDependent, preload
getAttributeSpec, getContextDependencies, getGlobalTrail
public InheritedValueLoader(AttributeSpec<T> spec, @NotNull AttributeSpec<T> valueSpec, boolean forceParentValue)
public Set<AttributeSpec<?>> getAttributeDependencies()
AttributeLoader
Returns attributes that need to be loaded prior to calling this loader's loading function.
The returned value must be the same throughout the lifetime of the object.
null
if there are noneAttributeLoaderContext.getDependencyValue(com.almworks.jira.structure.api.attribute.AttributeSpec<V>)
@Nullable public BiFunction<StructureRow,PropagateAttributeContext,AttributeValue<T>> loadChildren(@NotNull AttributeValue<T> parentValue, @NotNull PropagateAttributeContext.Parent parentContext)
PropagateAttributeLoader
Provider of a loading function for the children of the given parent row. When there's a need to load a propagate value for row R, then first this method is called for the parent of R. Then the function that is received will be called to calculate the value for R and any other siblings that are also requested in this loading process.
The implementation can make preparatory calculations and then return a function that will produce results for specific rows. The value of the dependencies for the children rows are available only when that function is called.
You should not include costly calculations for all the children rows in the implementation of this method, because loadChildren()
may called even when only one child row needs to be calculated.
The implementation must be a stable function - see PropagateAttributeLoader
. Note that loadChildren()
and the functions it
produced may be called intermittently without any particular order. In other words, the function produced by loadChildren()
should
be working even after another loadChildren()
is called.
If for some reason this loader is not applicable for the given row, it should return null
. Note, however, that if multiple propagate
loaders work on the same attribute, it could be tricky and lead to unexpected results.
parentValue
- the value of this attribute for the parent row, or AttributeValue.undefined()
if there's no parentparentContext
- loading contextnull
if the values for the children rows of this parent cannot be loaded with this loaderCopyright © 2024 Tempo Software. All Rights Reserved.