public class GridJSonBuilder extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
GridJSonBuilder.JGridSonWriterState |
| Modifier and Type | Field and Description |
|---|---|
protected int |
fieldsCount |
protected boolean |
firstColumn |
protected boolean |
firstField |
protected boolean |
firstRow |
protected StringBuilder |
json |
protected boolean |
offsetDeclared |
protected int |
rowsCount |
protected boolean |
rowsDeclared |
protected GridJSonBuilder.JGridSonWriterState |
state |
protected boolean |
totalLengthDeclared |
| Constructor and Description |
|---|
GridJSonBuilder() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addKey(String key) |
void |
addValue(String id,
Boolean value)
Adds a new value in the row.
|
void |
addValue(String id,
Date value)
Adds a new value in the row.
|
void |
addValue(String id,
Double value)
Adds a new value in the row.
|
void |
addValue(String id,
Float value)
Adds a new value in the row.
|
void |
addValue(String id,
Integer value)
Adds a new value in the row.
|
void |
addValue(String id,
Long value)
Adds a new value in the row.
|
void |
addValue(String id,
String value)
Adds a new value in the row.
|
protected void |
addValueKey(String key) |
protected void |
appendQuoted(String value)
Produce a string in double quotes with backslash sequences in all the
right places.
|
protected void |
checkFirstField() |
protected void |
checkState(GridJSonBuilder.JGridSonWriterState expectedState) |
void |
clean() |
void |
close() |
void |
endRow()
Ends the data row.
|
void |
endRows()
Ends the data field.
|
protected void |
resetState() |
void |
setOffset(String offsetField,
int offset) |
void |
setTotalLength(String totalLengthField,
int length)
Set the total length field.
|
void |
startRow()
Starts a new data row.
|
void |
startRows(String dataField)
Starts the data field.
|
String |
toString() |
protected GridJSonBuilder.JGridSonWriterState state
protected boolean rowsDeclared
protected boolean totalLengthDeclared
protected boolean offsetDeclared
protected StringBuilder json
protected boolean firstField
protected boolean firstRow
protected boolean firstColumn
protected int rowsCount
protected int fieldsCount
protected void resetState()
public void clean()
protected void checkState(GridJSonBuilder.JGridSonWriterState expectedState)
protected void checkFirstField()
public void startRows(String dataField)
dataField - the data field name.public void startRow()
protected void addKey(String key)
protected void addValueKey(String key)
public void addValue(String id, Boolean value)
id - the value id.value - the value to insert.public void addValue(String id, Date value)
id - the value id.value - the value to insert.public void addValue(String id, Double value)
id - the value id.value - the value to insert.public void addValue(String id, Float value)
id - the value id.value - the value to insert.public void addValue(String id, Long value)
id - the value id.value - the value to insert.public void addValue(String id, Integer value)
id - the value id.value - the value to insert.public void addValue(String id, String value)
id - the value id.value - the value to insert.public void endRow()
public void endRows()
public void setTotalLength(String totalLengthField, int length)
totalLengthField - length - public void setOffset(String offsetField, int offset)
public void close()
protected void appendQuoted(String value)
value - A StringCopyright © 2014. All Rights Reserved.