API question for AbstractPreferenceStore [message #1849463] |
Thu, 20 January 2022 15:23 |
Javier Martin Messages: 2 Registered: January 2022 |
Junior Member |
|
|
I have an RCP-based application that wants to store some of its preferences in a custom format/location. Looking into the Eclipse docs (see refs below) I think that the correct way of going about this is adding a custom preference scope with a storage class extending AbstractPreferenceStore.
My question is related to the fact that the system is calling my class in very specific ways that are not really described in the Javadoc. In particular, it seems like:
- The childrenNames method is only called for the root node of the custom scope (e.g. "/foo" if my custom scope is "foo") .
- The load and save methods are only called for the direct children of the same root node (e.g. "/foo/bar" and siblings). In particular, they are not called for "/foo" itself, so if I write any preferences there, they are not persisted.
- Any nodes further down the tree are managed directly by the system, and passed to my load/save methods already flattened into a Properties object with relative path-based keys (e.g. key "a/b/c" for a property "c" in node "/foo/bar/a/b").
These are implementation choices that are fine, even if I might not find them all desirable. However, they are not sufficiently clear to me in the documentation referenced below, and if I write my APS implementation "to spec" I need to make my class much more complex to deal with mapping the possible internal nodes - which per the implementation will never exist, and the actual code has not changed much since Juno.
Thus, my question is: can the documentation in AbstractPreferenceStore be clarified so that implementors can trust the points noted above? Or do I have to account for possible future changes that would require me to consider deeper paths in the childrenNames, load and save methods?
References:
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03685 seconds