Class MapValueLoader
- java.lang.Object
-
- net.sf.basedb.clients.web.plugins.MapValueLoader
-
- All Implemented Interfaces:
DataLoader<BasicItem>
public class MapValueLoader extends Object implements DataLoader<BasicItem>
Data loader implementation that load values from a map collection. The key of the map must be specified when constructing the data loader.- Since:
- 3.8
- Author:
- Nicklas
-
-
Field Summary
Fields Modifier and Type Field Description private Object
mapKey
private Metadata.PropertyPath<BasicItem,Map<?,?>>
propertyPath
-
Constructor Summary
Constructors Constructor Description MapValueLoader(Metadata.PropertyPath<BasicItem,Map<?,?>> propertyPath, Object mapKey)
Load values from a map.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getData(DbControl dc, ExportedProperty exportedProperty, BasicItem item)
Get the value for the specified property.
-
-
-
Field Detail
-
propertyPath
private final Metadata.PropertyPath<BasicItem,Map<?,?>> propertyPath
-
mapKey
private final Object mapKey
-
-
Constructor Detail
-
MapValueLoader
public MapValueLoader(Metadata.PropertyPath<BasicItem,Map<?,?>> propertyPath, Object mapKey)
Load values from a map.- Parameters:
propertyPath
- Property path to the map collectionmapKey
- The key to use when loading the value
-
-
Method Detail
-
getData
public Object getData(DbControl dc, ExportedProperty exportedProperty, BasicItem item)
Description copied from interface:DataLoader
Get the value for the specified property.- Specified by:
getData
in interfaceDataLoader<BasicItem>
exportedProperty
- The property to get the value foritem
- The item that holds the value
-
-