|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mindtree.techworks.insight.preferences.xmlpersistence.XMLPreferenceDataHandler
public class XMLPreferenceDataHandler
This is an implementation of the PreferenceDataHandler. It populates the
preferences stored in an XML file following a schema. The schema is located
within the classpath at the location
com.mindtree.techworks.insight.preferences.xmlpersistence.res.InsightPreferences.xsd
.
For more details on the schema see
XMLPreferenceDataReader
.
PreferenceDataHandler
Field Summary | |
---|---|
protected static java.lang.String |
LEXICAL_HANDLER_PROPERTY_ID
Lexical handler property id (http://xml.org/sax/properties/lexical-handler). |
protected java.lang.String |
schemaFilePath
Stores the location of the schema. |
static java.lang.String |
XML_PROP_FILE_URI
Relative path of the config file |
Constructor Summary | |
---|---|
XMLPreferenceDataHandler()
Default constructor. |
Method Summary | |
---|---|
java.util.Collection |
getAllPreferences()
Returns all the preferences. |
Preference |
getPreference(java.lang.String preferenceId)
Returns a preference for the id passed, or null if no preference is found for the id. |
java.util.Collection |
getPreferenceNameList()
Returns a list of PreferenceInfo objects. |
void |
savePreferences(java.util.List preferences)
Saves the given preferences |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String LEXICAL_HANDLER_PROPERTY_ID
public static final java.lang.String XML_PROP_FILE_URI
protected java.lang.String schemaFilePath
This variable should have been a local variable of the validateXMLFile() method, but it needs to be accessed by the inner class, hench it is made a class field.
Constructor Detail |
---|
public XMLPreferenceDataHandler() throws PreferenceHandlerInstantiationException
PreferenceHandlerInstantiationException
- When the Handler cannot
be instantiated because the XML is not valid or is not found.Method Detail |
---|
public java.util.Collection getPreferenceNameList()
Returns a list of PreferenceInfo objects.
It first checks if the preferences have been loaded onto the cache or not. If not then loads the preferences on the cache and then returns the preference info.
getPreferenceNameList
in interface PreferenceDataHandler
PreferenceDataHandler.getPreferenceNameList()
public Preference getPreference(java.lang.String preferenceId)
Returns a preference for the id passed, or null if no preference is found for the id.
It first checks if the preferences have been loaded onto the cache or not. If not then loads the preferences on the cache and then returns the preference.
getPreference
in interface PreferenceDataHandler
preferenceId
- The id of the Preference to be loaded
PreferenceDataHandler.getPreference(java.lang.String)
public void savePreferences(java.util.List preferences) throws PreferenceHandlerStoreException
savePreferences
in interface PreferenceDataHandler
preferences
- The Preferences to store.
PreferenceHandlerStoreException
PreferenceDataHandler.savePreferences(java.util.List)
public java.util.Collection getAllPreferences()
getAllPreferences
in interface PreferenceDataHandler
PreferenceDataHandler.getAllPreferences()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |