1 package com.explosion.utilities.preferences.persist;
2
3 import java.util.Map;
4 import java.util.prefs.Preferences;
5
6 import com.explosion.utilities.preferences.impl.inmemory.InMemoryPreferenceGroupPersister;
7 import com.explosion.utilities.preferences.impl.sun.SunPreferenceGroupPersister;
8 import com.explosion.utilities.preferences.impl.xml.XMLPreferencePersistenceRequirement;
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 /***
31 * @author Stephen Cowx
32 * Created on 14-Mar-2005
33 */
34 public class PreferenceGroupPersisterFactory
35 {
36
37 /***
38 *
39 */
40 public PreferenceGroupPersisterFactory()
41 {
42 }
43
44 public static PreferenceGroupPersister createPreferenceGroupPersister(Object referenceToStore)
45 {
46 if (referenceToStore instanceof Map)
47 {
48 return InMemoryPreferenceGroupPersister.createPreferenceGroupPersistor(referenceToStore);
49 }
50 else if (referenceToStore instanceof Preferences)
51 {
52 return SunPreferenceGroupPersister.createPreferenceGroupPersistor(referenceToStore);
53 }
54 else if (referenceToStore instanceof XMLPreferencePersistenceRequirement)
55 {
56 return null;
57 }
58
59 return null;
60 }
61
62 }