Class ExporterJSON
- java.lang.Object
-
- com.helger.photon.exchange.bulkexport.format.ExporterJSON
-
- All Implemented Interfaces:
IExporter,IExporterFile
@NotThreadSafe public class ExporterJSON extends Object implements IExporterFile
Implementation ofIExporterFilefor JSON files- Author:
- Philip Helger
-
-
Field Summary
Fields Modifier and Type Field Description static StringATTR_TYPEstatic StringATTR_VALUEstatic booleanDEFAULT_EMIT_TYPEstatic StringELEMENT_BODYstatic StringELEMENT_FOOTERstatic StringELEMENT_HEADER
-
Constructor Summary
Constructors Constructor Description ExporterJSON()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.helger.json.IJsonObjectconvertRecords(IExportRecordProvider aProvider)com.helger.commons.state.ESuccessexportRecords(IExportRecordProvider aProvider, OutputStream aOS)Export all provided records to an output stream.CharsetgetCharset()EExchangeFileTypegetFileType()com.helger.json.serialize.IJsonWriterSettingsgetJsonWriterSettings()booleanisEmitType()com.helger.json.serialize.JsonWriterSettingsjsonWriterSettings()ExporterJSONsetCharset(Charset aCharset)ExporterJSONsetEmitType(boolean bEmitType)ExporterJSONsetJsonWriterSettings(com.helger.json.serialize.JsonWriterSettings aJWS)
-
-
-
Field Detail
-
DEFAULT_EMIT_TYPE
public static final boolean DEFAULT_EMIT_TYPE
- See Also:
- Constant Field Values
-
ELEMENT_HEADER
public static final String ELEMENT_HEADER
- See Also:
- Constant Field Values
-
ELEMENT_BODY
public static final String ELEMENT_BODY
- See Also:
- Constant Field Values
-
ELEMENT_FOOTER
public static final String ELEMENT_FOOTER
- See Also:
- Constant Field Values
-
ATTR_TYPE
public static final String ATTR_TYPE
- See Also:
- Constant Field Values
-
ATTR_VALUE
public static final String ATTR_VALUE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getFileType
@Nonnull public final EExchangeFileType getFileType()
- Specified by:
getFileTypein interfaceIExporterFile- Returns:
- The file type for export.
-
setCharset
@Nonnull public final ExporterJSON setCharset(@Nonnull Charset aCharset)
-
jsonWriterSettings
@Nonnull @ReturnsMutableObject public final com.helger.json.serialize.JsonWriterSettings jsonWriterSettings()
-
getJsonWriterSettings
@Nonnull @ReturnsImmutableObject public final com.helger.json.serialize.IJsonWriterSettings getJsonWriterSettings()
-
setJsonWriterSettings
@Nonnull public final ExporterJSON setJsonWriterSettings(@Nonnull com.helger.json.serialize.JsonWriterSettings aJWS)
-
isEmitType
public final boolean isEmitType()
-
setEmitType
@Nonnull public final ExporterJSON setEmitType(boolean bEmitType)
-
convertRecords
@Nullable public com.helger.json.IJsonObject convertRecords(@Nonnull IExportRecordProvider aProvider)
-
exportRecords
@Nonnull public com.helger.commons.state.ESuccess exportRecords(@Nonnull IExportRecordProvider aProvider, @Nonnull @WillClose OutputStream aOS)
Description copied from interface:IExporterExport all provided records to an output stream.- Specified by:
exportRecordsin interfaceIExporter- Parameters:
aProvider- The provider for all records. May not benull.aOS- The output stream to write to. Will be closed automatically in any case. May not benull.- Returns:
ESuccess.SUCCESSif at lease one record was provided and saving was successful.
-
-