|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.prefs.XmlSupport
XML Support for java.util.prefs. Methods to import and export preference nodes and subtrees.
Preferences
Nested Class Summary | |
private static class |
XmlSupport.EH
|
private static class |
XmlSupport.Resolver
|
Field Summary | |
private static String |
EXTERNAL_XML_VERSION
Version number for the format exported preferences files. |
private static String |
MAP_XML_VERSION
|
private static String |
PREFS_DTD
|
private static String |
PREFS_DTD_URI
|
Constructor Summary | |
(package private) |
XmlSupport()
|
Method Summary | |
(package private) static void |
export(OutputStream os,
Preferences p,
boolean subTree)
Export the specified preferences node and, if subTree is true, all subnodes, to the specified output stream. |
(package private) static void |
exportMap(OutputStream os,
Map map)
Export the specified Map |
(package private) static void |
importMap(InputStream is,
Map m)
Import Map from the specified input stream, which is assumed to contain a map document as per the prefs DTD. |
(package private) static void |
importPreferences(InputStream is)
Import preferences from the specified input stream, which is assumed to contain an XML document in the format described in the Preferences spec. |
private static void |
ImportPrefs(Preferences prefsNode,
org.w3c.dom.Element map)
Import the preferences described by the specified XML element (a map from a preferences document) into the specified preferences node. |
private static void |
ImportSubtree(Preferences prefsNode,
org.w3c.dom.Element xmlNode)
Recursively traverse the specified preferences node and store the described preferences into the system or current user preferences tree, as appropriate. |
private static org.w3c.dom.Document |
load(InputStream in)
Load an XML document from specified input stream, which must have the requisite DTD URI. |
private static void |
putPreferencesInXml(org.w3c.dom.Element elt,
org.w3c.dom.Document doc,
Preferences prefs,
boolean subTree)
Put the preferences in the specified Preferences node into the specified XML element which is assumed to represent a node in the specified XML document which is assumed to conform to PREFS_DTD. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String PREFS_DTD_URI
private static final String PREFS_DTD
private static final String EXTERNAL_XML_VERSION
private static final String MAP_XML_VERSION
Constructor Detail |
XmlSupport()
Method Detail |
static void export(OutputStream os, Preferences p, boolean subTree) throws IOException, BackingStoreException
IOException
- if writing to the specified output stream
results in an IOException.
BackingStoreException
- if preference data cannot be read from
backing store.
IllegalStateException
- if this node (or an ancestor) has been
removed with the #removeNode()
method.private static void putPreferencesInXml(org.w3c.dom.Element elt, org.w3c.dom.Document doc, Preferences prefs, boolean subTree) throws BackingStoreException
BackingStoreException
- if it is not possible to read
the preferences or children out of the specified
preferences node.static void importPreferences(InputStream is) throws IOException, InvalidPreferencesFormatException
IOException
- if reading from the specified output stream
results in an IOException.
InvalidPreferencesFormatException
- Data on input stream does not
constitute a valid XML document with the mandated document type.private static org.w3c.dom.Document load(InputStream in) throws org.xml.sax.SAXException, IOException
org.xml.sax.SAXException
IOException
private static void ImportSubtree(Preferences prefsNode, org.w3c.dom.Element xmlNode)
private static void ImportPrefs(Preferences prefsNode, org.w3c.dom.Element map)
static void exportMap(OutputStream os, Map map) throws IOException
IOException
- if writing to the specified output stream
results in an IOException.static void importMap(InputStream is, Map m) throws IOException, InvalidPreferencesFormatException
IOException
- if reading from the specified output stream
results in an IOException.
InvalidPreferencesFormatException
- Data on input stream does not
constitute a valid XML document with the mandated document type.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |