Package ghidra.app.util.exporter
Class Exporter
java.lang.Object
ghidra.app.util.exporter.Exporter
- All Implemented Interfaces:
ExtensionPoint
- Direct Known Subclasses:
AbstractLoaderExporter
,AsciiExporter
,BinaryExporter
,CppExporter
,GzfExporter
,HtmlExporter
,IntelHexExporter
,ProjectArchiveExporter
,XmlExporter
The interface that all exporters must implement.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Exporter
(String name, String extension, HelpLocation help) Constructs a new exporter. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canExportDomainObject
(Class<? extends DomainObject> domainObjectClass) Returns true if this exporter knows how to export the given domain object.abstract boolean
export
(File file, DomainObject domainObj, AddressSetView addrSet, TaskMonitor monitor) Actually does the work of exporting the program.final String
Returns the default extension for this exporter.final HelpLocation
Returns the help location for this exporter.final MessageLog
Returns the message log the may have been created during an export.final String
getName()
Returns the display name of this exporter.getOptions
(DomainObjectService domainObjectService) Returns the available options for this exporter.final void
setExporterServiceProvider
(ServiceProvider provider) Sets the exporter service provider.abstract void
setOptions
(List<Option> options) Sets the options.boolean
Returns true if this exporter can export less than the entire domain file.final String
toString()
-
Field Details
-
EMPTY_OPTIONS
-
log
-
provider
-
-
Constructor Details
-
Exporter
Constructs a new exporter.- Parameters:
name
- the display name of this exporterextension
- the default extension for this exporterhelp
- the help location for this exporter
-
-
Method Details
-
getName
Returns the display name of this exporter.- Returns:
- the display name of this exporter
-
getDefaultFileExtension
Returns the default extension for this exporter. For example, .html for .xml.- Returns:
- the default extension for this exporter
-
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
-
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
-
setExporterServiceProvider
Sets the exporter service provider.- Parameters:
provider
- the exporter service provider
-
canExportDomainObject
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:
domainObjectClass
- the class of the domain object to test for exporting.- Returns:
- true if this exporter knows how to export the given domain object.
-
supportsPartialExport
public 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.
-
getOptions
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
-
setOptions
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
-
export
public abstract boolean export(File file, DomainObject domainObj, AddressSetView addrSet, TaskMonitor monitor) throws ExporterException, IOException Actually does the work of exporting the program.- Parameters:
file
- the output file to write the exported infodomainObj
- the domain object to exportaddrSet
- the address set if only a portion of the program should be exportedmonitor
- 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
IOException
-
toString
-