Top Description Fields Constructors Methods
org.jooq.impl

public final Class CallbackFormattingProvider

extends Object
implements FormattingProvider
Class Inheritance
All Implemented Interfaces
org.jooq.FormattingProvider
Imports
java.util.function.Consumer, .Supplier, .ToIntFunction, org.jooq.CSVFormat, .ChartFormat, .FormattingProvider, .JSONFormat, .TXTFormat, .VisitContext, .XMLFormat, org.jetbrains.annotations.NotNull

A FormattingProvider that allows for functional composition.

For example:


FormattingProvider listener = FormattingProvider
  .on(ctx -> something())
  .onVisitEnd(ctx -> something());
Author
Lukas Eder

Field Summary

Modifier and TypeField and Description
private static final DefaultFormattingProvider
private final Supplier<? extends ChartFormat>
private final Supplier<? extends CSVFormat>
private final Supplier<? extends JSONFormat>
private final Supplier<? extends JSONFormat>
private final Supplier<? extends TXTFormat>
private final ToIntFunction<? super String>
private final Supplier<? extends XMLFormat>
private final Supplier<? extends XMLFormat>

Constructor Summary

AccessConstructor and Description
public
private
CallbackFormattingProvider(Supplier<? extends TXTFormat> onTxtFormat, Supplier<? extends CSVFormat> onCsvFormat, Supplier<? extends JSONFormat> onJsonFormatForResults, Supplier<? extends JSONFormat> onJsonFormatForRecords, Supplier<? extends XMLFormat> onXmlFormatForResults, Supplier<? extends XMLFormat> onXmlFormatForRecords, Supplier<? extends ChartFormat> onChartFormat, ToIntFunction<? super String> onWidth)

Method Summary

Modifier and TypeMethod and Description
public final @NotNull ChartFormat
chartFormat()

Implements org.jooq.FormattingProvider.chartFormat.

The ChartFormat to use when calling Formattable#formatChart() and related methods, defaulting to ChartFormat#DEFAULT.
public final @NotNull CSVFormat
csvFormat()

Implements org.jooq.FormattingProvider.csvFormat.

The CSVFormat to use when calling Formattable#formatCSV() and related methods, defaulting to CSVFormat#DEFAULT.
public final @NotNull JSONFormat
jsonFormatForRecords()

Implements org.jooq.FormattingProvider.jsonFormatForRecords.

The JSONFormat to use when calling Formattable#formatJSON() and related methods on records, defaulting to JSONFormat#DEFAULT_FOR_RECORDS.
public final @NotNull JSONFormat
jsonFormatForResults()

Implements org.jooq.FormattingProvider.jsonFormatForResults.

The JSONFormat to use when calling Formattable#formatJSON() and related methods on results, defaulting to JSONFormat#DEFAULT_FOR_RESULTS.
public final @NotNull CallbackFormattingProvider
onChartFormat(Supplier<? extends ChartFormat> newOnChartFormat)

Hides org.jooq.FormattingProvider.onChartFormat.

Create an FormattingProvider with a chartFormat() implementation.
public final @NotNull CallbackFormattingProvider
onCsvFormat(Supplier<? extends CSVFormat> newOnCsvFormat)

Hides org.jooq.FormattingProvider.onCsvFormat.

Create an FormattingProvider with a csvFormat() implementation.
public final @NotNull CallbackFormattingProvider
public final @NotNull CallbackFormattingProvider
public final @NotNull CallbackFormattingProvider
onTxtFormat(Supplier<? extends TXTFormat> newOnTxtFormat)

Hides org.jooq.FormattingProvider.onTxtFormat.

Create an FormattingProvider with a txtFormat() implementation.
public final @NotNull CallbackFormattingProvider
onWidth(ToIntFunction<? super String> newOnWidth)

Hides org.jooq.FormattingProvider.onWidth.

Create an FormattingProvider with a width(String) implementation.
public final @NotNull CallbackFormattingProvider
public final @NotNull CallbackFormattingProvider
public final @NotNull TXTFormat
txtFormat()

Implements org.jooq.FormattingProvider.txtFormat.

The TXTFormat to use when calling Formattable#format() and related methods, defaulting to TXTFormat#DEFAULT.
public final int
width(String string)

Implements org.jooq.FormattingProvider.width.

