Class PreferenceBasedEObjectStore<T extends org.eclipse.emf.ecore.EObject>
java.lang.Object
com._1c.g5.v8.dt.internal.platform.services.core.PreferenceBasedEObjectStore<T>
- Type Parameters:
T
- the type of storing and loading objects
Preference based store support class that allows to store and load content as collection of
EObject
in
the Eclipse metadata preferences.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPreferenceBasedEObjectStore
(Class<T> storingClass, String preferenceKey) Creates an instance ofPreferenceBasedEObjectStore
. -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.emf.ecore.resource.Resource
createResource
(String serializedResource) Creates a resource by the serialized resource content.protected String
Returns the Eclipse preferences node qualifier to use for preference storing.Returns the preferences key to use to store and load content.Loads a content list from preferences.void
storeToPreferences
(Collection<T> storingObjects) Saves a collection of content to the preferences.
-
Field Details
-
DUPLICATE_PATTERN
Duplicate pattern. May be used to check unique name generation matching.
-
-
Constructor Details
-
PreferenceBasedEObjectStore
Creates an instance ofPreferenceBasedEObjectStore
.- Parameters:
storingClass
- the storing and loading preferences class, cannot benull
preferenceKey
- the preferences key to use for storing and loading content, cannot benull
-
-
Method Details
-
loadFromPreferences
Loads a content list from preferences.- Returns:
- the loaded content list, never
null
- Throws:
IOException
- if load fails
-
storeToPreferences
Saves a collection of content to the preferences.- Parameters:
storingObjects
- a collection of storing objects, cannot benull
- Throws:
IOException
- if save fails
-
createResource
public org.eclipse.emf.ecore.resource.Resource createResource(String serializedResource) throws IOException Creates a resource by the serialized resource content.- Parameters:
serializedResource
- the serialized resource content, cannot benull
- Returns:
- the created resource, never
null
- Throws:
IOException
- if creating fails
-
getStoringPreferenceKey
Returns the preferences key to use to store and load content.- Returns:
- the preferences key to use, never
null
-
getNodeQualifier
Returns the Eclipse preferences node qualifier to use for preference storing.- Returns:
- the Eclipse preferences node qualifier, never
null
-