Class ItemClassAttributeLoader<T,A>
Object
AbstractAttributeLoader<T>
AbstractItemAttributeLoader<A>
ItemTypeAttributeLoader<A>
ItemClassAttributeLoader<T,A>
- All Implemented Interfaces:
AttributeLoader<A>,ItemAttributeLoader<A>
- Direct Known Subclasses:
IssueAttributeLoader
-
Field Summary
Fields inherited from class ItemTypeAttributeLoader
myItemTypesFields inherited from class AbstractAttributeLoader
mySpec -
Constructor Summary
ConstructorsConstructorDescriptionItemClassAttributeLoader(AttributeSpec<A> spec, Class<T> itemClass, String... itemTypes) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract AttributeValue<A>getValue(T item, ItemAttributeContext context) loadValue(ItemIdentity itemId, ItemAttributeContext context) The loading function.Methods inherited from class ItemTypeAttributeLoader
isItemTypeSupportedMethods inherited from class AbstractAttributeLoader
getAttributeSpec, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface AttributeLoader
getAttributeDependencies, getAttributeSpec, getCachingStrategy, getContextDependencies, getGlobalTrailMethods inherited from interface ItemAttributeLoader
preload
-
Constructor Details
-
ItemClassAttributeLoader
-
-
Method Details
-
loadValue
public AttributeValue<A> loadValue(@NotNull ItemIdentity itemId, @NotNull ItemAttributeContext context) Description copied from interface:ItemAttributeLoaderThe loading function. The implementation is expected to take
itemIdor the item object (seeItemAttributeContext.getItem(java.lang.Class<I>)) and provide a value.Attribute system's contract:
- Before this method is called,
ItemAttributeLoader.isItemTypeSupported(java.lang.String)method has been called at least once for the type of the passed item, and this loader has returnedtrue. - Before this method is called,
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 includeditemId, 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 returnnull.- Parameters:
itemId- item to load the value forcontext- loading context- Returns:
- attribute value, or
nullto pass on loading a value for this item
- Before this method is called,
-
getValue
@Nullable protected abstract AttributeValue<A> getValue(@NotNull T item, @NotNull ItemAttributeContext context)
-