Refactored simple SAX ElementHandler to be an interface.
authorplaa <plaa@180e2498-e6e9-4542-8430-84ac67f01cd8>
Sun, 19 Feb 2012 08:42:53 +0000 (08:42 +0000)
committerplaa <plaa@180e2498-e6e9-4542-8430-84ac67f01cd8>
Sun, 19 Feb 2012 08:42:53 +0000 (08:42 +0000)
git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@429 180e2498-e6e9-4542-8430-84ac67f01cd8

core/src/net/sf/openrocket/file/simplesax/DelegatorHandler.java
core/src/net/sf/openrocket/file/simplesax/SimpleSAX.java

index 0b88640ca683ad5a6611bc1fc4dd2f8174599f14..d5c1f37312df9c759bbb3bf7ef09bf6c66234120 100644 (file)
@@ -13,7 +13,7 @@ import org.xml.sax.helpers.DefaultHandler;
 
 /**
  * The actual SAX handler class.  Contains the necessary methods for parsing the SAX source.
- * Delegates the actual content parsing to {@link AbstractElementHandler} objects.
+ * Delegates the actual content parsing to {@link ElementHandler} objects.
  */
 class DelegatorHandler extends DefaultHandler {
        private final WarningSet warnings;
@@ -27,7 +27,7 @@ class DelegatorHandler extends DefaultHandler {
        private int ignore = 0;
        
        
-       public DelegatorHandler(AbstractElementHandler initialHandler, WarningSet warnings) {
+       public DelegatorHandler(ElementHandler initialHandler, WarningSet warnings) {
                this.warnings = warnings;
                handlerStack.add(initialHandler);
                elementData.add(new StringBuilder()); // Just in case
index 62dc35a9b3f18f22d6f29a822f499bb2df4b7437..ec17b77514271200d5b23123dc3d4301a302b563 100644 (file)
@@ -16,14 +16,14 @@ import org.xml.sax.helpers.XMLReaderFactory;
  * both.  This holds true for both the OpenRocket and RockSim design formats and the
  * RockSim engine definition format.
  * <p>
- * The actual handling is performed by subclasses of {@link AbstractElementHandler}.  The 
- * initial handler is provided to the {@link #readXML(InputSource, AbstractElementHandler, WarningSet)}
+ * The actual handling is performed by subclasses of {@link ElementHandler}.  The 
+ * initial handler is provided to the {@link #readXML(InputSource, ElementHandler, WarningSet)}
  * method.
  * 
  * @author Sampo Niskanen <sampo.niskanen@iki.fi>
  */
 public class SimpleSAX {
-
+       
        /**
         * Read a simple XML file.
         * 
@@ -33,11 +33,11 @@ public class SimpleSAX {
         * @throws IOException          if an I/O exception occurs while reading.
         * @throws SAXException         if e.g. malformed XML is encountered.
         */
-       public static void readXML(InputSource source, AbstractElementHandler initialHandler,
+       public static void readXML(InputSource source, ElementHandler initialHandler,
                        WarningSet warnings) throws IOException, SAXException {
-
+               
                DelegatorHandler xmlhandler = new DelegatorHandler(initialHandler, warnings);
-
+               
                XMLReader reader = XMLReaderFactory.createXMLReader();
                reader.setContentHandler(xmlhandler);
                reader.setErrorHandler(xmlhandler);