Package ghidra.app.util.opinion
Class LoadedOpen<T extends DomainObject>
java.lang.Object
ghidra.app.util.opinion.Loaded<T>
ghidra.app.util.opinion.LoadedOpen<T>
- Type Parameters:
T- The type of openDomainObject
- All Implemented Interfaces:
AutoCloseable
A loaded, open
DomainObject that has already been saved to a DomainFile-
Field Summary
Fields inherited from class ghidra.app.util.opinion.Loaded
domainFile, domainObject, fsrl, loadedConsumer, mirrorFsLayout, name, project, projectRootPath -
Constructor Summary
ConstructorsConstructorDescriptionLoadedOpen(T domainObject, DomainFile domainFile, FSRL fsrl, Object consumer) Creates aLoadedview on an existingDomainFile. -
Method Summary
Modifier and TypeMethodDescriptionsave(TaskMonitor monitor) Saves the loadedDomainObjectto the givenProjectat this object's project folder path, using this object's name.Methods inherited from class ghidra.app.util.opinion.Loaded
apply, check, close, getDomainObject, getDomainObject, getDomainObjectType, getName, getProject, getProjectFolderPath, getSavedDomainFile, release, setProjectFolderPath, toString
-
Constructor Details
-
LoadedOpen
public LoadedOpen(T domainObject, DomainFile domainFile, FSRL fsrl, Object consumer) throws LoadException - Parameters:
domainObject- The loadedDomainObjectdomainFile- TheDomainFileassociated with the loadedDomainObjectfsrl- TheFSRLof the loadedDomainObjectconsumer- A reference to the object "consuming" the returnedLoadedDomainObject, used to ensure the underlyingDomainObjectis only closed when every consumer is done with it (seeLoaded.close()). NOTE: Wrapping aDomainObjectin aLoadedtransfers responsibility of releasing the givenDomainObjectto thisLoaded'sLoaded.close()method.- Throws:
LoadException- if the givenDomainFileis not open
-
-
Method Details
-
save
Description copied from class:LoadedSaves the loadedDomainObjectto the givenProjectat this object's project folder path, using this object's name.If a
DomainFilealready exists with the same desired name and project folder path, the desired name will get a counter value appended to it to avoid a naming conflict. Therefore, it should not be assumed that the returnedDomainFilewill have the same name as a call toLoaded.getName().- Overrides:
savein classLoaded<T extends DomainObject>- Parameters:
monitor- A cancelable task monitor- Returns:
- The
DomainFilewhere the save happened
-