Class DBPropertyMapManager
- java.lang.Object
-
- ghidra.program.database.properties.DBPropertyMapManager
-
- All Implemented Interfaces:
ManagerDB,PropertyMapManager
public class DBPropertyMapManager extends java.lang.Object implements PropertyMapManager, ManagerDB
Manages generic address keyed properties.
-
-
Constructor Summary
Constructors Constructor Description DBPropertyMapManager(DBHandle handle, ChangeManager changeMgr, AddressMap addrMap, int openMode, Lock lock, TaskMonitor monitor)Constructs a new DBPropertyMapManager
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntPropertyMapcreateIntPropertyMap(java.lang.String propertyName)Creates a new IntPropertyMap with the given name.LongPropertyMapcreateLongPropertyMap(java.lang.String propertyName)Creates a new LongPropertyMap with the given name.ObjectPropertyMapcreateObjectPropertyMap(java.lang.String propertyName, java.lang.Class<? extends Saveable> objectClass)Creates a new ObjectPropertyMap with the given name.StringPropertyMapcreateStringPropertyMap(java.lang.String propertyName)Creates a new StringPropertyMap with the given name.VoidPropertyMapcreateVoidPropertyMap(java.lang.String propertyName)Creates a new VoidPropertyMap with the given name.voiddeleteAddressRange(Address startAddr, Address endAddr, TaskMonitor monitor)Delete all objects which have been applied to the address range startAddr to endAddr and update the database accordingly.IntPropertyMapgetIntPropertyMap(java.lang.String propertyName)Returns the IntPropertyMap associated with the given name.LongPropertyMapgetLongPropertyMap(java.lang.String propertyName)Returns the LongPropertyMap associated with the given name.ObjectPropertyMapgetObjectPropertyMap(java.lang.String propertyName)Returns the ObjectPropertyMap associated with the given name.PropertyMapgetPropertyMap(java.lang.String propertyName)Returns the PropertyMap with the given name or null if no PropertyMap exists with that name.StringPropertyMapgetStringPropertyMap(java.lang.String propertyName)Returns the StringPropertyMap associated with the given name.VoidPropertyMapgetVoidPropertyMap(java.lang.String propertyName)Returns the VoidPropertyMap associated with the given name.voidinvalidateCache(boolean all)Clears all data caches.voidmoveAddressRange(Address fromAddr, Address toAddr, long length, TaskMonitor monitor)Move all objects within an address range to a new location.voidprogramReady(int openMode, int currentRevision, TaskMonitor monitor)Callback from program made to each manager after the program has completed initialization.java.util.Iterator<java.lang.String>propertyManagers()Returns an iterator over the names of all existing PropertyMangers.voidremoveAll(Address addr)Removes any property at the given address from all defined PropertyManagers.voidremoveAll(Address startAddr, Address endAddr, TaskMonitor monitor)Removes all properties in the given range from all user defined PropertyMaps.booleanremovePropertyMap(java.lang.String propertyName)Removes the PropertyMap with the given name.voidsetProgram(ProgramDB program)Callback from program used to indicate all manager have been created.
-
-
-
Constructor Detail
-
DBPropertyMapManager
public DBPropertyMapManager(DBHandle handle, ChangeManager changeMgr, AddressMap addrMap, int openMode, Lock lock, TaskMonitor monitor) throws java.io.IOException, VersionException, CancelledException
Constructs a new DBPropertyMapManager- Parameters:
handle- the database handlechangeMgr- the change manageraddrMap- the address mapopenMode- the program open mode.lock- the program synchronization lockmonitor- the task monitor- Throws:
java.io.IOExceptionVersionExceptionCancelledException
-
-
Method Detail
-
setProgram
public void setProgram(ProgramDB program)
Description copied from interface:ManagerDBCallback from program used to indicate all manager have been created. When this method is invoked, all managers have been instantiated but may not be fully initialized.- Specified by:
setProgramin interfaceManagerDB- Parameters:
program- the program is set when all the initializations have been completed.- See Also:
ManagerDB.setProgram(ghidra.program.database.ProgramDB)
-
programReady
public void programReady(int openMode, int currentRevision, TaskMonitor monitor) throws java.io.IOException, CancelledExceptionDescription copied from interface:ManagerDBCallback from program made to each manager after the program has completed initialization. This method may be used by managers to perform additional upgrading which may have been deferred.- Specified by:
programReadyin interfaceManagerDB- Parameters:
openMode- the mode that the program is being opened.currentRevision- current program revision. If openMode is UPGRADE, this value reflects the pre-upgrade value.monitor- the task monitor to use in any upgrade operations.- Throws:
java.io.IOException- if a database io error occurs.CancelledException- if the user cancelled the operation via the task monitor.- See Also:
ManagerDB.programReady(int, int, ghidra.util.task.TaskMonitor)
-
invalidateCache
public void invalidateCache(boolean all) throws java.io.IOExceptionDescription copied from interface:ManagerDBClears all data caches.- Specified by:
invalidateCachein interfaceManagerDB- Parameters:
all- if false, some managers may not need to update their cache if they can tell that its not necessary. If this flag is true, then all managers should clear their cache no matter what.- Throws:
java.io.IOException- if a database io error occurs.- See Also:
ManagerDB.invalidateCache(boolean)
-
createIntPropertyMap
public IntPropertyMap createIntPropertyMap(java.lang.String propertyName) throws DuplicateNameException
Creates a new IntPropertyMap with the given name.- Specified by:
createIntPropertyMapin interfacePropertyMapManager- Parameters:
propertyName- the name of the property to create.- Throws:
DuplicateNameException- thrown if a PropertyMap already exists with that name.
-
createLongPropertyMap
public LongPropertyMap createLongPropertyMap(java.lang.String propertyName) throws DuplicateNameException
Creates a new LongPropertyMap with the given name.- Specified by:
createLongPropertyMapin interfacePropertyMapManager- Parameters:
propertyName- the name of the property to create.- Throws:
DuplicateNameException- thrown if a PropertyMap already exists with that name.
-
createStringPropertyMap
public StringPropertyMap createStringPropertyMap(java.lang.String propertyName) throws DuplicateNameException
Creates a new StringPropertyMap with the given name.- Specified by:
createStringPropertyMapin interfacePropertyMapManager- Parameters:
propertyName- the name of the property to create.- Throws:
DuplicateNameException- thrown if a PropertyMap already exists with that name.
-
createObjectPropertyMap
public ObjectPropertyMap createObjectPropertyMap(java.lang.String propertyName, java.lang.Class<? extends Saveable> objectClass) throws DuplicateNameException
Creates a new ObjectPropertyMap with the given name.- Specified by:
createObjectPropertyMapin interfacePropertyMapManager- Parameters:
propertyName- the name of the property to create.objectClass- the class of the objects that will be stored in the property.- Throws:
DuplicateNameException- thrown if a PropertyMap already exists with that name.
-
createVoidPropertyMap
public VoidPropertyMap createVoidPropertyMap(java.lang.String propertyName) throws DuplicateNameException
Creates a new VoidPropertyMap with the given name.- Specified by:
createVoidPropertyMapin interfacePropertyMapManager- Parameters:
propertyName- the name of the property to create.- Throws:
DuplicateNameException- thrown if a PropertyMap already exists with that name.
-
getPropertyMap
public PropertyMap getPropertyMap(java.lang.String propertyName)
Returns the PropertyMap with the given name or null if no PropertyMap exists with that name.- Specified by:
getPropertyMapin interfacePropertyMapManager- Parameters:
propertyName- the name of the property to retrieve.
-
getIntPropertyMap
public IntPropertyMap getIntPropertyMap(java.lang.String propertyName)
Returns the IntPropertyMap associated with the given name.- Specified by:
getIntPropertyMapin interfacePropertyMapManager- Parameters:
propertyName- the name of the property to retrieve.- Throws:
TypeMismatchException- if a propertyMap named propertyName exists but is not an IntPropertyMap.
-
getLongPropertyMap
public LongPropertyMap getLongPropertyMap(java.lang.String propertyName)
Returns the LongPropertyMap associated with the given name.- Specified by:
getLongPropertyMapin interfacePropertyMapManager- Parameters:
propertyName- the name of the property to retrieve.- Throws:
TypeMismatchException- if a propertyMap named propertyName exists but is not an LongPropertyMap.
-
getStringPropertyMap
public StringPropertyMap getStringPropertyMap(java.lang.String propertyName)
Returns the StringPropertyMap associated with the given name.- Specified by:
getStringPropertyMapin interfacePropertyMapManager- Parameters:
propertyName- the name of the property to retrieve.- Throws:
TypeMismatchException- if a propertyMap named propertyName exists but is not a StringPropertyMap.
-
getObjectPropertyMap
public ObjectPropertyMap getObjectPropertyMap(java.lang.String propertyName)
Returns the ObjectPropertyMap associated with the given name.- Specified by:
getObjectPropertyMapin interfacePropertyMapManager- Parameters:
propertyName- the name of the property to retrieve.- Throws:
TypeMismatchException- if a propertyMap named propertyName exists but is not an ObjectPropertyMap.
-
getVoidPropertyMap
public VoidPropertyMap getVoidPropertyMap(java.lang.String propertyName)
Returns the VoidPropertyMap associated with the given name.- Specified by:
getVoidPropertyMapin interfacePropertyMapManager- Parameters:
propertyName- the name of the property to retrieve.- Throws:
TypeMismatchException- if a propertyMap named propertyName exists but is not a VoidPropertyMap.
-
removePropertyMap
public boolean removePropertyMap(java.lang.String propertyName)
Removes the PropertyMap with the given name.- Specified by:
removePropertyMapin interfacePropertyMapManager- Parameters:
propertyName- the name of the property to remove.- Returns:
- true if a PropertyMap with that name was found (and removed)
-
propertyManagers
public java.util.Iterator<java.lang.String> propertyManagers()
Returns an iterator over the names of all existing PropertyMangers.- Specified by:
propertyManagersin interfacePropertyMapManager
-
removeAll
public void removeAll(Address addr)
Removes any property at the given address from all defined PropertyManagers.- Specified by:
removeAllin interfacePropertyMapManager- Parameters:
addr- the address at which to remove all properties.
-
removeAll
public void removeAll(Address startAddr, Address endAddr, TaskMonitor monitor) throws CancelledException
Description copied from interface:PropertyMapManagerRemoves all properties in the given range from all user defined PropertyMaps.- Specified by:
removeAllin interfacePropertyMapManager- Parameters:
startAddr- the first address in the range of addresses where propertie values are to be removed.endAddr- the last address in the range of addresses where propertie values are to be removed.monitor- monitors progress- Throws:
CancelledException- if the user cancelled the operation.- See Also:
PropertyMapManager.removeAll(ghidra.program.model.address.Address, ghidra.program.model.address.Address, ghidra.util.task.TaskMonitor)
-
moveAddressRange
public void moveAddressRange(Address fromAddr, Address toAddr, long length, TaskMonitor monitor) throws CancelledException
Description copied from interface:ManagerDBMove all objects within an address range to a new location.- Specified by:
moveAddressRangein interfaceManagerDB- Parameters:
fromAddr- the first address of the range to be moved.toAddr- the address where to the range is to be moved.length- the number of addresses to move.monitor- the task monitor to use in any upgrade operations.- Throws:
CancelledException- if the user cancelled the operation via the task monitor.- See Also:
ManagerDB.moveAddressRange(ghidra.program.model.address.Address, ghidra.program.model.address.Address, long, ghidra.util.task.TaskMonitor)
-
deleteAddressRange
public void deleteAddressRange(Address startAddr, Address endAddr, TaskMonitor monitor) throws CancelledException
Description copied from interface:ManagerDBDelete all objects which have been applied to the address range startAddr to endAddr and update the database accordingly.- Specified by:
deleteAddressRangein interfaceManagerDB- Parameters:
startAddr- the first address in the range.endAddr- the last address in the range.monitor- the task monitor to use in any upgrade operations.- Throws:
CancelledException- if the user cancelled the operation via the task monitor.- See Also:
ManagerDB.deleteAddressRange(ghidra.program.model.address.Address, ghidra.program.model.address.Address, ghidra.util.task.TaskMonitor)
-
-