Class GdtExporter
- All Implemented Interfaces:
ExtensionPoint
-
Field Summary
FieldsFields inherited from class ghidra.app.util.exporter.Exporter
EMPTY_OPTIONS, log, provider -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanExportDomainFile(DomainFile domainFile) Returns true if exporter can export the specifiedDomainFilewithout instantiating aDomainObject.booleancanExportDomainObject(Class<? extends DomainObject> domainObjectClass) Returns true if this exporter is capable of exporting the given domain file/object content type.booleanbooleanexport(File file, DomainFile domainFile, TaskMonitor monitor) Actually does the work of exporting a domain file, if supported (seeExporter.canExportDomainFile(DomainFile)).booleanexport(File file, DomainObject domainObj, AddressSetView addrSet, TaskMonitor monitor) Actually does the work of exporting aDomainObject.getOptions(DomainObjectService domainObjectService) Returns the available options for this exporter.voidsetOptions(List<Option> options) Sets the options.booleanReturns false.Methods inherited from class ghidra.app.util.exporter.Exporter
canExportDomainObject, getDefaultFileExtension, getHelpLocation, getMessageLog, getName, setExporterServiceProvider, toString
-
Field Details
-
EXTENSION
- See Also:
-
SUFFIX
- See Also:
-
NAME
- See Also:
-
-
Constructor Details
-
GdtExporter
public GdtExporter()
-
-
Method Details
-
canExportDomainObject
Description copied from class:ExporterReturns true if this exporter is capable of exporting the given domain file/object content type. For example, some exporters have the ability to export programs, other exporters can export project data type archives.NOTE: This method should only be used as a preliminary check, if neccessary, to identify exporter implementations that are capable of handling a specified content type/class. Prior to export a final check should be performed based on the export or either a
DomainFileorDomainObject:DomainFileexport - the methodExporter.canExportDomainFile(DomainFile)should be used to verify a direct project file export is possible using theExporter.export(File, DomainFile, TaskMonitor)method.DomainObjectexport - the methodExporter.canExportDomainObject(DomainObject)should be used to verify an export of a specific object is possible using theExporter.export(File, DomainObject, AddressSetView, TaskMonitor)method. avoid opening DomainFile when possible.- Overrides:
canExportDomainObjectin classExporter- 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 type.
-
canExportDomainFile
Description copied from class:ExporterReturns true if exporter can export the specifiedDomainFilewithout instantiating aDomainObject. This method should be used prior to exporting using theExporter.export(File, DomainFile, TaskMonitor)method. All exporter capable of aDomainFileexport must also support a export of aDomainObjectso that any possible data modification/upgrade is included within resulting export.- Overrides:
canExportDomainFilein classExporter- Parameters:
domainFile- domain file- Returns:
- true if export can occur else false if not
-
equals
-
export
public boolean export(File file, DomainObject domainObj, AddressSetView addrSet, TaskMonitor monitor) Description copied from class:ExporterActually does the work of exporting aDomainObject. Export will include all saved and unsaved modifications which may have been made to the object.- Specified by:
exportin classExporter- 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 exported NOTE: seeExporter.supportsAddressRestrictedExport().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.
-
export
public boolean export(File file, DomainFile domainFile, TaskMonitor monitor) throws ExporterException, IOException Description copied from class:ExporterActually does the work of exporting a domain file, if supported (seeExporter.canExportDomainFile(DomainFile)). Export is performed without instantiation of aDomainObject.- Overrides:
exportin classExporter- Parameters:
file- the output file to write the exported infodomainFile- the domain file to be exported (e.g., packed DB file)monitor- the task monitor- Returns:
- true if the file was successfully exported; otherwise, false. If the file was not successfully exported, the message log should be checked to find the source of the error.
- Throws:
ExporterException- if export error occursIOException- if an IO error occurs
-
getOptions
Description copied from class:ExporterReturns 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.- Specified by:
getOptionsin classExporter- Parameters:
domainObjectService- a service for retrieving the applicable domainObject.- Returns:
- the available options for this exporter
-
setOptions
Description copied from class:ExporterSets 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.- Specified by:
setOptionsin classExporter- Parameters:
options- the option values for this exporter
-
supportsAddressRestrictedExport
public boolean supportsAddressRestrictedExport()Returns false. GDT export only supports entire database.- Overrides:
supportsAddressRestrictedExportin classExporter- Returns:
- true if this exporter can export less than the entire domain file.
-