/*
- * Copyright (C) 2001, 2002 The Mir-coders group
+ * Copyright (C) 2001-2006 The Mir-coders group
*
* This file is part of Mir.
*
*
* 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;
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 {
}
catch (Throwable e) {
- Throwable root = ExceptionFunctions.traceCauseException(e);
+ Throwable root = ExceptionRoutines.traceCauseException(e);
if ((root instanceof XMLParserExc) && ((XMLParserExc) root).getHasLocation()) {
XMLParserExc f = (XMLParserExc) root;
}
catch (Throwable e) {
- Throwable root = ExceptionFunctions.traceCauseException(e);
+ Throwable root = ExceptionRoutines.traceCauseException(e);
if ((root instanceof XMLParserExc) && ((XMLParserExc) root).getHasLocation()) {
XMLParserExc f = (XMLParserExc) root;
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) {
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+"'");
}
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) {
if (producerNode.getNrSubNodes()==1) {
return producerNode.getSubNode(0);
}
- else {
- return producerNode;
- }
+ return producerNode;
}
public void finishSection() {