net.sf.basedb.clients.web.plugins
Class ItemQueryLoader<T extends BasicItem>
java.lang.Object
net.sf.basedb.clients.web.plugins.ItemQueryLoader<T>
- All Implemented Interfaces:
- DataLoader<T>
- Direct Known Subclasses:
- ParentBioMaterialLoader
public class ItemQueryLoader<T extends BasicItem>
- extends Object
- implements DataLoader<T>
A class that uses a given query to load data. The query is filtered
on a given parameter.
- Version:
- 2.12
- Author:
- martin
- Last modified
- $Date: 2011-06-23 11:53:05 +0200 (Thu, 23 Jun 2011) $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
query
private final ItemQuery<?> query
parameterName
private final String parameterName
ItemQueryLoader
public ItemQueryLoader(ItemQuery<?> query,
String parameterName)
- Parameters:
query
- Query to use when loading dataparameterName
- Name of the parameter that should be used to filter the query.
getData
public Object getData(ExportedProperty exportedProperty,
T item)
throws Exception
- Description copied from interface:
DataLoader
- Get the value for the specified property.
- Specified by:
getData
in interface DataLoader<T extends BasicItem>
- Parameters:
exportedProperty
- The property to get the value foritem
- The item that holds the value
- Throws:
Exception
- If failing to get the data.