Class ProgramExporter
- All Implemented Interfaces:
ExtensionPoint
- Direct Known Subclasses:
AsciiExporter,BinaryExporter,CppExporter,HtmlExporter,IntelHexExporter,OriginalFileExporter,XmlExporter
-
Field Summary
Fields inherited from class ghidra.app.util.exporter.Exporter
EMPTY_OPTIONS, log, provider -
Constructor Summary
ConstructorsChangeModifierConstructorDescriptionprotectedProgramExporter(String name, String extension, HelpLocation help) Constructs a newProgramexporter. -
Method Summary
ChangeModifier and TypeMethodDescriptionbooleancanExportDomainObject(Class<? extends DomainObject> domainObjectClass) Returns true if this exporter is capable of exporting the given domain file/object content type.protected ProgramgetProgram(DomainObject domainObj) Get an exportable Program instance from the specified DomainObject instance.Methods inherited from class ghidra.app.util.exporter.Exporter
canExportDomainFile, canExportDomainObject, export, export, getDefaultFileExtension, getHelpLocation, getMessageLog, getName, getOptions, setExporterServiceProvider, setOptions, supportsAddressRestrictedExport, toString
-
Constructor Details
-
ProgramExporter
Constructs a newProgramexporter.- Parameters:
name- the display name of this exporterextension- the default extension for this exporterhelp- the help location for this exporter
-
-
Method Details
-
getProgram
Get an exportable Program instance from the specified DomainObject instance. The specified instance must satisfycanExportDomainObject(Class).- Parameters:
domainObj- domain object from which a Program may be derived.- Returns:
- Program instance
- Throws:
ClassCastException- if domain object class does not satisfycanExportDomainObject(Class).
-
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 otherDomainFileorDomainObjecttypes such as project data type archives.NOTE: This method should only be used as a preliminary check, if necessary, 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 which may avoid opening the file first.DomainObjectexport - the methodExporter.canExportDomainObject(DomainObject)should be used to verify an export of a specific object is possible before using theExporter.export(File, DomainObject, AddressSetView, TaskMonitor)method.- Specified by:
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.
-