public class AnyToAnyDataLoader extends Object implements DataLoader<BasicItem>
create(String, Item, String)
to create an instance
and then getLinkedItem(DbControl, BasicItem)
.Modifier and Type | Field and Description |
---|---|
private String |
linkName |
private Item |
linkType |
private Metadata.PropertyPath<BasicItem,?> |
propertyPath |
Constructor and Description |
---|
AnyToAnyDataLoader(String linkName,
Item linkType,
Metadata.PropertyPath<BasicItem,?> propertyPath)
Load links with the specified name and target type.
|
Modifier and Type | Method and Description |
---|---|
static AnyToAnyDataLoader |
create(String linkName,
Item linkType,
String linkProperty)
Create a new data loader that load a value from an any-to-any link.
|
Object |
getData(DbControl dc,
ExportedProperty exportedProperty,
BasicItem item)
Get the value for the specified property.
|
BasicItem |
getLinkedItem(DbControl dc,
BasicItem item)
Get the item that is linked to by this any-to-any link definition.
|
private final String linkName
private final Item linkType
private final Metadata.PropertyPath<BasicItem,?> propertyPath
public AnyToAnyDataLoader(String linkName, Item linkType, Metadata.PropertyPath<BasicItem,?> propertyPath)
linkName
- Name of the any-to-any link (required)linkType
- Target item type of the link (optional)propertyPath
- Property of the target item to load (optional)public static AnyToAnyDataLoader create(String linkName, Item linkType, String linkProperty)
linkName
- Name of the any-to-any link (required)linkType
- Target item type of the link (optional)linkProperty
- Property of the target item to load (optional)public Object getData(DbControl dc, ExportedProperty exportedProperty, BasicItem item)
DataLoader
getData
in interface DataLoader<BasicItem>
exportedProperty
- The property to get the value foritem
- The item that holds the value