Package jmri.util.prefs
Class JmriConfigurationProvider
- java.lang.Object
-
- jmri.util.prefs.AbstractConfigurationProvider
-
- jmri.util.prefs.JmriConfigurationProvider
-
public final class JmriConfigurationProvider extends AbstractConfigurationProvider
Provides a general purpose XML element storage mechanism for the storage of configuration and preferences too complex to be handled byJmriPreferencesProvider
.There are two configuration files per
Profile
andNodeIdentity
, both stored in the directoryprofile:profile
:profile.xml
preferences that are shared across multiple nodes for a single profile. An example of such a preference would be the Railroad Name preference.<node-identity>/profile.xml
preferences that are specific to the profile running on a specific host (<node-identity> is the identity returned byNodeIdentity.storageIdentity()
). An example of such a preference would be a file location.
Non-profile specific configuration that applies to all profiles is stored in the file
settings:preferences/preferences.xml
.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
NAMESPACE
-
Fields inherited from class jmri.util.prefs.AbstractConfigurationProvider
project
-
-
Constructor Summary
Constructors Constructor Description JmriConfigurationProvider(Profile project)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static JmriConfigurationProvider
findProvider(Profile project)
Get the JmriPrefererncesProvider for the specified profile.protected AuxiliaryConfiguration
getConfiguration()
Get theAuxiliaryConfiguration
.static AuxiliaryConfiguration
getConfiguration(Profile project)
Get thePreferences
for the specified class in the specified profile.protected java.io.File
getConfigurationFile(boolean shared)
-
Methods inherited from class jmri.util.prefs.AbstractConfigurationProvider
getConfigurationDirectory, isPrivateBackedUp, isSharedBackedUp, setPrivateBackedUp, setSharedBackedUp
-
-
-
-
Field Detail
-
NAMESPACE
public static final java.lang.String NAMESPACE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JmriConfigurationProvider
JmriConfigurationProvider(Profile project)
-
-
Method Detail
-
findProvider
static JmriConfigurationProvider findProvider(Profile project)
Get the JmriPrefererncesProvider for the specified profile.- Parameters:
project
- The profile. This is most often the profile returned by theProfileManager.getActiveProfile()
method of the ProfileManager returned byProfileManager.getDefault()
- Returns:
- The shared or private JmriPreferencesProvider for the project.
-
getConfiguration
public static AuxiliaryConfiguration getConfiguration(Profile project)
Get thePreferences
for the specified class in the specified profile.- Parameters:
project
- The profile. This is most often the profile returned by theProfileManager.getActiveProfile()
method of the ProfileManager returned byProfileManager.getDefault()
- Returns:
- The shared or private AuxiliaryConfiguration for project.
-
getConfiguration
protected AuxiliaryConfiguration getConfiguration()
Get theAuxiliaryConfiguration
.- Specified by:
getConfiguration
in classAbstractConfigurationProvider
- Returns:
- The AuxiliaryConfiguration.
-
getConfigurationFile
protected java.io.File getConfigurationFile(boolean shared)
- Specified by:
getConfigurationFile
in classAbstractConfigurationProvider
-
-