This PR should only be considered AFTER this other PR (12), because this PR's commit history is based on the other's. If the other PR gets rejected, I will refactor this PR's code to not depend on it.
This change:
Creates a NameManager class a related custom exception classes.
The name manager class is a static class (only has static data and methods) that merely provides a way for different Preferences to coordinate with each other to be able to detect registered settingsNames and notify the user with an exception if they try to do something stupid.
Implements the coordination between different Preferences instances using the NameManager
This change allows each Persisted* and PreferenceFactory to have their own instance of Preferences without sacrificing the benefit of key collision detection if you were to use a single shared Preferences instance. This in turn allows Persisted*s and PreferenceFactorys to have their own IGsonProviders allowing for flexible and contextually customizable serialization / deserialization with an API that is consistent with GSON's own API.
Example Usage
A sample Burp Extension that uses these features can be found here.
Please note that it also uses some other features for which I have submitted PRs but that may not yet have been pulled into this repo. A working version of a fork of this repo with all features used by the sample extension can be found here (tag 1.1.0-beta.0.2.1).
If you trust them, I have created releases with jars that you can load and run to save you the trouble of building:
This PR should only be considered AFTER this other PR (12), because this PR's commit history is based on the other's. If the other PR gets rejected, I will refactor this PR's code to not depend on it.
This change:
NameManager
class a related custom exception classes.Preferences
to coordinate with each other to be able to detect registeredsettingsName
s and notify the user with an exception if they try to do something stupid.Preferences
instances using theNameManager
This change allows each
Persisted*
andPreferenceFactory
to have their own instance ofPreferences
without sacrificing the benefit of key collision detection if you were to use a single sharedPreferences
instance. This in turn allowsPersisted*
s andPreferenceFactory
s to have their ownIGsonProvider
s allowing for flexible and contextually customizable serialization / deserialization with an API that is consistent with GSON's own API.Example Usage
A sample Burp Extension that uses these features can be found here.
Please note that it also uses some other features for which I have submitted PRs but that may not yet have been pulled into this repo. A working version of a fork of this repo with all features used by the sample extension can be found here (tag 1.1.0-beta.0.2.1).
If you trust them, I have created releases with jars that you can load and run to save you the trouble of building: