Class GenericSaveable
- java.lang.Object
-
- ghidra.program.database.properties.GenericSaveable
-
- All Implemented Interfaces:
Saveable
public class GenericSaveable extends java.lang.Object implements Saveable
GenericSaveableis used by theDBPropertyMapManagerwhen the class can not be found and loaded for the class path name of a property in the database. This allows the properties for that class to be accessed in a generic way so that the manager can copy or remove the property at a particular address. This allows the Diff and MultiUser Merge to compare and manipulate the property as needed.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.lang.Class<?>[]getObjectStorageFields()Returns the field classes, in Java types, in the same order as usedSaveable.save(ghidra.util.ObjectStorage)andSaveable.restore(ghidra.util.ObjectStorage).intgetSchemaVersion()Get the storage schema version.inthashCode()booleanisPrivate()Returns true if this saveable should not have it's changes broadcast.booleanisUpgradeable(int oldSchemaVersion)Determine if the implementation supports an storage upgrade of the specified oldSchemaVersion to the current schema version.voidrestore(ObjectStorage objStorage)Restore from the given ObjectStorage.voidsave(ObjectStorage objStorage)Save to the given ObjectStorage.java.lang.StringtoString()booleanupgrade(ObjectStorage oldObjStorage, int oldSchemaVersion, ObjectStorage currentObjStorage)Upgrade an older stored object to the current storage schema.
-
-
-
Method Detail
-
getObjectStorageFields
public java.lang.Class<?>[] getObjectStorageFields()
Description copied from interface:SaveableReturns the field classes, in Java types, in the same order as usedSaveable.save(ghidra.util.ObjectStorage)andSaveable.restore(ghidra.util.ObjectStorage).For example, if the save method calls objStorage.putInt() and then objStorage.putFloat(), then this method must return Class[]{ Integer.class, Float.class }.
- Specified by:
getObjectStorageFieldsin interfaceSaveable- Returns:
-
save
public void save(ObjectStorage objStorage)
Description copied from interface:SaveableSave to the given ObjectStorage.
-
restore
public void restore(ObjectStorage objStorage)
Description copied from interface:SaveableRestore from the given ObjectStorage.
-
getSchemaVersion
public int getSchemaVersion()
Description copied from interface:SaveableGet the storage schema version. Any time there is a software release in which the implementing class has changed the data structure used for the save and restore methods, the schema version must be incremented. NOTE: While this could be a static method, the Saveable interface is unable to define such methods.- Specified by:
getSchemaVersionin interfaceSaveable- Returns:
- storage schema version.
-
isUpgradeable
public boolean isUpgradeable(int oldSchemaVersion)
Description copied from interface:SaveableDetermine if the implementation supports an storage upgrade of the specified oldSchemaVersion to the current schema version.- Specified by:
isUpgradeablein interfaceSaveable- Returns:
- true if upgrading is supported for the older schema version.
-
upgrade
public boolean upgrade(ObjectStorage oldObjStorage, int oldSchemaVersion, ObjectStorage currentObjStorage)
Description copied from interface:SaveableUpgrade an older stored object to the current storage schema.- Specified by:
upgradein interfaceSaveable- Parameters:
oldObjStorage- the old stored objectoldSchemaVersion- storage schema version number for the old objectcurrentObjStorage- new object for storage in the current schema- Returns:
- true if data was upgraded to the currentObjStorage successfully.
-
isPrivate
public boolean isPrivate()
Description copied from interface:SaveableReturns true if this saveable should not have it's changes broadcast.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-