Package org.ka2ddo.yaac.io
Class ConfigImporter
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.ka2ddo.yaac.io.ConfigImporter
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
This class implements an XML parser that can interpret the XML export of a
YAAC configuration (as dumped by the Java Preferences code). It tries to provide enough
smarts to validate parts of the configuration that might be different when restoring on
a different computer (such as directory paths to the tile or log directories, serial
port device names, etc.).
- Author:
- Andrew Pavlin, KA2DDO
-
Method Summary
Modifier and TypeMethodDescriptionvoid
endElement
(String uri, String localName, String qName) Receive notification of the end of an element.static void
parseYAACXMLConfigFile
(InputStream is, long fileLength) void
setDocumentLocator
(Locator locator) Receive a Locator object for document events.void
startElement
(String uri, String localName, String qName, Attributes attributes) Receive notification of the start of an element.Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Method Details
-
parseYAACXMLConfigFile
- Throws:
UserAbort
-
setDocumentLocator
Receive a Locator object for document events.- Specified by:
setDocumentLocator
in interfaceContentHandler
- Overrides:
setDocumentLocator
in classDefaultHandler
- Parameters:
locator
- A locator for all SAX document events.- See Also:
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException Receive notification of the start of an element.- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classDefaultHandler
- Parameters:
uri
- The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.localName
- The local name (without prefix), or the empty string if Namespace processing is not being performed.qName
- The qualified name (with prefix), or the empty string if qualified names are not available.attributes
- The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.- Throws:
SAXException
- Any SAX exception, possibly wrapping another exception.
-
endElement
Receive notification of the end of an element.- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classDefaultHandler
- Parameters:
uri
- The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.localName
- The local name (without prefix), or the empty string if Namespace processing is not being performed.qName
- The qualified name (with prefix), or the empty string if qualified names are not available.- Throws:
SAXException
- Any SAX exception, possibly wrapping another exception.
-