-
- All Known Subinterfaces:
Cursor<R>
,EmbeddableRecord<R>
,Record
,Record1<T1>
,Record10<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10>
,Record11<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11>
,Record12<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12>
,Record13<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13>
,Record14<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14>
,Record15<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>
,Record16<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16>
,Record17<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17>
,Record18<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18>
,Record19<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19>
,Record2<T1,T2>
,Record20<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20>
,Record21<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21>
,Record22<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22>
,Record3<T1,T2,T3>
,Record4<T1,T2,T3,T4>
,Record5<T1,T2,T3,T4,T5>
,Record6<T1,T2,T3,T4,T5,T6>
,Record7<T1,T2,T3,T4,T5,T6,T7>
,Record8<T1,T2,T3,T4,T5,T6,T7,T8>
,Record9<T1,T2,T3,T4,T5,T6,T7,T8,T9>
,Result<R>
,TableRecord<R>
,UDTRecord<R>
,UpdatableRecord<R>
- All Known Implementing Classes:
ArrayRecordImpl
,CustomRecord
,EmbeddableRecordImpl
,TableRecordImpl
,UDTRecordImpl
,UpdatableRecordImpl
public interface Formattable
A type that can format its contents.This type provides a common interface for
Result
andCursor
formatting functionality, which includes formatting results to:- Charts
- CSV
- HTML
- INSERT statements
- JSON
- Text
- XML
Calling formatting methods on a
Result
is repeatable as theResult
has been previously materialised in memory and the database resource is closed. Calling these methods on aCursor
is not repeatable as theCursor
(and the underlying JDBCResultSet
) is consumed entirely, and closed eagerly after consumption.- Author:
- Lukas Eder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
format()
Get a simple formatted representation of this result.String
format(int maxRecords)
Get a simple formatted representation of this result.void
format(OutputStream stream)
Likeformat()
, but the data is output onto anOutputStream
.void
format(OutputStream stream, int maxRecords)
Likeformat(int)
, but the data is output onto anOutputStream
.void
format(OutputStream stream, TXTFormat format)
Likeformat(TXTFormat)
, but the data is output onto anOutputStream
.void
format(Writer writer)
void
format(Writer writer, int maxRecords)
Likeformat(int)
, but the data is output onto aWriter
.void
format(Writer writer, TXTFormat format)
Likeformat(TXTFormat)
, but the data is output onto aWriter
.String
format(TXTFormat format)
Get a simple formatted representation of this result.String
formatChart()
void
formatChart(OutputStream stream)
LikeformatChart()
, but the data is output onto anOutputStream
.void
formatChart(OutputStream stream, ChartFormat format)
LikeformatChart(ChartFormat)
, but the data is output onto anOutputStream
.void
formatChart(Writer writer)
LikeformatChart()
, but the data is output onto aWriter
.void
formatChart(Writer writer, ChartFormat format)
LikeformatChart(ChartFormat)
, but the data is output onto aWriter
.String
formatChart(ChartFormat format)
String
formatCSV()
Get a simple formatted representation of this result as CSV.String
formatCSV(boolean header)
Get a simple formatted representation of this result as CSV.String
formatCSV(boolean header, char delimiter)
Get a simple formatted representation of this result as CSV.String
formatCSV(boolean header, char delimiter, String nullString)
Get a simple formatted representation of this result as CSV.String
formatCSV(char delimiter)
Get a simple formatted representation of this result as CSV.String
formatCSV(char delimiter, String nullString)
Get a simple formatted representation of this result as CSV.void
formatCSV(OutputStream stream)
LikeformatCSV()
, but the data is output onto anOutputStream
.void
formatCSV(OutputStream stream, boolean header)
LikeformatCSV(boolean)
, but the data is output onto anOutputStream
.void
formatCSV(OutputStream stream, boolean header, char delimiter)
LikeformatCSV(boolean, char)
, but the data is output onto anOutputStream
.void
formatCSV(OutputStream stream, boolean header, char delimiter, String nullString)
LikeformatCSV(boolean, char, String)
, but the data is output onto anOutputStream
.void
formatCSV(OutputStream stream, char delimiter)
LikeformatCSV(char)
, but the data is output onto anOutputStream
.void
formatCSV(OutputStream stream, char delimiter, String nullString)
LikeformatCSV(char, String)
, but the data is output onto anOutputStream
.void
formatCSV(OutputStream stream, CSVFormat format)
LikeformatCSV(CSVFormat)
, but the data is output onto anOutputStream
.void
formatCSV(Writer writer)
LikeformatCSV()
, but the data is output onto aWriter
.void
formatCSV(Writer writer, boolean header)
LikeformatCSV(boolean)
, but the data is output onto aWriter
.void
formatCSV(Writer writer, boolean header, char delimiter)
LikeformatCSV(boolean, char)
, but the data is output onto aWriter
.void
formatCSV(Writer writer, boolean header, char delimiter, String nullString)
LikeformatCSV(boolean, char, String)
, but the data is output onto aWriter
.void
formatCSV(Writer writer, char delimiter)
LikeformatCSV(char)
, but the data is output onto aWriter
.void
formatCSV(Writer writer, char delimiter, String nullString)
LikeformatCSV(char, String)
, but the data is output onto aWriter
.void
formatCSV(Writer writer, CSVFormat format)
LikeformatCSV(CSVFormat)
, but the data is output onto aWriter
.String
formatCSV(CSVFormat format)
Get a simple formatted representation of this result as CSV.String
formatHTML()
Get a simple formatted representation of this result as HTML.void
formatHTML(OutputStream stream)
LikeformatHTML()
, but the data is output onto anOutputStream
.void
formatHTML(Writer writer)
LikeformatHTML()
, but the data is output onto aWriter
.String
formatInsert()
Get this result as a set ofINSERT
statements.void
formatInsert(OutputStream stream)
LikeformatInsert()
, but the data is output onto anOutputStream
.void
formatInsert(OutputStream stream, Table<?> table, Field<?>... fields)
LikeformatInsert(Table, Field...)
, but the data is output onto anOutputStream
.void
formatInsert(Writer writer)
LikeformatInsert()
, but the data is output onto aWriter
.void
formatInsert(Writer writer, Table<?> table, Field<?>... fields)
LikeformatInsert(Table, Field...)
, but the data is output onto anWriter
.String
formatInsert(Table<?> table, Field<?>... fields)
Get this result as a set ofINSERT
statements.String
formatJSON()
Get a simple formatted representation of this result as a JSON array of array.void
formatJSON(OutputStream stream)
LikeformatJSON()
, but the data is output onto anOutputStream
.void
formatJSON(OutputStream stream, JSONFormat format)
LikeformatJSON(JSONFormat)
, but the data is output onto anOutputStream
.void
formatJSON(Writer writer)
LikeformatJSON()
, but the data is output onto aWriter
.void
formatJSON(Writer writer, JSONFormat format)
LikeformatJSON(JSONFormat)
, but the data is output onto aWriter
.String
formatJSON(JSONFormat format)
Get a simple formatted representation of this result as a JSON data structure, according to the format.String
formatXML()
Get this result formatted as XML.void
formatXML(OutputStream stream)
LikeformatXML()
, but the data is output onto anOutputStream
.void
formatXML(OutputStream stream, XMLFormat format)
LikeformatXML(XMLFormat)
, but the data is output onto anOutputStream
.void
formatXML(Writer writer)
LikeformatXML()
, but the data is output onto aWriter
.void
formatXML(Writer writer, XMLFormat format)
LikeformatXML(XMLFormat)
, but the data is output onto aWriter
.String
formatXML(XMLFormat format)
Get this result formatted as XML.Document
intoXML()
Get this result as XML.<H extends ContentHandler>
HintoXML(H handler)
Get this result as XML using a SAXContentHandler
.<H extends ContentHandler>
HintoXML(H handler, XMLFormat format)
Get this result as XML using a SAXContentHandler
.Document
intoXML(XMLFormat format)
Get this result as XML.
-
-
-
Method Detail
-
format
String format()
Get a simple formatted representation of this result.This is the same as calling
format(int)
withmaxRows = Integer.MAX_VALUE
- Returns:
- The formatted result
-
format
String format(int maxRecords)
Get a simple formatted representation of this result.- Parameters:
maxRecords
- The maximum number of records to include in the formatted result- Returns:
- The formatted result
-
format
String format(TXTFormat format)
Get a simple formatted representation of this result.- Parameters:
format
- The formatting information- Returns:
- The formatted result
-
formatHTML
String formatHTML()
Get a simple formatted representation of this result as HTML.The HTML code is formatted as follows:
<table> <thead> <tr> <th>field-1</th> <th>field-2</th> ... <th>field-n</th> </tr> </thead> <tbody> <tr> <th>value-1-1</th> <th>value-1-2</th> ... <th>value-1-n</th> </tr> <tr> <th>value-2-1</th> <th>value-2-2</th> ... <th>value-2-n</th> </tr> ... </tbody> </table>
- Returns:
- The formatted result
-
formatCSV
String formatCSV()
Get a simple formatted representation of this result as CSV.This is the same as calling
formatCSV(true, ',', "")
- Returns:
- The formatted result
-
formatCSV
String formatCSV(char delimiter)
Get a simple formatted representation of this result as CSV.This is the same as calling
formatCSV(true, delimiter, "")
- Parameters:
delimiter
- The delimiter to use between records- Returns:
- The formatted result
-
formatCSV
String formatCSV(char delimiter, String nullString)
Get a simple formatted representation of this result as CSV.This is the same as calling
formatCSV(true, delimiter, nullString)
- Parameters:
delimiter
- The delimiter to use between recordsnullString
- A special string for encodingNULL
values.- Returns:
- The formatted result
-
formatCSV
String formatCSV(boolean header)
Get a simple formatted representation of this result as CSV.This is the same as calling
formatCSV(',', "")
- Parameters:
header
- Whether to emit a CSV header line- Returns:
- The formatted result
-
formatCSV
String formatCSV(boolean header, char delimiter)
Get a simple formatted representation of this result as CSV.This is the same as calling
formatCSV(delimiter, "")
- Parameters:
header
- Whether to emit a CSV header linedelimiter
- The delimiter to use between records- Returns:
- The formatted result
-
formatCSV
String formatCSV(boolean header, char delimiter, String nullString)
Get a simple formatted representation of this result as CSV.- Parameters:
header
- Whether to emit a CSV header linedelimiter
- The delimiter to use between recordsnullString
- A special string for encodingNULL
values.- Returns:
- The formatted result
-
formatCSV
String formatCSV(CSVFormat format)
Get a simple formatted representation of this result as CSV.- Returns:
- The formatted result
-
formatJSON
String formatJSON()
Get a simple formatted representation of this result as a JSON array of array.The format is the following:
{"fields":[{"name":"field-1","type":"type-1"}, {"name":"field-2","type":"type-2"}, ..., {"name":"field-n","type":"type-n"}], "records":[[value-1-1,value-1-2,...,value-1-n], [value-2-1,value-2-2,...,value-2-n]]}
- Returns:
- The formatted result
-
formatJSON
String formatJSON(JSONFormat format)
Get a simple formatted representation of this result as a JSON data structure, according to the format.- Returns:
- The formatted result
- See Also:
JSONFormat
-
formatXML
String formatXML()
Get this result formatted as XML.
-
formatChart
String formatChart()
-
formatChart
String formatChart(ChartFormat format)
-
formatInsert
String formatInsert()
Get this result as a set ofINSERT
statements.This uses the the first record's
TableRecord.getTable()
, if the first record is aTableRecord
. Otherwise, this generatesINSERT
statements into an"UNKNOWN_TABLE"
. In both cases, theResult.fields()
are used for column names.
-
formatInsert
String formatInsert(Table<?> table, Field<?>... fields)
Get this result as a set ofINSERT
statements.This explicitly specifies the table (and optionally the fields) to insert into. If the
fields
argument is left empty, theResult.fields()
are used, instead.
-
format
void format(OutputStream stream) throws IOException
Likeformat()
, but the data is output onto anOutputStream
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
format
void format(OutputStream stream, int maxRecords) throws IOException
Likeformat(int)
, but the data is output onto anOutputStream
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
format
void format(OutputStream stream, TXTFormat format) throws IOException
Likeformat(TXTFormat)
, but the data is output onto anOutputStream
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatHTML
void formatHTML(OutputStream stream) throws IOException
LikeformatHTML()
, but the data is output onto anOutputStream
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatCSV
void formatCSV(OutputStream stream) throws IOException
LikeformatCSV()
, but the data is output onto anOutputStream
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatCSV
void formatCSV(OutputStream stream, char delimiter) throws IOException
LikeformatCSV(char)
, but the data is output onto anOutputStream
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatCSV
void formatCSV(OutputStream stream, char delimiter, String nullString) throws IOException
LikeformatCSV(char, String)
, but the data is output onto anOutputStream
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatCSV
void formatCSV(OutputStream stream, boolean header) throws IOException
LikeformatCSV(boolean)
, but the data is output onto anOutputStream
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatCSV
void formatCSV(OutputStream stream, boolean header, char delimiter) throws IOException
LikeformatCSV(boolean, char)
, but the data is output onto anOutputStream
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatCSV
void formatCSV(OutputStream stream, boolean header, char delimiter, String nullString) throws IOException
LikeformatCSV(boolean, char, String)
, but the data is output onto anOutputStream
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatCSV
void formatCSV(OutputStream stream, CSVFormat format) throws IOException
LikeformatCSV(CSVFormat)
, but the data is output onto anOutputStream
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatJSON
void formatJSON(OutputStream stream) throws IOException
LikeformatJSON()
, but the data is output onto anOutputStream
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatJSON
void formatJSON(OutputStream stream, JSONFormat format) throws IOException
LikeformatJSON(JSONFormat)
, but the data is output onto anOutputStream
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatXML
void formatXML(OutputStream stream) throws IOException
LikeformatXML()
, but the data is output onto anOutputStream
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatXML
void formatXML(OutputStream stream, XMLFormat format) throws IOException
LikeformatXML(XMLFormat)
, but the data is output onto anOutputStream
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatChart
void formatChart(OutputStream stream) throws IOException
LikeformatChart()
, but the data is output onto anOutputStream
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatChart
void formatChart(OutputStream stream, ChartFormat format) throws IOException
LikeformatChart(ChartFormat)
, but the data is output onto anOutputStream
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatInsert
void formatInsert(OutputStream stream) throws IOException
LikeformatInsert()
, but the data is output onto anOutputStream
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatInsert
void formatInsert(OutputStream stream, Table<?> table, Field<?>... fields) throws IOException
LikeformatInsert(Table, Field...)
, but the data is output onto anOutputStream
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
format
void format(Writer writer) throws IOException
- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
format
void format(Writer writer, int maxRecords) throws IOException
Likeformat(int)
, but the data is output onto aWriter
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
format
void format(Writer writer, TXTFormat format) throws IOException
Likeformat(TXTFormat)
, but the data is output onto aWriter
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatHTML
void formatHTML(Writer writer) throws IOException
LikeformatHTML()
, but the data is output onto aWriter
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatCSV
void formatCSV(Writer writer) throws IOException
LikeformatCSV()
, but the data is output onto aWriter
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatCSV
void formatCSV(Writer writer, char delimiter) throws IOException
LikeformatCSV(char)
, but the data is output onto aWriter
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatCSV
void formatCSV(Writer writer, char delimiter, String nullString) throws IOException
LikeformatCSV(char, String)
, but the data is output onto aWriter
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatCSV
void formatCSV(Writer writer, boolean header) throws IOException
LikeformatCSV(boolean)
, but the data is output onto aWriter
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatCSV
void formatCSV(Writer writer, boolean header, char delimiter) throws IOException
LikeformatCSV(boolean, char)
, but the data is output onto aWriter
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatCSV
void formatCSV(Writer writer, boolean header, char delimiter, String nullString) throws IOException
LikeformatCSV(boolean, char, String)
, but the data is output onto aWriter
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatCSV
void formatCSV(Writer writer, CSVFormat format) throws IOException
LikeformatCSV(CSVFormat)
, but the data is output onto aWriter
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatJSON
void formatJSON(Writer writer) throws IOException
LikeformatJSON()
, but the data is output onto aWriter
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatJSON
void formatJSON(Writer writer, JSONFormat format) throws IOException
LikeformatJSON(JSONFormat)
, but the data is output onto aWriter
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatXML
void formatXML(Writer writer) throws IOException
LikeformatXML()
, but the data is output onto aWriter
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatXML
void formatXML(Writer writer, XMLFormat format) throws IOException
LikeformatXML(XMLFormat)
, but the data is output onto aWriter
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatChart
void formatChart(Writer writer) throws IOException
LikeformatChart()
, but the data is output onto aWriter
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatChart
void formatChart(Writer writer, ChartFormat format) throws IOException
LikeformatChart(ChartFormat)
, but the data is output onto aWriter
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatInsert
void formatInsert(Writer writer) throws IOException
LikeformatInsert()
, but the data is output onto aWriter
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
formatInsert
void formatInsert(Writer writer, Table<?> table, Field<?>... fields) throws IOException
LikeformatInsert(Table, Field...)
, but the data is output onto anWriter
.- Throws:
IOException
- - an unchecked wrapper forIOException
, if anything goes wrong.
-
intoXML
Document intoXML()
Get this result as XML.
-
intoXML
<H extends ContentHandler> H intoXML(H handler) throws SAXException
Get this result as XML using a SAXContentHandler
.- Parameters:
handler
- The custom content handler.- Returns:
- The argument content handler is returned for convenience.
- Throws:
SAXException
- See Also:
formatXML()
, http://www.jooq.org/xsd/jooq-export-3.10.0.xsd
-
intoXML
<H extends ContentHandler> H intoXML(H handler, XMLFormat format) throws SAXException
Get this result as XML using a SAXContentHandler
.- Parameters:
handler
- The custom content handler.- Returns:
- The argument content handler is returned for convenience.
- Throws:
SAXException
- See Also:
formatXML()
, http://www.jooq.org/xsd/jooq-export-3.10.0.xsd
-
-