Class ExporterXML
- java.lang.Object
-
- com.helger.photon.exchange.bulkexport.format.ExporterXML
-
- All Implemented Interfaces:
IExporter,IExporterFile
@NotThreadSafe public class ExporterXML extends Object implements IExporterFile
Implementation ofIExporterFilefor XML files- Author:
- Philip Helger
-
-
Field Summary
Fields Modifier and Type Field Description static StringATTR_TYPEstatic booleanDEFAULT_EMIT_TYPE_ATTRIBUTEstatic StringELEMENT_BODYstatic StringELEMENT_FIELDstatic StringELEMENT_FOOTERstatic StringELEMENT_HEADERstatic StringELEMENT_RECORDstatic StringELEMENT_ROOT
-
Constructor Summary
Constructors Constructor Description ExporterXML()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.helger.xml.microdom.IMicroDocumentconvertRecords(IExportRecordProvider aProvider)com.helger.commons.state.ESuccessexportRecords(IExportRecordProvider aProvider, OutputStream aOS)Export all provided records to an output stream.CharsetgetCharset()EExchangeFileTypegetFileType()com.helger.xml.serialize.write.IXMLWriterSettingsgetXMLWriterSettings()booleanisEmitTypeAttr()ExporterXMLsetCharset(Charset aCharset)ExporterXMLsetEmitTypeAttr(boolean bEmitTypeAttr)com.helger.xml.serialize.write.XMLWriterSettingsxmlWriterSettings()
-
-
-
Field Detail
-
DEFAULT_EMIT_TYPE_ATTRIBUTE
public static final boolean DEFAULT_EMIT_TYPE_ATTRIBUTE
- See Also:
- Constant Field Values
-
ELEMENT_ROOT
public static final String ELEMENT_ROOT
- 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
-
ELEMENT_RECORD
public static final String ELEMENT_RECORD
- See Also:
- Constant Field Values
-
ELEMENT_FIELD
public static final String ELEMENT_FIELD
- See Also:
- Constant Field Values
-
ATTR_TYPE
public static final String ATTR_TYPE
- 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 ExporterXML setCharset(@Nonnull Charset aCharset)
-
xmlWriterSettings
@Nonnull @ReturnsMutableObject public final com.helger.xml.serialize.write.XMLWriterSettings xmlWriterSettings()
-
getXMLWriterSettings
@Nonnull @ReturnsImmutableObject public final com.helger.xml.serialize.write.IXMLWriterSettings getXMLWriterSettings()
-
isEmitTypeAttr
public final boolean isEmitTypeAttr()
-
setEmitTypeAttr
@Nonnull public final ExporterXML setEmitTypeAttr(boolean bEmitTypeAttr)
-
convertRecords
@Nullable public com.helger.xml.microdom.IMicroDocument 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.
-
-