Package ghidra.app.util.exporter
Class Exporter
- java.lang.Object
- 
- ghidra.app.util.exporter.Exporter
 
- 
- All Implemented Interfaces:
- ExtensionPoint
 - Direct Known Subclasses:
- AsciiExporter,- BinaryExporter,- GzfExporter,- HtmlExporter,- IntelHexExporter,- ProjectArchiveExporter,- XmlExporter
 
 public abstract class Exporter extends java.lang.Object implements ExtensionPoint The interface that all exporters must implement.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface ghidra.util.classfinder.ExtensionPointExtensionPoint.Exclude, ExtensionPoint.Util
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected static java.util.List<Option>EMPTY_OPTIONSprotected MessageLoglogprotected ServiceProviderprovider
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedExporter(java.lang.String name, java.lang.String extension, HelpLocation help)Constructs a new exporter.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleancanExportDomainObject(java.lang.Class<? extends DomainObject> domainObjectClass)Returns true if this exporter knows how to export the given domain object.abstract booleanexport(java.io.File file, DomainObject domainObj, AddressSetView addrSet, TaskMonitor monitor)Actually does the work of exporting the program.java.lang.StringgetDefaultFileExtension()Returns the default extension for this exporter.HelpLocationgetHelpLocation()Returns the help location for this exporter.MessageLoggetMessageLog()Returns the message log the may have been created during an export.java.lang.StringgetName()Returns the display name of this exporter.abstract java.util.List<Option>getOptions(DomainObjectService domainObjectService)Returns the available options for this exporter.voidsetExporterServiceProvider(ServiceProvider provider)Sets the exporter service provider.abstract voidsetOptions(java.util.List<Option> options)Sets the options.booleansupportsPartialExport()Returns true if this exporter can export less than the entire domain file.java.lang.StringtoString()
 
- 
- 
- 
Field Detail- 
EMPTY_OPTIONSprotected static final java.util.List<Option> EMPTY_OPTIONS 
 - 
logprotected MessageLog log 
 - 
providerprotected ServiceProvider provider 
 
- 
 - 
Constructor Detail- 
Exporterprotected Exporter(java.lang.String name, java.lang.String extension, HelpLocation help)Constructs a new exporter.- Parameters:
- name- the display name of this exporter
- extension- the default extension for this exporter
- help- the help location for this exporter
 
 
- 
 - 
Method Detail- 
getNamepublic final java.lang.String getName() Returns the display name of this exporter.- Returns:
- the display name of this exporter
 
 - 
getDefaultFileExtensionpublic final java.lang.String getDefaultFileExtension() Returns the default extension for this exporter. For example, .html for .xml.- Returns:
- the default extension for this exporter
 
 - 
getHelpLocationpublic final HelpLocation getHelpLocation() Returns the help location for this exporter. It should return null only if no help documentation exists.- Returns:
- the help location for this exporter
 
 - 
getMessageLogpublic final MessageLog getMessageLog() Returns the message log the may have been created during an export. The message log is used to log warnings and other non-critical messages.- Returns:
- the message log
 
 - 
setExporterServiceProviderpublic final void setExporterServiceProvider(ServiceProvider provider) Sets the exporter service provider.- Parameters:
- provider- the exporter service provider
 
 - 
canExportDomainObjectpublic boolean canExportDomainObject(java.lang.Class<? extends DomainObject> domainObjectClass) Returns true if this exporter knows how to export the given domain object. For example, some exporters know how to export programs, other exporters can export project data type archives.- Parameters:
- domainObject- the domain object to test for exporting.
- Returns:
- true if this exporter knows how to export the given domain object.
 
 - 
supportsPartialExportpublic boolean supportsPartialExport() Returns true if this exporter can export less than the entire domain file.- Returns:
- true if this exporter can export less than the entire domain file.
 
 - 
getOptionspublic abstract java.util.List<Option> getOptions(DomainObjectService domainObjectService) Returns the available options for this exporter. The program is needed because some exporters may have options that vary depending on the specific program being exported.- Parameters:
- domainObjectService- a service for retrieving the applicable domainObject.
- Returns:
- the available options for this exporter
 
 - 
setOptionspublic abstract void setOptions(java.util.List<Option> options) throws OptionException Sets the options. This method is not for defining the options, but rather it is for setting the values of options. If invalid options are passed in, then OptionException should be thrown.- Parameters:
- options- the option values for this exporter
- Throws:
- OptionException- if invalid options are passed in
 
 - 
exportpublic abstract boolean export(java.io.File file, DomainObject domainObj, AddressSetView addrSet, TaskMonitor monitor) throws ExporterException, java.io.IOExceptionActually does the work of exporting the program.- Parameters:
- file- the output file to write the exported info
- domainObj- the domain object to export
- addrSet- the address set if only a portion of the program should be exported
- monitor- the task monitor
- Returns:
- true if the program was successfully exported; otherwise, false. If the program was not successfully exported, the message log should be checked to find the source of the error.
- Throws:
- ExporterException
- java.io.IOException
 
 - 
toStringpublic final java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 
- 
 
-