The formatting display width in a monospaced font, which may diverge from String#length() e.g. if the string contains a Character#isIdeographic(int) character.
public final @NotNull XMLFormat
xmlFormatForRecords()

Implements org.jooq.FormattingProvider.xmlFormatForRecords.

The XMLFormat to use when calling Formattable#formatXML() and related methods on records, defaulting to XMLFormat#DEFAULT_FOR_RECORDS.
public final @NotNull XMLFormat
xmlFormatForResults()

Implements org.jooq.FormattingProvider.xmlFormatForResults.

The XMLFormat to use when calling Formattable#formatXML() and related methods on results, defaulting to XMLFormat#DEFAULT_FOR_RESULTS.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULTback to summary
private static final DefaultFormattingProvider DEFAULT
onChartFormatback to summary
private final Supplier<? extends ChartFormat> onChartFormat
onCsvFormatback to summary
private final Supplier<? extends CSVFormat> onCsvFormat
onJsonFormatForRecordsback to summary
private final Supplier<? extends JSONFormat> onJsonFormatForRecords
onJsonFormatForResultsback to summary
private final Supplier<? extends JSONFormat> onJsonFormatForResults
onTxtFormatback to summary
private final Supplier<? extends TXTFormat> onTxtFormat
onWidthback to summary
private final ToIntFunction<? super String> onWidth
onXmlFormatForRecordsback to summary
private final Supplier<? extends XMLFormat> onXmlFormatForRecords
onXmlFormatForResultsback to summary
private final Supplier<? extends XMLFormat> onXmlFormatForResults

Constructor Detail

CallbackFormattingProviderback to summary
public CallbackFormattingProvider()
CallbackFormattingProviderback to summary
private CallbackFormattingProvider(Supplier<? extends TXTFormat> onTxtFormat, Supplier<? extends CSVFormat> onCsvFormat, Supplier<? extends JSONFormat> onJsonFormatForResults, Supplier<? extends JSONFormat> onJsonFormatForRecords, Supplier<? extends XMLFormat> onXmlFormatForResults, Supplier<? extends XMLFormat> onXmlFormatForRecords, Supplier<? extends ChartFormat> onChartFormat, ToIntFunction<? super String> onWidth)

Method Detail

chartFormatback to summary
public final @NotNull ChartFormat chartFormat()

Implements org.jooq.FormattingProvider.chartFormat.

Doc from org.jooq.FormattingProvider.chartFormat.

The ChartFormat to use when calling Formattable#formatChart() and related methods, defaulting to ChartFormat#DEFAULT.

Annotations
@NotNull
@Override
csvFormatback to summary
public final @NotNull CSVFormat csvFormat()

Implements org.jooq.FormattingProvider.csvFormat.

Doc from org.jooq.FormattingProvider.csvFormat.

The CSVFormat to use when calling Formattable#formatCSV() and related methods, defaulting to CSVFormat#DEFAULT.

Annotations
@NotNull
@Override
jsonFormatForRecordsback to summary
public final @NotNull JSONFormat jsonFormatForRecords()

Implements org.jooq.FormattingProvider.jsonFormatForRecords.

Doc from org.jooq.FormattingProvider.jsonFormatForRecords.

The JSONFormat to use when calling Formattable#formatJSON() and related methods on records, defaulting to JSONFormat#DEFAULT_FOR_RECORDS.

Annotations
@NotNull
@Override
jsonFormatForResultsback to summary
public final @NotNull JSONFormat jsonFormatForResults()

Implements org.jooq.FormattingProvider.jsonFormatForResults.

Doc from org.jooq.FormattingProvider.jsonFormatForResults.

The JSONFormat to use when calling Formattable#formatJSON() and related methods on results, defaulting to JSONFormat#DEFAULT_FOR_RESULTS.

Annotations
@NotNull
@Override
onChartFormatback to summary
public final @NotNull CallbackFormattingProvider onChartFormat(Supplier<? extends ChartFormat> newOnChartFormat)

Hides org.jooq.FormattingProvider.onChartFormat.

Doc from org.jooq.FormattingProvider.onChartFormat.

Create an FormattingProvider with a chartFormat() implementation.

Annotations
@NotNull
onCsvFormatback to summary
public final @NotNull CallbackFormattingProvider onCsvFormat(Supplier<? extends CSVFormat> newOnCsvFormat)

