Package ghidra.program.model.listing
Interface ProgramUserData
- All Superinterfaces:
UserData
-
Method Summary
Modifier and TypeMethodDescriptionvoid
endTransaction
(int transactionID) End a previously started transactiongetBooleanProperty
(String owner, String propertyName, boolean create) Get a address-based Boolean property mapgetIntProperty
(String owner, String propertyName, boolean create) Get a address-based Integer property mapgetLongProperty
(String owner, String propertyName, boolean create) Get a address-based Long property map<T extends Saveable>
ObjectPropertyMap<T> getObjectProperty
(String owner, String propertyName, Class<T> saveableObjectClass, boolean create) Get a address-based Saveable-object property mapgetOptions
(String optionsName) Get the Options for the given optionsNameReturns all names of all the Options objects store in the user dataList
<PropertyMap<?>> getProperties
(String owner) Get all property maps associated with a specific owner.Returns list of all property owners for which property maps have been defined.getStringProperty
(String propertyName, String defaultValue) Gets the value for the given property namegetStringProperty
(String owner, String propertyName, boolean create) Get a address-based String property mapReturns a set of all String properties that have been set on this ProgramUserData objectOpen new transaction.removeStringProperty
(String propertyName) Removes the String property with the given name;void
setStringProperty
(String propertyName, String value) Sets the given String propertyint
Start a transaction prior to changing any properties
-
Method Details
-
openTransaction
Transaction openTransaction()Open new transaction. This should generally be done with a try-with-resources block:try (Transaction tx = pud.openTransaction(description)) { // ... Do something }
- Returns:
- transaction object
- Throws:
IllegalStateException
- if thisProgramUserData
has already been closed.
-
startTransaction
int startTransaction()Start a transaction prior to changing any properties- Returns:
- transaction ID needed for endTransaction
-
endTransaction
void endTransaction(int transactionID) End a previously started transaction- Parameters:
transactionID
- the id of the transaction to close
-
getStringProperty
StringPropertyMap getStringProperty(String owner, String propertyName, boolean create) throws PropertyTypeMismatchException Get a address-based String property map- Parameters:
owner
- name of property owner (e.g., plugin name)propertyName
- the name of property mapcreate
- creates the property map if it does not exist- Returns:
- the property map for the given name
- Throws:
PropertyTypeMismatchException
- if a conflicting map definition was found
-
getLongProperty
LongPropertyMap getLongProperty(String owner, String propertyName, boolean create) throws PropertyTypeMismatchException Get a address-based Long property map- Parameters:
owner
- name of property owner (e.g., plugin name)propertyName
- the name of property mapcreate
- creates the property map if it does not exist- Returns:
- property map
- Throws:
PropertyTypeMismatchException
- if a conflicting map definition was found
-
getIntProperty
IntPropertyMap getIntProperty(String owner, String propertyName, boolean create) throws PropertyTypeMismatchException Get a address-based Integer property map- Parameters:
owner
- name of property owner (e.g., plugin name)propertyName
- the name of property mapcreate
- creates the property map if it does not exist- Returns:
- property map
- Throws:
PropertyTypeMismatchException
- if a conflicting map definition was found
-
getBooleanProperty
VoidPropertyMap getBooleanProperty(String owner, String propertyName, boolean create) throws PropertyTypeMismatchException Get a address-based Boolean property map- Parameters:
owner
- name of property owner (e.g., plugin name)propertyName
- the name of property mapcreate
- creates the property map if it does not exist- Returns:
- property map
- Throws:
PropertyTypeMismatchException
- if a conflicting map definition was found
-
getObjectProperty
<T extends Saveable> ObjectPropertyMap<T> getObjectProperty(String owner, String propertyName, Class<T> saveableObjectClass, boolean create) Get a address-based Saveable-object property map- Type Parameters:
T
-Saveable
property value type- Parameters:
owner
- name of property owner (e.g., plugin name)propertyName
- the name of property mapsaveableObjectClass
- the class type for the object property mapcreate
- creates the property map if it does not exist- Returns:
- property map
- Throws:
PropertyTypeMismatchException
- if a conflicting map definition was found
-
getProperties
Get all property maps associated with a specific owner.- Parameters:
owner
- name of property owner (e.g., plugin name)- Returns:
- list of property maps
-
getPropertyOwners
Returns list of all property owners for which property maps have been defined.- Returns:
- list of all property owners for which property maps have been defined.
-
getOptionsNames
Returns all names of all the Options objects store in the user data- Returns:
- all names of all the Options objects store in the user data
-
getOptions
Get the Options for the given optionsName- Parameters:
optionsName
- the name of the options options to retrieve- Returns:
- The options for the given name
-
setStringProperty
Sets the given String property- Parameters:
propertyName
- the name of the propertyvalue
- the value of the property
-
getStringProperty
Gets the value for the given property name- Parameters:
propertyName
- the name of the string property to retrievedefaultValue
- the value to return if there is no saved value for the given name- Returns:
- the value for the given property name
-
removeStringProperty
Removes the String property with the given name;- Parameters:
propertyName
- the name of the property to remove;- Returns:
- returns the value of the property that was removed or null if the property doesn't exist
-
getStringPropertyNames
Returns a set of all String properties that have been set on this ProgramUserData object- Returns:
- a set of all String properties that have been set on this ProgramUserData object
-