Preferences
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final String | EXTERNAL_XML_VERSION
Version number for the format exported preferences files. |
| private static final String | |
| private static final String | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private static Document | |
| pack-priv static void | export(OutputStream os, final Preferences p, boolean subTree)
Export the specified preferences node and, if subTree is true, all subnodes, to the specified output stream. |
| pack-priv static void | exportMap(OutputStream os, Map<String, String> map)
Export the specified Map<String,String> to a map document on the specified OutputStream as per the prefs DTD. |
| pack-priv static void | importMap(InputStream is, Map<String, String> m)
Import Map from the specified input stream, which is assumed to contain a map document as per the prefs DTD. |
| pack-priv 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, 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, 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 Document | loadPrefsDoc(InputStream in)
Load an XML document from specified input stream, which must have the requisite DTD URI. |
| private static void | putPreferencesInXml(Element elt, 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. |
| private static final void |
| EXTERNAL_XML_VERSION | back to summary |
|---|---|
| private static final String EXTERNAL_XML_VERSION Version number for the format exported preferences files. | |
| MAP_XML_VERSION | back to summary |
|---|---|
| private static final String MAP_XML_VERSION | |
| PREFS_DTD | back to summary |
|---|---|
| private static final String PREFS_DTD | |
| PREFS_DTD_URI | back to summary |
|---|---|
| private static final String PREFS_DTD_URI | |
| XmlSupport | back to summary |
|---|---|
| pack-priv XmlSupport() | |
| createPrefsDoc | back to summary |
|---|---|
| private static Document createPrefsDoc(String qname) Create a new prefs XML document. | |
| export | back to summary |
|---|---|
| pack-priv static void export(OutputStream os, final Preferences p, boolean subTree) throws IOException, BackingStoreException Export the specified preferences node and, if subTree is true, all subnodes, to the specified output stream. Preferences are exported as an XML document conforming to the definition in the Preferences spec.
| |
| exportMap | back to summary |
|---|---|
| pack-priv static void exportMap(OutputStream os, Map<String, String> map) throws IOException Export the specified Map<String,String> to a map document on the specified OutputStream as per the prefs DTD. This is used as the internal (undocumented) format for FileSystemPrefs.
| |
| importMap | back to summary |
|---|---|
| pack-priv static void importMap(InputStream is, Map<String, String> m) throws IOException, InvalidPreferencesFormatException Import Map from the specified input stream, which is assumed to contain a map document as per the prefs DTD. This is used as the internal (undocumented) format for FileSystemPrefs. The key-value pairs specified in the XML document will be put into the specified Map. (If this Map is empty, it will contain exactly the key-value pairs int the XML-document when this method returns.)
| |
| importPreferences | back to summary |
|---|---|
| pack-priv static void importPreferences(InputStream is) throws IOException, InvalidPreferencesFormatException Import preferences from the specified input stream, which is assumed to contain an XML document in the format described in the Preferences spec.
| |
| ImportPrefs | back to summary |
|---|---|
| private static void ImportPrefs(Preferences prefsNode, Element map) Import the preferences described by the specified XML element (a map from a preferences document) into the specified preferences node. | |
| ImportSubtree | back to summary |
|---|---|
| private static void ImportSubtree(Preferences prefsNode, Element xmlNode) Recursively traverse the specified preferences node and store the described preferences into the system or current user preferences tree, as appropriate. | |
| loadPrefsDoc | back to summary |
|---|---|
| private static Document loadPrefsDoc(InputStream in) throws SAXException, IOException Load an XML document from specified input stream, which must have the requisite DTD URI. | |
| putPreferencesInXml | back to summary |
|---|---|
| private static void putPreferencesInXml(Element elt, Document doc, Preferences prefs, boolean subTree) throws BackingStoreException 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. If subTree is true, create children of the specified XML node conforming to all of the children of the specified Preferences node and recurse.
| |
| writeDoc | back to summary |
|---|---|
| private static final void writeDoc(Document doc, OutputStream out) throws IOException Write XML document to the specified output stream. | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | error(SAXParseException x)
Implements org. Receive notification of a recoverable error. |
| public void | fatalError(SAXParseException x)
Implements org. Receive notification of a non-recoverable, fatal error. |
| public void | warning(SAXParseException x)
Implements org. Receive notification of a warning. |
| EH | back to summary |
|---|---|
| private EH() | |
| error | back to summary |
|---|---|
| public void error(SAXParseException x) throws SAXException Implements org. Doc from org. Receive notification of a recoverable error. This corresponds to the definition of "error" in section 1.2 of the W3C XML 1.0 Recommendation. For example, a validating parser would use this callback to report the violation of a validity constraint. The default behaviour is to take no action. The SAX parser must continue to provide normal parsing events after invoking this method: it should still be possible for the application to process the document through to the end. If the application cannot do so, then the parser should report a fatal error even if the XML recommendation does not require it to do so. Filters may use this method to report other, non-XML errors as well.
| |
| fatalError | back to summary |
|---|---|
| public void fatalError(SAXParseException x) throws SAXException Implements org. Doc from org. Receive notification of a non-recoverable, fatal error. As defined in section 1.2 of the W3C XML 1.0 Recommendation, fatal errors are those that would make it impossible for a parser to continue normal processing. These include violation of a well-formedness constraint, invalid encoding, and forbidden structural errors as described in the W3C XML 1.0 Recommendation.
| |
| warning | back to summary |
|---|---|
| public void warning(SAXParseException x) throws SAXException Implements org. Doc from org. Receive notification of a warning. SAX parsers will use this method to report conditions that are not errors or fatal errors as defined by the XML recommendation. The default behaviour is to take no action. The SAX parser must continue to provide normal parsing events after invoking this method: it should still be possible for the application to process the document through to the end. Filters may use this method to report other, non-XML warnings as well.
| |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public InputSource | resolveEntity(String pid, String sid)
Implements org. Allow the application to resolve external entities. |
| Resolver | back to summary |
|---|---|
| private Resolver() | |
| resolveEntity | back to summary |
|---|---|
| public InputSource resolveEntity(String pid, String sid) throws SAXException Implements org. Doc from org. Allow the application to resolve external entities. The parser will call this method before opening any external entity except the top-level document entity. Such entities include the external DTD subset and external parameter entities referenced within the DTD (in either case, only if the parser reads external parameter entities), and external general entities referenced within the document element (if the parser reads external general entities). The application may request that the parser locate the entity itself, that it use an alternative URI, or that it use data provided by the application (as a character or byte input stream). Application writers can use this method to redirect external system identifiers to secure and/or local URIs, to look up public identifiers in a catalogue, or to read an entity from a database or other input source (including, for example, a dialog box). Neither XML nor SAX specifies a preferred policy for using public or system IDs to resolve resources. However, SAX specifies how to interpret any InputSource returned by this method, and that if none is returned, then the system ID will be dereferenced as a URL. If the system identifier is a URL, the SAX parser must resolve it fully before reporting it to the application.
| |