Hides org.jooq.FormattingProvider.onCsvFormat.

Doc from org.jooq.FormattingProvider.onCsvFormat.

Create an FormattingProvider with a csvFormat() implementation.

Annotations
@NotNull
onJsonFormatForRecordsback to summary
public final @NotNull CallbackFormattingProvider onJsonFormatForRecords(Supplier<? extends JSONFormat> newOnJsonFormatForRecords)

Hides org.jooq.FormattingProvider.onJsonFormatForRecords.

Doc from org.jooq.FormattingProvider.onJsonFormatForRecords.

Create an FormattingProvider with a jsonFormatForRecords() implementation.

Annotations
@NotNull
onJsonFormatForResultsback to summary
public final @NotNull CallbackFormattingProvider onJsonFormatForResults(Supplier<? extends JSONFormat> newOnJsonFormatForResults)

Hides org.jooq.FormattingProvider.onJsonFormatForResults.

Doc from org.jooq.FormattingProvider.onJsonFormatForResults.

Create an FormattingProvider with a jsonFormatForResults() implementation.

Annotations
@NotNull
onTxtFormatback to summary
public final @NotNull CallbackFormattingProvider onTxtFormat(Supplier<? extends TXTFormat> newOnTxtFormat)

Hides org.jooq.FormattingProvider.onTxtFormat.

Doc from org.jooq.FormattingProvider.onTxtFormat.

Create an FormattingProvider with a txtFormat() implementation.

Annotations
@NotNull
onWidthback to summary
public final @NotNull CallbackFormattingProvider onWidth(ToIntFunction<? super String> newOnWidth)

Hides org.jooq.FormattingProvider.onWidth.

Doc from org.jooq.FormattingProvider.onWidth.

Create an FormattingProvider with a width(String) implementation.

Annotations
@NotNull
onXmlFormatForRecordsback to summary
public final @NotNull CallbackFormattingProvider onXmlFormatForRecords(Supplier<? extends XMLFormat> newOnXmlFormatForRecords)

Hides org.jooq.FormattingProvider.onXmlFormatForRecords.

Doc from org.jooq.FormattingProvider.onXmlFormatForRecords.

Create an FormattingProvider with a xmlFormatForRecords() implementation.

Annotations
@NotNull
onXmlFormatForResultsback to summary
public final @NotNull CallbackFormattingProvider onXmlFormatForResults(Supplier<? extends XMLFormat> newOnXmlFormatForResults)

Hides org.jooq.FormattingProvider.onXmlFormatForResults.

Doc from org.jooq.FormattingProvider.onXmlFormatForResults.

Create an FormattingProvider with a xmlFormatForResults() implementation.

Annotations
@NotNull
txtFormatback to summary
public final @NotNull TXTFormat txtFormat()

Implements org.jooq.FormattingProvider.txtFormat.

Doc from org.jooq.FormattingProvider.txtFormat.

The TXTFormat to use when calling Formattable#format() and related methods, defaulting to TXTFormat#DEFAULT.

Annotations
@NotNull
@Override
widthback to summary
public final int width(String string)

Implements org.jooq.FormattingProvider.width.

Doc from org.jooq.FormattingProvider.width.

The formatting display width in a monospaced font, which may diverge from String#length() e.g. if the string contains a Character#isIdeographic(int) character.

Annotations
@Override
xmlFormatForRecordsback to summary
public final @NotNull XMLFormat xmlFormatForRecords()

Implements org.jooq.FormattingProvider.xmlFormatForRecords.

Doc from org.jooq.FormattingProvider.xmlFormatForRecords.

The XMLFormat to use when calling Formattable#formatXML() and related methods on records, defaulting to XMLFormat#DEFAULT_FOR_RECORDS.

Annotations
@NotNull
@Override
xmlFormatForResultsback to summary
public final @NotNull XMLFormat xmlFormatForResults()

Implements org.jooq.FormattingProvider.xmlFormatForResults.

Doc from org.jooq.FormattingProvider.xmlFormatForResults.

The XMLFormat to use when calling Formattable#formatXML() and related methods on results, defaulting to XMLFormat#DEFAULT_FOR_RESULTS.

Annotations
@NotNull
@Override