Class DBPropertyMapManager

java.lang.Object
ghidra.program.database.properties.DBPropertyMapManager
All Implemented Interfaces:
ManagerDB, PropertyMapManager

public class DBPropertyMapManager extends Object implements PropertyMapManager, ManagerDB
Manages generic address keyed properties.
  • Constructor Details

  • Method Details

    • setProgram

      public void setProgram(ProgramDB program)
      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 interface ManagerDB
      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 interface ManagerDB
      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

      public void invalidateCache(boolean all) throws IOException
      Description copied from interface: ManagerDB
      Clears all data caches.
      Specified by:
      invalidateCache in interface ManagerDB
      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

      public IntPropertyMap createIntPropertyMap(String propertyName) throws DuplicateNameException
      Creates a new IntPropertyMap with the given name.
      Specified by:
      createIntPropertyMap in interface PropertyMapManager
      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

      public LongPropertyMap createLongPropertyMap(String propertyName) throws DuplicateNameException
      Creates a new LongPropertyMap with the given name.
      Specified by:
      createLongPropertyMap in interface PropertyMapManager
      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

      public StringPropertyMap createStringPropertyMap(String propertyName) throws DuplicateNameException
      Creates a new StringPropertyMap with the given name.
      Specified by:
      createStringPropertyMap in interface PropertyMapManager
      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 interface PropertyMapManager
      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

      public VoidPropertyMap createVoidPropertyMap(String propertyName) throws DuplicateNameException
      Creates a new VoidPropertyMap with the given name.
      Specified by:
      createVoidPropertyMap in interface PropertyMapManager
      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

      public PropertyMap<?> getPropertyMap(String propertyName)
      Returns the PropertyMap with the given name or null if no PropertyMap exists with that name.
      Specified by:
      getPropertyMap in interface PropertyMapManager
      Parameters:
      propertyName - the name of the property to retrieve.
      Returns:
      existing map or null if not found
    • getIntPropertyMap

      public IntPropertyMap getIntPropertyMap(String propertyName)
      Returns the IntPropertyMap associated with the given name.
      Specified by:
      getIntPropertyMap in interface PropertyMapManager
      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

      public LongPropertyMap getLongPropertyMap(String propertyName)
      Returns the LongPropertyMap associated with the given name.
      Specified by:
      getLongPropertyMap in interface PropertyMapManager
      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

      public StringPropertyMap getStringPropertyMap(String propertyName)
      Returns the StringPropertyMap associated with the given name.
      Specified by:
      getStringPropertyMap in interface PropertyMapManager
      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

      public ObjectPropertyMap<?> getObjectPropertyMap(String propertyName)
      Returns the ObjectPropertyMap associated with the given name.
      Specified by:
      getObjectPropertyMap in interface PropertyMapManager
      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

      public VoidPropertyMap getVoidPropertyMap(String propertyName)
      Returns the VoidPropertyMap associated with the given name.
      Specified by:
      getVoidPropertyMap in interface PropertyMapManager
      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

      public boolean removePropertyMap(String propertyName)
      Description copied from interface: PropertyMapManager
      Removes the PropertyMap with the given name.
      Specified by:
      removePropertyMap in interface PropertyMapManager
      Parameters:
      propertyName - the name of the property to remove.
      Returns:
      true if a PropertyMap with that name was found (and removed)
    • propertyManagers

      public Iterator<String> propertyManagers()
      Description copied from interface: PropertyMapManager
      Returns an iterator over the names of all existing PropertyMaps.
      Specified by:
      propertyManagers in interface PropertyMapManager
    • removeAll

      public void removeAll(Address addr)
      Description copied from interface: PropertyMapManager
      Removes any property at the given address from all defined PropertyMaps.
      Specified by:
      removeAll in interface PropertyMapManager
      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 single AddressSpace.
      Specified by:
      removeAll in interface PropertyMapManager
      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 interface ManagerDB
      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 single AddressSpace.
      Specified by:
      deleteAddressRange in interface ManagerDB
      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.