|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jsm.table.utils.JsmTableUtil
Utiltiy class to work with table related classes
Field Summary | |
static Log |
logger
|
Constructor Summary | |
JsmTableUtil()
|
Method Summary | |
static java.util.ArrayList |
generateJsmTrs(java.util.Collection valueObjects,
java.util.List propertyPathsToRetrieveValues,
java.lang.String[] propertyPathsForRowMetaData,
GenerateJsmTrsCallback callback)
Generates a JsmTr object for each of the valueObjects. |
static java.util.ArrayList |
generateJsmTrs(java.util.Collection valueObjects,
java.lang.String[] propertyPathsToRetrieveValues,
java.lang.String[] propertyPathsForRowMetaData,
GenerateJsmTrsCallback callback)
Generates a JsmTr object for each of the valueObjects. |
static java.lang.String |
getJSONRows(java.util.Collection rows)
Generates a JSON Array of JsmTr objects |
static void |
setValuesOnObject(java.lang.Object object,
JSONObject json,
java.util.HashMap converters)
Sets values from a JSONObject back into a bean optionally using converters |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static Log logger
Constructor Detail |
public JsmTableUtil()
Method Detail |
public static java.util.ArrayList generateJsmTrs(java.util.Collection valueObjects, java.lang.String[] propertyPathsToRetrieveValues, java.lang.String[] propertyPathsForRowMetaData, GenerateJsmTrsCallback callback) throws JsmException
JsmTr
object for each of the valueObjects. Adds cells for each property retrieved by the propertyPathsForCellValues entries.
Adds meta data to the row retrieved by the propertyPathsForRowMetaData entries.
valueObjects
- The objects to get the retrieve the values frompropertyPathsToRetrieveValues
- The path to retrieve the cell values from the value objectspropertyPathsForRowMetaData
- The path to retrieve the row meta data from the value objects; Can be nullcallback
- An optional callback object (can be null) which will be called with every created JsmTr object. The call back has read access to the currently processed valueObject but should never modify it. The JsmTr object can be modified.
JsmException
public static java.util.ArrayList generateJsmTrs(java.util.Collection valueObjects, java.util.List propertyPathsToRetrieveValues, java.lang.String[] propertyPathsForRowMetaData, GenerateJsmTrsCallback callback) throws JsmException
JsmTr
object for each of the valueObjects. Adds cells for each property retrieved by the propertyPathsForCellValues entries.
Adds meta data to the row retrieved by the propertyPathsForRowMetaData entries.JsmObject.META_DATA_NAME_PROPERTY_PATH
on each cell to the string specified in propertyPathsToSetValues
valueObjects
- The objects to get the retrieve the values frompropertyPathsToRetrieveValues
- List of String or String[] elements. A String element or the first item of the String[] is used
as the path to retrieve the cell value from the value objects. The second item of the String[] is used to populate the meta data JsmObject.META_DATA_NAME_VALUE
of the cellpropertyPathsForRowMetaData
- The path to retrieve the row meta data from the value objects; Can be nullcallback
- An optional callback object (can be null) which will be called with every created JsmTr object. The call back has read access to the currently processed valueObject but should never modify it. The JsmTr object can be modified.
JsmException
public static void setValuesOnObject(java.lang.Object object, JSONObject json, java.util.HashMap converters) throws JsmException
object
- The object to set the values onjson
- The JSONObject which keys are the propertyPath and which values are the values to set on the objectconverters
- A HashMap of converters implementing the Converter
interface. The key of the HashMap is the propertyPath on which the converter (which is the value of the HashMap) should be used.
JsmException
public static java.lang.String getJSONRows(java.util.Collection rows)
rows
- Collection of JsmTr
objects
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |