merged 1.1 branch into head
[mir.git] / source / mir / producer / reader / ProducerConfigReader.java
index 631573f..988bb38 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001, 2002 The Mir-coders group
+ * Copyright (C) 2001-2006 The Mir-coders group
  *
  * This file is part of Mir.
  *
@@ -19,8 +19,6 @@
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
  * the code of this program with  any library licensed under the Apache Software License,
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
- * (or with modified versions of the above that use the same license as the above),
  * and distribute linked combinations including the two.  You must obey the
  * GNU General Public License in all respects for all of the code used other than
  * the above mentioned libraries.  If you modify this file, you may extend this
  */
 package  mir.producer.reader;
 
+import mir.producer.CompositeProducerNode;
+import mir.producer.ProducerFactory;
+import mir.producer.ProducerNode;
+import mir.producer.SimpleProducerVerb;
+import mir.util.ExceptionRoutines;
+import mir.util.xml.XMLParserEngine;
+import mir.util.xml.XMLParserExc;
+import mir.util.xml.XMLParserFailure;
+
 import java.io.File;
 import java.io.Reader;
 import java.util.ArrayList;
@@ -39,22 +46,13 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
-import mir.producer.CompositeProducerNode;
-import mir.producer.ProducerFactory;
-import mir.producer.ProducerNode;
-import mir.producer.SimpleProducerVerb;
-import mir.util.ExceptionFunctions;
-import mir.util.xml.XMLParserEngine;
-import mir.util.xml.XMLParserExc;
-import mir.util.xml.XMLParserFailure;
-
 public class ProducerConfigReader {
   private ProducerNodeBuilderLibrary builderLibrary;
   private ProducerNodeBuilderLibrary scriptedNodeBuilderLibrary;
 
   public ProducerConfigReader() {
     super();
-  };
+  }
 
   public void parse(Reader aReader, ProducerNodeBuilderLibrary aBuilderLibrary, List aProducerFactories) throws ProducerConfigFailure {
     try {
@@ -65,7 +63,7 @@ public class ProducerConfigReader {
 
     }
     catch (Throwable e) {
-      Throwable root = ExceptionFunctions.traceCauseException(e);
+      Throwable root = ExceptionRoutines.traceCauseException(e);
 
       if ((root instanceof XMLParserExc) && ((XMLParserExc) root).getHasLocation()) {
         XMLParserExc f = (XMLParserExc) root;
@@ -83,7 +81,7 @@ public class ProducerConfigReader {
 
     }
     catch (Throwable e) {
-      Throwable root = ExceptionFunctions.traceCauseException(e);
+      Throwable root = ExceptionRoutines.traceCauseException(e);
 
       if ((root instanceof XMLParserExc) && ((XMLParserExc) root).getHasLocation()) {
         XMLParserExc f = (XMLParserExc) root;
@@ -104,8 +102,7 @@ public class ProducerConfigReader {
       if (aTag.equals("producers")) {
         return new ProducersSectionHandler(producers);
       }
-      else
-        throw new XMLParserExc("Tag 'producers' expected, tag '"+aTag+"' found");
+                       throw new XMLParserExc("Tag 'producers' expected, tag '"+aTag+"' found");
     }
 
     public void endElement(mir.util.xml.SectionHandler aHandler) {
@@ -201,14 +198,12 @@ public class ProducerConfigReader {
           throw new XMLParserExc("Verbs already processed");
         if (body!=null)
           throw new XMLParserExc("Verbs should come before body");
-        else
-          return new ProducerVerbsSectionHandler();
+                               return new ProducerVerbsSectionHandler();
       }
       else if (aTag.equals("body")) {
         if (body==null)
           return new ProducerNodeSectionHandler();
-        else
-          throw new XMLParserExc("Body already processed");
+                               throw new XMLParserExc("Body already processed");
       }
       throw new XMLParserExc("Unexpected tag: '"+aTag+"'");
     }
@@ -288,8 +283,7 @@ public class ProducerConfigReader {
 
         return new ProducerNodeSectionHandler();
       }
-      else
-        throw new XMLParserExc("Only 'verb' tags allowed here, '" + aTag + "' encountered.");
+                       throw new XMLParserExc("Only 'verb' tags allowed here, '" + aTag + "' encountered.");
     }
 
     public void endElement(mir.util.xml.SectionHandler aHandler) {
@@ -472,9 +466,7 @@ public class ProducerConfigReader {
       if (producerNode.getNrSubNodes()==1) {
         return producerNode.getSubNode(0);
       }
-      else {
-        return producerNode;
-      }
+                       return producerNode;
     }
 
     public void finishSection() {