|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.visualization.datasource.render.JsonRenderer
public class JsonRenderer
Takes a data table and returns a json string.
| Method Summary | |
|---|---|
static StringBuilder |
appendCellJson(TableCell cell,
StringBuilder sb,
boolean includeFormatting,
boolean isLastColumn,
boolean renderDateAsDateConstructor)
Appends a Json representing a cell to the string buffer. |
static StringBuilder |
appendColumnDescriptionJson(ColumnDescription col,
StringBuilder sb)
Appends a Json representing a column description to the string buffer. |
static String |
getSignature(DataTable data)
Returns a String-form 32-bit hash of this table's json. |
static CharSequence |
renderDataTable(DataTable dataTable,
boolean includeValues,
boolean includeFormatting,
boolean renderDateAsDateConstructor)
Generates a JSON representation of the data table object. |
static CharSequence |
renderJsonResponse(DataSourceParameters dsParams,
ResponseStatus responseStatus,
DataTable data)
Returns the json response for the given data table. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static String getSignature(DataTable data)
data - The data table.
public static CharSequence renderJsonResponse(DataSourceParameters dsParams,
ResponseStatus responseStatus,
DataTable data)
dsParams - The datasource parameters.responseStatus - The response status.data - The data table.
public static CharSequence renderDataTable(DataTable dataTable,
boolean includeValues,
boolean includeFormatting,
boolean renderDateAsDateConstructor)
includeValues - False if the json should contain just meta-data and column descriptions
but without the data rows.includeFormatting - False if formatting information should be omitted from the
generated json.renderDateAsDateConstructor - True -> date constructor, False -> date string.
True if date values should be rendered into the json string as a call to
Date object constructor (usually used when rendering jsonp string).
False if it should should be rendered as string.
For example, when rendering the date 1/1/2011 as Date object constructor its value
in the json string will be new Date(2011,1,1), and when rendered as string
will be "Date(2011,1,1)"
public static StringBuilder appendCellJson(TableCell cell,
StringBuilder sb,
boolean includeFormatting,
boolean isLastColumn,
boolean renderDateAsDateConstructor)
cell - The cell to write Json for.sb - The string buffer to append to.includeFormatting - Flase if formatting information should be omitted from the json.isLastColumn - Is this the last column in the row.renderDateAsDateConstructor - True -> date constructor, False -> date string.
True if date values should be rendered into the json string as a call to
Date object constructor (usually used when rendering jsonp string).
False if it should should be rendered as string.
For example, when rendering the date 1/1/2011 as Date object constructor its value
in the json string will be new Date(2011,1,1), and when rendered as string
will be "Date(2011,1,1)"
public static StringBuilder appendColumnDescriptionJson(ColumnDescription col,
StringBuilder sb)
col - The column description to write Json for.sb - The string builder to append to.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||