public abstract class JsonDataAdapter<T> extends Object implements JsonData
Modifier and Type | Field and Description |
---|---|
protected NavigationTreeNode |
config |
protected List<T> |
objects |
protected String |
parameters |
protected HttpServletRequest |
request |
protected String |
requestedId |
Constructor and Description |
---|
JsonDataAdapter() |
Modifier and Type | Method and Description |
---|---|
protected T |
get(String objectId) |
List<Map<String,Object>> |
getData()
Two cases: id is known, return the object with this id,
else return all objects.
|
protected Map<String,Object> |
getData(T p) |
protected Map<String,Double> |
getFavorites() |
protected abstract List<String> |
getFields()
what object-properties should be used
may be called multiple times
|
protected abstract List<T> |
getObjects()
get all required objects. basic filtering should be done here
is called once
|
protected abstract Object |
getValue(T object,
String field)
will be called for each object and each field
|
void |
init(HttpServletRequest req,
String params,
String id,
NavigationTreeNode configuration)
called once when initalizing the model
|
protected void |
onRowComplete(T p,
Map<String,Object> row)
will be called once for each row
|
boolean |
supportsPaging()
Will be removed in @ep11.
|
protected HttpServletRequest request
protected NavigationTreeNode config
protected String requestedId
protected String parameters
public void init(HttpServletRequest req, String params, String id, NavigationTreeNode configuration) throws Exception
JsonData
public final List<Map<String,Object>> getData() throws Exception
JsonData
protected void onRowComplete(T p, Map<String,Object> row)
p
- row
- protected abstract List<T> getObjects()
protected abstract List<String> getFields()
protected abstract Object getValue(T object, String field) throws Exception
object
- field
- Exception
public boolean supportsPaging()
JsonData
supportsPaging
in interface JsonData
@enterprise 10.0.39049 Copyright © 2024 FREQUENTIS AG. All Rights Reserved.