public class JFlat extends Object
| Constructor and Description |
|---|
JFlat(String jsonString)
This constructor takes a Json as string.
|
| Modifier and Type | Method and Description |
|---|---|
List<Object[]> |
getJsonAsSheet()
This method returns the sheet matrix.
|
List<String> |
getUniqueFields()
This method returns unique fields of the json
|
JFlat |
headerSeparator()
This method replaces the default header separator i.e.
|
JFlat |
headerSeparator(String separator)
This method replaces the default header separator i.e.
|
JFlat |
json2Sheet()
This method does some pre processing and then calls make2D() to get the
2D representation of Json document.
|
void |
write2csv(String destination)
This method writes the 2D representation in csv format with ',' as
default delimiter.
|
void |
write2csv(String destination,
char delimiter)
This method writes the 2D representation in csv format with custom
delimiter set by user.
|
public JFlat(String jsonString)
jsonString - it takes Json as string.public JFlat json2Sheet()
public JFlat headerSeparator() throws Exception
Exceptionpublic JFlat headerSeparator(String separator) throws Exception
separator - Exceptionpublic List<Object[]> getJsonAsSheet()
public List<String> getUniqueFields()
public void write2csv(String destination) throws FileNotFoundException, UnsupportedEncodingException
destination - it takes the destination path for the csv file.FileNotFoundExceptionUnsupportedEncodingExceptionpublic void write2csv(String destination, char delimiter) throws FileNotFoundException, UnsupportedEncodingException
destination - it takes the destination path for the csv file.delimiter - it represents the delimiter set by user.FileNotFoundExceptionUnsupportedEncodingExceptionCopyright © 2017. All rights reserved.