Package pulse.io.export
Class MetadataExporter
- java.lang.Object
-
- pulse.io.export.MetadataExporter
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexport(Metadata metadata, File file, Extension extension)Ignores metadata whose external IDs are negative, otherwise calls the superclass method.static MetadataExportergetInstance()Retrieves the single instance of this class.Extension[]getSupportedExtensions()Returns an array of supported extensions, which by default contains only the default extension.voidprintToStream(Metadata metadata, FileOutputStream fos, Extension extension)Prints the metadata content in html format in two columns, where the first column forms the description of the entry and the second column gives its value.Class<Metadata>target()Defines the class, instances of which can be fed into the exporter to produce a result.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface pulse.io.export.Exporter
askToExport
-
-
-
-
Method Detail
-
getInstance
public static MetadataExporter getInstance()
Retrieves the single instance of this class.- Returns:
- a single instance of
MetadataExporter.
-
printToStream
public void printToStream(Metadata metadata, FileOutputStream fos, Extension extension)
Prints the metadata content in html format in two columns, where the first column forms the description of the entry and the second column gives its value. Extension is ignored, as only html is supported.- Specified by:
printToStreamin interfaceExporter<Metadata>- Parameters:
metadata- the exported targetfos- a FileOutputStream created by theexportmethodextension- an extension of the file saved on disk- See Also:
Exporter.export(T,java.io.File,pulse.io.export.Extension),Exporter.askToExport(T,javax.swing.JFrame,java.lang.String,java.io.File)
-
export
public void export(Metadata metadata, File file, Extension extension)
Ignores metadata whose external IDs are negative, otherwise calls the superclass method.- Specified by:
exportin interfaceExporter<Metadata>- Parameters:
metadata- aDescriptivetargetfile- the directory where the contents will be exported to.extension- the file extension. If it is not supported, the exporter will revert to its default extension- See Also:
Exporter.printToStream(T,java.io.FileOutputStream,pulse.io.export.Extension)
-
target
public Class<Metadata> target()
Description copied from interface:ExporterDefines the class, instances of which can be fed into the exporter to produce a result.
-
getSupportedExtensions
public Extension[] getSupportedExtensions()
Description copied from interface:ExporterReturns an array of supported extensions, which by default contains only the default extension.- Specified by:
getSupportedExtensionsin interfaceExporter<Metadata>- Returns:
- a single-element array containing
Extension.HTML
-
-