public class GridJSonWriter extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
GridJSonWriter.JGridSonWriterState |
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
dataDeclared |
protected int |
fieldsCount |
protected boolean |
firstColumn |
protected boolean |
firstField |
protected boolean |
firstRow |
protected boolean |
offsetDeclared |
protected int |
rowsCount |
protected GridJSonWriter.JGridSonWriterState |
state |
protected boolean |
totalLengthDeclared |
protected Writer |
writer |
| Constructor and Description |
|---|
GridJSonWriter(Writer writer) |
| 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,
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(GridJSonWriter.JGridSonWriterState expectedState) |
void |
close() |
void |
endData()
Ends the data field.
|
void |
endRow()
Ends the data row.
|
void |
setOffset(String offsetField,
int offset) |
void |
setTotalLength(String totalLengthField,
int length)
Set the total length field.
|
void |
startData(String dataField)
Starts the data field.
|
void |
startRow()
Starts a new data row.
|
protected GridJSonWriter.JGridSonWriterState state
protected boolean dataDeclared
protected boolean totalLengthDeclared
protected boolean offsetDeclared
protected Writer writer
protected boolean firstField
protected boolean firstRow
protected boolean firstColumn
protected int rowsCount
protected int fieldsCount
public GridJSonWriter(Writer writer) throws IOException
IOExceptionprotected void checkState(GridJSonWriter.JGridSonWriterState expectedState)
protected void checkFirstField()
throws IOException
IOExceptionpublic void startData(String dataField) throws IOException
dataField - the data field name.IOExceptionpublic void startRow()
throws IOException
IOExceptionprotected void addKey(String key) throws IOException
IOExceptionprotected void addValueKey(String key) throws IOException
IOExceptionpublic void addValue(String id, Boolean value) throws IOException
id - the value id.value - the value to insert.IOExceptionpublic void addValue(String id, Date value) throws IOException
id - the value id.value - the value to insert.IOExceptionpublic void addValue(String id, Double value) throws IOException
id - the value id.value - the value to insert.IOExceptionpublic void addValue(String id, Float value) throws IOException
id - the value id.value - the value to insert.IOExceptionpublic void addValue(String id, Long value) throws IOException
id - the value id.value - the value to insert.IOExceptionpublic void addValue(String id, String value) throws IOException
id - the value id.value - the value to insert.IOExceptionpublic void endRow()
throws IOException
IOExceptionpublic void endData()
throws IOException
IOExceptionpublic void setTotalLength(String totalLengthField, int length) throws IOException
totalLengthField - length - IOExceptionpublic void setOffset(String offsetField, int offset) throws IOException
IOExceptionpublic void close()
throws IOException
IOExceptionprotected void appendQuoted(String value) throws IOException
value - A StringIOExceptionCopyright © 2014. All Rights Reserved.