Class DBPropertyMapManager
java.lang.Object
ghidra.program.database.properties.DBPropertyMapManager
- All Implemented Interfaces:
ManagerDB,PropertyMapManager
Manages generic address keyed properties.
-
Constructor Summary
ConstructorsConstructorDescriptionDBPropertyMapManager(DBHandle handle, ChangeManager changeMgr, AddressMap addrMap, OpenMode openMode, Lock lock, TaskMonitor monitor) Constructs a new DBPropertyMapManager -
Method Summary
Modifier and TypeMethodDescriptioncreateIntPropertyMap(String propertyName) Creates a new IntPropertyMap with the given name.createLongPropertyMap(String propertyName) Creates a new LongPropertyMap with the given name.<T extends Saveable>
ObjectPropertyMap<T> createObjectPropertyMap(String propertyName, Class<T> objectClass) Creates a new ObjectPropertyMap with the given name.createStringPropertyMap(String propertyName) Creates a new StringPropertyMap with the given name.createVoidPropertyMap(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.getIntPropertyMap(String propertyName) Returns the IntPropertyMap associated with the given name.getLongPropertyMap(String propertyName) Returns the LongPropertyMap associated with the given name.getObjectPropertyMap(String propertyName) Returns the ObjectPropertyMap associated with the given name.PropertyMap<?> getPropertyMap(String propertyName) Returns the PropertyMap with the given name or null if no PropertyMap exists with that name.getStringPropertyMap(String propertyName) Returns the StringPropertyMap associated with the given name.getVoidPropertyMap(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(OpenMode openMode, int currentRevision, TaskMonitor monitor) Callback from program made to each manager after the program has completed initialization.Returns an iterator over the names of all existing PropertyMaps sorted by name.voidRemoves any property at the given address from all defined PropertyMaps.voidremoveAll(Address startAddr, Address endAddr, TaskMonitor monitor) Removes all properties in the given range from all user defined PropertyMaps.booleanremovePropertyMap(String propertyName) Removes the PropertyMap with the given name.voidsetProgram(ProgramDB program) Callback from program used to indicate all manager have been created.
-
Constructor Details
-
DBPropertyMapManager
public DBPropertyMapManager(DBHandle handle, ChangeManager changeMgr, AddressMap addrMap, OpenMode openMode, Lock lock, TaskMonitor monitor) throws 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:
IOException- if an IO error occursVersionException- if a version error occursCancelledException- if task is cancelled
-
-
Method Details
-
setProgram
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.
-
programReady
public void programReady(OpenMode openMode, int currentRevision, TaskMonitor monitor) throws IOException, CancelledException Description 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:
IOException- if a database io error occurs.CancelledException- if the user cancelled the operation via the task monitor.
-
invalidateCache
Description 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:
IOException- if a database io error occurs.
-
createIntPropertyMap
Creates a new IntPropertyMap with the given name.- Specified by:
createIntPropertyMapin interfacePropertyMapManager- Parameters:
propertyName- the name of the property to create.- Returns:
- newly created integer object map
- Throws:
DuplicateNameException- thrown if a PropertyMap already exists with that name.
-
createLongPropertyMap
Creates a new LongPropertyMap with the given name.- Specified by:
createLongPropertyMapin interfacePropertyMapManager- Parameters:
propertyName- the name of the property to create.- Returns:
- newly created long object map
- Throws:
DuplicateNameException- thrown if a PropertyMap already exists with that name.
-
createStringPropertyMap
Creates a new StringPropertyMap with the given name.- Specified by:
createStringPropertyMapin interfacePropertyMapManager- Parameters:
propertyName- the name of the property to create.- Returns:
- newly created string object map
- Throws:
DuplicateNameException- thrown if a PropertyMap already exists with that name.
-
createObjectPropertyMap
public <T extends Saveable> ObjectPropertyMap<T> createObjectPropertyMap(String propertyName, Class<T> objectClass) throws DuplicateNameException Description copied from interface:PropertyMapManagerCreates a new ObjectPropertyMap with the given name.- Specified by:
createObjectPropertyMapin interfacePropertyMapManager- Type Parameters:
T-Saveableproperty value type- Parameters:
propertyName- the name for the new property.objectClass-Saveableimplementation class- Returns:
- newly created
Saveableobject map - Throws:
DuplicateNameException- thrown if a PropertyMap already exists with that name.
-
createVoidPropertyMap
Creates a new VoidPropertyMap with the given name.- Specified by:
createVoidPropertyMapin interfacePropertyMapManager- Parameters:
propertyName- the name of the property to create.- Returns:
- newly created void map
- Throws:
DuplicateNameException- thrown if a PropertyMap already exists with that name.
-
getPropertyMap
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.- Returns:
- existing map or null if not found
-
getIntPropertyMap
Returns the IntPropertyMap associated with the given name.- Specified by:
getIntPropertyMapin interfacePropertyMapManager- Parameters:
propertyName- the name of the property to retrieve.- Returns:
- existing map or null if not found
- Throws:
TypeMismatchException- if a propertyMap named propertyName exists but is not an IntPropertyMap.
-
getLongPropertyMap
Returns the LongPropertyMap associated with the given name.- Specified by:
getLongPropertyMapin interfacePropertyMapManager- Parameters:
propertyName- the name of the property to retrieve.- Returns:
- existing map or null if not found
- Throws:
TypeMismatchException- if a propertyMap named propertyName exists but is not an LongPropertyMap.
-
getStringPropertyMap
Returns the StringPropertyMap associated with the given name.- Specified by:
getStringPropertyMapin interfacePropertyMapManager- Parameters:
propertyName- the name of the property to retrieve.- Returns:
- existing map or null if not found
- Throws:
TypeMismatchException- if a propertyMap named propertyName exists but is not a StringPropertyMap.
-
getObjectPropertyMap
Returns the ObjectPropertyMap associated with the given name.- Specified by:
getObjectPropertyMapin interfacePropertyMapManager- Parameters:
propertyName- the name of the property to retrieve.- Returns:
- existing map or null if not found
- Throws:
TypeMismatchException- if a propertyMap named propertyName exists but is not an ObjectPropertyMap.
-
getVoidPropertyMap
Returns the VoidPropertyMap associated with the given name.- Specified by:
getVoidPropertyMapin interfacePropertyMapManager- Parameters:
propertyName- the name of the property to retrieve.- Returns:
- existing map or null if not found
- Throws:
TypeMismatchException- if a propertyMap named propertyName exists but is not a VoidPropertyMap.
-
removePropertyMap
Description copied from interface:PropertyMapManagerRemoves 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
Description copied from interface:PropertyMapManagerReturns an iterator over the names of all existing PropertyMaps sorted by name.- Specified by:
propertyManagersin interfacePropertyMapManager
-
removeAll
Description copied from interface:PropertyMapManagerRemoves any property at the given address from all defined PropertyMaps.- Specified by:
removeAllin interfacePropertyMapManager- Parameters:
addr- the address at which to remove all property values.
-
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. The specified start and end addresses must form a valid range within a singleAddressSpace.- 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.
-
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.
-
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. The specified start and end addresses must form a valid range within a singleAddressSpace.- 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.
-