public interface PersistentStateComponent<T>
See IntelliJ Platform SDK DevGuide for detailed description.
Do NOT use for sensitive data, see Persisting Sensitive Data.
In general, implementation should be thread-safe, because "loadState" is called from the same thread where component is initialized. If component used only from one thread (e.g. EDT), thread-safe implementation is not required.
SimplePersistentStateComponent
Modifier and Type | Method and Description |
---|---|
T |
getState() |
default void |
initializeComponent()
If class also is a component, then this method will be called after loading state (even if not state) but only once throughout the life cycle
|
void |
loadState(T state)
This method is called when new component state is loaded.
|
default void |
noStateLoaded()
This method is called when the component is initialized, but no state is persisted.
|
T getState()
null
value indicates
that the returned state won't be stored, as a result previously stored state will be used.XmlSerializer
void loadState(T state)
State object should be used directly, defensive copying is not required.
state
- loaded component stateXmlSerializerUtil.copyBean(Object, Object)
default void noStateLoaded()
default void initializeComponent()