public abstract class ItemClassAttributeLoader<T,A> extends ItemTypeAttributeLoader<A>
myItemTypes
mySpec
Constructor and Description |
---|
ItemClassAttributeLoader(AttributeSpec<A> spec,
Class<T> itemClass,
String... itemTypes) |
Modifier and Type | Method and Description |
---|---|
protected abstract AttributeValue<A> |
getValue(T item,
ItemAttributeContext context) |
AttributeValue<A> |
loadValue(ItemIdentity itemId,
ItemAttributeContext context)
The loading function.
|
isItemTypeSupported
getAttributeSpec, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
preload
getAttributeDependencies, getAttributeSpec, getCachingStrategy, getContextDependencies, getGlobalTrail
public ItemClassAttributeLoader(AttributeSpec<A> spec, Class<T> itemClass, String... itemTypes)
public AttributeValue<A> loadValue(@NotNull ItemIdentity itemId, @NotNull ItemAttributeContext context)
ItemAttributeLoader
The loading function. The implementation is expected to take itemId
or the item object (see ItemAttributeContext.getItem(java.lang.Class<I>)
)
and provide a value.
Attribute system's contract:
ItemAttributeLoader.isItemTypeSupported(java.lang.String)
method has been called at least once for the type of the
passed item, and this loader has returned true
.ItemAttributeLoader.preload(java.util.Collection<com.almworks.jira.structure.api.item.ItemIdentity>, com.almworks.jira.structure.api.attribute.loader.AttributeContext)
has been called for a set of items that included itemId
, and that was
a part of the same loading process, sharing the same context (so all values put into the context are still there).If the value is missing or empty, the loader should return AttributeValue.undefined()
. If for some reason this loader
is not applicable for the given item, it should return null
.
itemId
- item to load the value forcontext
- loading contextnull
to pass on loading a value for this item@Nullable protected abstract AttributeValue<A> getValue(@NotNull T item, @NotNull ItemAttributeContext context)
Copyright © 2024 Tempo Software. All Rights Reserved.