Class DBPropertyMapManager
java.lang.Object
ghidra.program.database.properties.DBPropertyMapManager
- All Implemented Interfaces:
ManagerDB
,PropertyMapManager
Manages generic address keyed properties.
-
Constructor Summary
ConstructorDescriptionDBPropertyMapManager
(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.void
deleteAddressRange
(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.void
invalidateCache
(boolean all) Clears all data caches.void
moveAddressRange
(Address fromAddr, Address toAddr, long length, TaskMonitor monitor) Move all objects within an address range to a new location.void
programReady
(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.void
Removes any property at the given address from all defined PropertyMaps.void
removeAll
(Address startAddr, Address endAddr, TaskMonitor monitor) Removes all properties in the given range from all user defined PropertyMaps.boolean
removePropertyMap
(String propertyName) Removes the PropertyMap with the given name.void
setProgram
(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:ManagerDB
Callback 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:
setProgram
in 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:ManagerDB
Callback 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:
programReady
in 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:ManagerDB
Clears all data caches.- Specified by:
invalidateCache
in 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:
createIntPropertyMap
in 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:
createLongPropertyMap
in 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:
createStringPropertyMap
in 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:PropertyMapManager
Creates a new ObjectPropertyMap with the given name.- Specified by:
createObjectPropertyMap
in interfacePropertyMapManager
- Type Parameters:
T
-Saveable
property value type- Parameters:
propertyName
- the name for the new property.objectClass
-Saveable
implementation class- Returns:
- newly created
Saveable
object map - Throws:
DuplicateNameException
- thrown if a PropertyMap already exists with that name.
-
createVoidPropertyMap
Creates a new VoidPropertyMap with the given name.- Specified by:
createVoidPropertyMap
in 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:
getPropertyMap
in 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:
getIntPropertyMap
in 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:
getLongPropertyMap
in 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:
getStringPropertyMap
in 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:
getObjectPropertyMap
in 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:
getVoidPropertyMap
in 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:PropertyMapManager
Removes the PropertyMap with the given name.- Specified by:
removePropertyMap
in 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:PropertyMapManager
Returns an iterator over the names of all existing PropertyMaps.- Specified by:
propertyManagers
in interfacePropertyMapManager
-
removeAll
Description copied from interface:PropertyMapManager
Removes any property at the given address from all defined PropertyMaps.- Specified by:
removeAll
in 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:PropertyMapManager
Removes 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:
removeAll
in 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:ManagerDB
Move all objects within an address range to a new location.- Specified by:
moveAddressRange
in 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:ManagerDB
Delete 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:
deleteAddressRange
in 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.
-