2 * Copyright (C) 2001, 2002 The Mir-coders group
4 * This file is part of Mir.
6 * Mir is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * Mir is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with Mir; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 * In addition, as a special exception, The Mir-coders gives permission to link
21 * the code of this program with the com.oreilly.servlet library, any library
22 * licensed under the Apache Software License, The Sun (tm) Java Advanced
23 * Imaging library (JAI), The Sun JIMI library (or with modified versions of
24 * the above that use the same license as the above), and distribute linked
25 * combinations including the two. You must obey the GNU General Public
26 * License in all respects for all of the code used other than the above
27 * mentioned libraries. If you modify this file, you may extend this exception
28 * to your version of the file, but you are not obligated to do so. If you do
29 * not wish to do so, delete this exception statement from your version.
32 package mir.producer.reader;
36 import java.lang.System;
37 import org.xml.sax.helpers.DefaultHandler;
39 import javax.xml.parsers.ParserConfigurationException;
40 import javax.xml.parsers.SAXParser;
41 import javax.xml.parsers.SAXParserFactory;
44 import mir.config.exceptions.*;
45 import mir.producer.*;
47 //import mir.producer.exceptions.*;
48 import mir.misc.Location;
50 public class ProducerConfigReader {
51 private ProducerNodeBuilderLibrary builderLibrary;
52 private ProducerNodeBuilderLibrary scriptedNodeBuilderLibrary;
54 public ProducerConfigReader() {
58 public void parseFile(String aFileName, ProducerNodeBuilderLibrary aBuilderLibrary, Map aProducerFactories) throws ConfigFailure {
59 parseFile(aFileName, aBuilderLibrary, aProducerFactories, new Vector());
63 public void parseFile(String aFileName, ProducerNodeBuilderLibrary aBuilderLibrary, Map aProducerFactories, List aUsedFiles) throws ConfigFailure {
65 builderLibrary = aBuilderLibrary;
66 scriptedNodeBuilderLibrary = new ProducerNodeBuilderLibrary();
68 SAXParserFactory parserFactory = SAXParserFactory.newInstance();
70 parserFactory.setNamespaceAware(false);
71 parserFactory.setValidating(true);
73 ProducerConfigHandler handler = new ProducerConfigHandler(parserFactory, aProducerFactories, aUsedFiles);
75 handler.includeFile(aFileName);
78 if (e instanceof SAXParseException && ((SAXParseException) e).getException() instanceof ConfigFailure) {
79 throw (ConfigFailure) ((SAXParseException) e).getException();
83 throw new ConfigFailure( e.getMessage() );
88 private class ProducerConfigHandler extends DefaultHandler {
89 private Locator locator;
90 private Stack includeFileStack;
91 private SAXParserFactory parserFactory;
92 private SectionsManager manager;
93 private List usedFiles;
94 private InputSource inputSource;
96 public ProducerConfigHandler(SAXParserFactory aParserFactory, Map aProducers, List aUsedFiles) {
99 includeFileStack=new Stack();
100 parserFactory=aParserFactory;
101 includeFileStack = new Stack();
102 manager = new SectionsManager();
103 usedFiles = aUsedFiles;
105 manager.pushHandler(new RootSectionHandler(aProducers));
108 public String getLocatorDescription(Locator aLocator) {
109 return aLocator.getPublicId()+" ("+aLocator.getLineNumber()+")";
112 public void setDocumentLocator(Locator aLocator) {
116 private void includeFile(String aFileName) throws ConfigFailure, SAXParseException, SAXException {
121 if (!includeFileStack.empty())
122 file = new File(new File((String) includeFileStack.peek()).getParent(), aFileName);
124 file = new File(aFileName);
126 System.err.println("about to include "+file.getCanonicalPath());
128 if (includeFileStack.contains(file.getCanonicalPath())) {
129 throw new ConfigFailure("recursive inclusion of file "+file.getCanonicalPath(), getLocatorDescription(locator));
134 parser=parserFactory.newSAXParser();
136 inputSource = new InputSource(new FileInputStream(file));
137 inputSource.setPublicId(file.getCanonicalPath());
139 includeFileStack.push(file.getCanonicalPath());
141 parser.parse(inputSource, this);
144 includeFileStack.pop();
147 catch (ParserConfigurationException e) {
148 throw new ConfigFailure("Internal exception while including \""+aFileName+"\": "+e.getMessage(), e, getLocatorDescription(locator));
150 catch (SAXParseException e) {
153 catch (ConfigFailure e) {
156 catch (FileNotFoundException e) {
157 throw new ConfigFailure("Include file \""+aFileName+"\" not found: "+e.getMessage(), e, getLocatorDescription(locator));
159 catch (IOException e) {
160 throw new ConfigFailure("unable to open include file \""+aFileName+"\": "+e.getMessage(), e, getLocatorDescription(locator));
164 public void startElement(String aUri, String aTag, String aQualifiedName, Attributes anAttributes) throws SAXException {
169 if (aQualifiedName.equals("include")) {
170 String fileName=anAttributes.getValue("file");
172 if (fileName==null) {
173 throw new ConfigFailure("include has no file attribute", getLocatorDescription(locator));
176 includeFile(fileName);
179 attributesMap = new HashMap();
180 for (i=0; i<anAttributes.getLength(); i++)
181 attributesMap.put(anAttributes.getQName(i), anAttributes.getValue(i));
183 manager.pushHandler( manager.currentHandler().startElement(aQualifiedName, attributesMap) );
186 catch (Exception e) {
187 e.printStackTrace(System.out);
188 throw new SAXException(e);
192 public void endElement(String aUri, String aTag, String aQualifiedName) throws SAXException {
195 if (!aQualifiedName.equals("include")) {
196 SectionHandler handler = manager.popHandler();
198 handler.finishSection();
200 if (!manager.isEmpty()) {
201 manager.currentHandler().endElement(handler);
205 catch (Exception e) {
206 e.printStackTrace(System.out);
207 throw new SAXException(e);
211 public void characters(char[] aBuffer, int aStart, int anEnd) throws SAXParseException {
212 String text = new String(aBuffer, aStart, anEnd).trim();
213 if ( text.length() > 0) {
214 throw new SAXParseException("Text not allowed", locator, new ConfigFailure("text not allowed", getLocatorDescription(locator)));
219 public class SectionsManager {
222 public SectionsManager() {
223 handlerStack = new Stack();
226 public void pushHandler(SectionHandler aSectionHandler) {
227 handlerStack.push(aSectionHandler);
230 public SectionHandler popHandler() {
231 return (SectionHandler) handlerStack.pop();
234 public SectionHandler currentHandler() {
235 return (SectionHandler) handlerStack.peek();
238 public boolean isEmpty() {
239 return handlerStack.isEmpty();
243 public abstract class SectionHandler {
244 public abstract SectionHandler startElement(String aTag, Map anAttributes) throws ProducerConfigExc;
246 public abstract void endElement(SectionHandler aHandler) throws ProducerConfigExc;
250 public void finishSection() throws ProducerConfigExc {
254 public class RootSectionHandler extends SectionHandler {
255 private Map producers;
257 public RootSectionHandler(Map aProducers) {
258 producers = aProducers;
261 public SectionHandler startElement(String aTag, Map anAttributes) throws ProducerConfigExc {
262 if (aTag.equals("producers")) {
263 return new ProducersSectionHandler(producers);
266 throw new ProducerConfigExc ("Tag 'producers' expected, tag '"+aTag+"' found");
269 public void endElement(SectionHandler aHandler) {
272 public void finishSection() throws ProducerConfigExc {
277 private final static String PRODUCER_NAME_ATTRIBUTE = "name";
278 private final static String[] PRODUCER_REQUIRED_ATTRIBUTES = { PRODUCER_NAME_ATTRIBUTE };
279 private final static String[] PRODUCER_OPTIONAL_ATTRIBUTES = { };
281 private final static String NODE_DEFINITION_NAME_ATTRIBUTE = "name";
282 private final static String[] NODE_DEFINITION_REQUIRED_ATTRIBUTES = { NODE_DEFINITION_NAME_ATTRIBUTE };
283 private final static String[] NODE_DEFINITION_OPTIONAL_ATTRIBUTES = { };
285 public class ProducersSectionHandler extends SectionHandler {
286 private Map producers;
289 public ProducersSectionHandler(Map aProducers) {
290 producers = aProducers;
293 public SectionHandler startElement(String aTag, Map anAttributes) throws ProducerConfigExc {
295 if (aTag.equals("producer")) {
296 ReaderTool.checkAttributes(anAttributes, PRODUCER_REQUIRED_ATTRIBUTES, PRODUCER_OPTIONAL_ATTRIBUTES);
298 name = (String) anAttributes.get(PRODUCER_NAME_ATTRIBUTE);
299 ReaderTool.checkValidIdentifier( name );
301 if (producers.containsKey(name))
302 throw new ProducerConfigExc("Duplicate producer name: '" + name + "'");
304 name = (String) anAttributes.get(PRODUCER_NAME_ATTRIBUTE);
306 return new ProducerSectionHandler();
308 else if (aTag.equals("nodedefinition")) {
309 ReaderTool.checkAttributes(anAttributes, NODE_DEFINITION_REQUIRED_ATTRIBUTES, NODE_DEFINITION_OPTIONAL_ATTRIBUTES);
311 name = (String) anAttributes.get(NODE_DEFINITION_NAME_ATTRIBUTE);
312 ReaderTool.checkValidIdentifier( name );
314 // if (producers.containsKey(name))
315 // throw new ProducerConfigExc("Duplicate producer name: '" + name + "'");
317 name = (String) anAttributes.get(NODE_DEFINITION_NAME_ATTRIBUTE);
319 return new NodeDefinitionSectionHandler(name);
322 throw new ProducerConfigExc("Unexpected tag: "+aTag );
325 public void endElement(SectionHandler aHandler) throws ProducerConfigExc {
326 if (aHandler instanceof ProducerSectionHandler) {
327 producers.put(name, ((ProducerSectionHandler) aHandler).getProducerFactory());
329 else if (aHandler instanceof NodeDefinitionSectionHandler) {
330 scriptedNodeBuilderLibrary.registerFactory(name,
331 new DefaultProducerNodeBuilders.ScriptedProducerNodeBuilder.factory(
332 ((NodeDefinitionSectionHandler) aHandler).getDefinition()));
334 else throw new ProducerConfigExc("ProducersSectionHandler.endElement Internal error: Unexpected handler: " + aHandler.getClass().getName());
337 public void finishSection() throws ProducerConfigExc {
341 public class ProducerSectionHandler extends SectionHandler {
342 private ProducerFactory producerFactory;
344 private ProducerNode body;
346 private String defaultVerb;
348 public SectionHandler startElement(String aTag, Map anAttributes) throws ProducerConfigExc {
349 if (aTag.equals("verbs")) {
351 throw new ProducerConfigExc("Verbs already processed");
353 throw new ProducerConfigExc("Verbs should come before body");
355 return new ProducerVerbsSectionHandler();
357 else if (aTag.equals("body")) {
359 return new ProducerNodeSectionHandler();
361 throw new ProducerConfigExc("Body already processed");
363 throw new ProducerConfigExc("Unexpected tag: '"+aTag+"'");
366 public void endElement(SectionHandler aHandler) throws ProducerConfigExc {
367 if (aHandler instanceof ProducerNodeSectionHandler) {
368 body = ((ProducerNodeSectionHandler) aHandler).getProducerNode();
370 else if (aHandler instanceof ProducerVerbsSectionHandler)
372 verbs = ((ProducerVerbsSectionHandler) aHandler).getVerbs();
373 defaultVerb = ((ProducerVerbsSectionHandler) aHandler).getDefaultVerb();
375 else throw new ProducerConfigExc("ProducerSectionHandler.endElement Internal error: Unexpected handler: " + aHandler.getClass().getName());
378 public void finishSection() throws ProducerConfigExc {
380 throw new ProducerConfigExc("No verbs defined");
383 throw new ProducerConfigExc("No body defined");
385 producerFactory = new ScriptedProducerFactory(verbs, body, defaultVerb);
388 public ProducerFactory getProducerFactory() {
389 return producerFactory;
393 private final static String PRODUCER_VERB_NAME_ATTRIBUTE = "name";
394 private final static String PRODUCER_VERB_DEFAULT_ATTRIBUTE = "default";
395 private final static String[] PRODUCER_VERB_REQUIRED_ATTRIBUTES = { PRODUCER_VERB_NAME_ATTRIBUTE };
396 private final static String[] PRODUCER_VERB_OPTIONAL_ATTRIBUTES = { PRODUCER_VERB_DEFAULT_ATTRIBUTE };
398 public class ProducerVerbsSectionHandler extends SectionHandler {
400 private String defaultVerb;
401 private String currentVerb;
403 public ProducerVerbsSectionHandler() {
404 verbs = new HashMap();
408 public SectionHandler startElement(String aTag, Map anAttributes) throws ProducerConfigExc {
409 if (aTag.equals("verb")) {
410 ReaderTool.checkAttributes(anAttributes, PRODUCER_VERB_REQUIRED_ATTRIBUTES, PRODUCER_VERB_OPTIONAL_ATTRIBUTES);
411 currentVerb = (String) anAttributes.get( PRODUCER_VERB_NAME_ATTRIBUTE );
413 ReaderTool.checkValidIdentifier( currentVerb );
415 if (verbs.containsKey(currentVerb))
416 throw new ProducerConfigExc( "Duplicate definition of verb '" + currentVerb + "'" );
418 if (anAttributes.containsKey(PRODUCER_VERB_DEFAULT_ATTRIBUTE)) {
419 if (defaultVerb!=null)
420 throw new ProducerConfigExc( "Default verb already declared" );
422 defaultVerb = currentVerb;
425 return new ProducerNodeSectionHandler();
427 else throw new ProducerConfigExc("Only 'verb' tags allowed here, '" + aTag + "' encountered.");
430 public void endElement(SectionHandler aHandler) {
431 verbs.put(currentVerb, ((ProducerNodeSectionHandler) aHandler).getProducerNode());
434 public void finishSection() {
437 public String getDefaultVerb() {
441 public Map getVerbs() {
446 public class EmptySectionHandler extends SectionHandler {
447 public SectionHandler startElement(String aTag, Map anAttributes) throws ProducerConfigExc {
448 throw new ProducerConfigExc("No tags are allowed here");
451 public void endElement(SectionHandler aHandler) {
456 public class MultiProducerNodeSectionHandler extends SectionHandler {
457 private Map nodeParameters;
458 private Set validNodeParameters;
459 private String currentNodeParameter;
460 private String scriptedNodeName;
461 private Set allowedNodeParameterReferences;
463 public MultiProducerNodeSectionHandler(String aScriptedNodeName, Set anAllowedNodeParameterReferences, Set aValidNodeParameters) {
464 allowedNodeParameterReferences = anAllowedNodeParameterReferences;
465 scriptedNodeName = aScriptedNodeName;
466 validNodeParameters = aValidNodeParameters;
467 nodeParameters = new HashMap();
469 public MultiProducerNodeSectionHandler(Set aValidNodeParameters) {
470 this("", new HashSet(), aValidNodeParameters);
473 public SectionHandler startElement(String aTag, Map anAttributes) throws ProducerConfigExc {
474 if (!validNodeParameters.contains(aTag))
475 throw new ProducerConfigExc("Invalid node parameter: '" + aTag + "'");
476 else if (nodeParameters.containsKey(aTag))
477 throw new ProducerConfigExc("Node parameter: '" + aTag + "' already specified");
478 else if (anAttributes.size()>0)
479 throw new ProducerConfigExc("No parameters are allowed here");
481 currentNodeParameter = aTag;
483 return new ProducerNodeSectionHandler(scriptedNodeName, validNodeParameters);
486 public void endElement(SectionHandler aHandler) throws ProducerConfigExc {
487 if (aHandler instanceof ProducerNodeSectionHandler) {
488 nodeParameters.put(currentNodeParameter, ((ProducerNodeSectionHandler) aHandler).getProducerNode());
491 throw new ProducerConfigExc("Internal error: unknown section handler '" + aHandler.getClass().getName() + "'" );
495 public Map getNodeParameters() {
496 return nodeParameters;
500 public class ProducerNodeSectionHandler extends SectionHandler {
501 private CompositeProducerNode producerNode;
502 private ProducerNodeBuilder currentBuilder;
503 private String scriptedNodeName;
504 private Set allowedNodeParameterReferences;
506 public ProducerNodeSectionHandler(String aScriptedNodeName, Set anAllowedNodeParameterReferences) {
507 producerNode = new CompositeProducerNode();
508 scriptedNodeName = aScriptedNodeName;
509 allowedNodeParameterReferences = anAllowedNodeParameterReferences;
512 public ProducerNodeSectionHandler() {
513 this("", new HashSet());
516 public SectionHandler startElement(String aTag, Map anAttributes) throws ProducerConfigExc {
517 if (allowedNodeParameterReferences.contains((aTag))) {
518 if (!anAttributes.isEmpty()) {
519 throw new ProducerConfigExc( "No attributes allowed" );
522 currentBuilder = new DefaultProducerNodeBuilders.ScriptedProducerParameterNodeBuilder(scriptedNodeName, aTag);
523 // producerNode.addSubNode(
524 // new ScriptedProducerNodeDefinition.NodeParameterProducerNode(scriptedNodeName, aTag));
525 return new EmptySectionHandler();
527 else if (scriptedNodeBuilderLibrary.hasBuilderForName(aTag) || builderLibrary.hasBuilderForName((aTag))) {
529 if (scriptedNodeBuilderLibrary.hasBuilderForName(aTag))
530 currentBuilder = scriptedNodeBuilderLibrary.constructBuilder(aTag);
532 currentBuilder = builderLibrary.constructBuilder(aTag);
534 currentBuilder.setAttributes(anAttributes);
535 if (currentBuilder.getAvailableSubNodes().isEmpty()) {
536 return new EmptySectionHandler();
538 if (currentBuilder.getAvailableSubNodes().size()>1)
539 return new MultiProducerNodeSectionHandler(scriptedNodeName, allowedNodeParameterReferences, currentBuilder.getAvailableSubNodes());
540 else if (currentBuilder.getAvailableSubNodes().size()<1)
541 return new EmptySectionHandler();
543 return new ProducerNodeSectionHandler(scriptedNodeName, allowedNodeParameterReferences);
547 throw new ProducerConfigExc("Unknown producer node tag: '" + aTag + "'");
550 public void endElement(SectionHandler aHandler) throws ProducerConfigExc {
551 if (aHandler instanceof ProducerNodeSectionHandler) {
552 currentBuilder.setSubNode((String) (currentBuilder.getAvailableSubNodes().iterator().next()),
553 ((ProducerNodeSectionHandler) aHandler).getProducerNode());
555 else if (aHandler instanceof MultiProducerNodeSectionHandler) {
560 nodeParameters = ((MultiProducerNodeSectionHandler) aHandler).getNodeParameters();
561 i = nodeParameters.entrySet().iterator();
562 while (i.hasNext()) {
563 entry = (Map.Entry) i.next();
564 currentBuilder.setSubNode((String) entry.getKey(), (ProducerNode) entry.getValue());
567 else if (aHandler instanceof EmptySectionHandler) {
568 // deliberately empty: nothing expected, so nothing to process
571 throw new ProducerConfigExc("Internal error: unknown section handler '" + aHandler.getClass().getName() + "'" );
574 producerNode.addSubNode(currentBuilder.constructNode());
575 currentBuilder = null;
578 public ProducerNode getProducerNode() {
579 if (producerNode.getNrSubNodes()==1) {
580 return producerNode.getSubNode(0);
588 public class NodeDefinitionSectionHandler extends SectionHandler {
589 private ScriptedProducerNodeDefinition nodeDefinition;
590 private ProducerNode body;
591 private Map stringParameters;
592 private Map nodeParameters;
595 public NodeDefinitionSectionHandler(String aName) {
597 nodeParameters = null;
598 stringParameters = null;
602 public SectionHandler startElement(String aTag, Map anAttributes) throws ProducerConfigExc {
603 if (aTag.equals("parameters")) {
604 if (!anAttributes.isEmpty()) {
605 throw new ProducerConfigExc( "No attributes allowed for tag 'parameters'" );
607 if (nodeParameters!=null) {
608 throw new ProducerConfigExc( "Parameters have already been declared" );
611 throw new ProducerConfigExc( "Parameters should come before definition" );
614 return new NodeDefinitionParametersSectionHandler();
616 else if (aTag.equals("definition")) {
617 return new ProducerNodeSectionHandler(name, nodeParameters.keySet());
619 else throw new ProducerConfigExc("Only 'definition' or 'parameters' tags allowed here, '" + aTag + "' encountered.");
622 public void endElement(SectionHandler aHandler) {
623 if (aHandler instanceof NodeDefinitionParametersSectionHandler) {
624 stringParameters = ((NodeDefinitionParametersSectionHandler) aHandler).getStringParameters();
625 nodeParameters = ((NodeDefinitionParametersSectionHandler) aHandler).getNodeParameters();
627 else if (aHandler instanceof ProducerNodeSectionHandler) {
628 body = ((ProducerNodeSectionHandler) aHandler).getProducerNode();
632 public void finishSection() throws ProducerConfigExc {
635 throw new ProducerConfigExc( "Definition missing" );
637 nodeDefinition = new ScriptedProducerNodeDefinition(name);
639 nodeDefinition.setBody(body);
641 i = nodeParameters.keySet().iterator();
642 while (i.hasNext()) {
643 nodeDefinition.addNodeParameter((String) i.next());
646 i = stringParameters.entrySet().iterator();
647 while (i.hasNext()) {
648 Map.Entry entry = (Map.Entry) i.next();
649 nodeDefinition.addParameter((String) entry.getKey(), (String) entry.getValue());
653 public ScriptedProducerNodeDefinition getDefinition() {
654 return nodeDefinition;
658 private final static String NODE_DEFINITION_PARAMETER_NAME_ATTRIBUTE = "name";
659 private final static String NODE_DEFINITION_PARAMETER_DEFAULTVALUE_ATTRIBUTE = "defaultvalue";
660 private final static String[] NODE_DEFINITION_PARAMETER_REQUIRED_ATTRIBUTES = { NODE_DEFINITION_PARAMETER_NAME_ATTRIBUTE };
661 private final static String[] NODE_DEFINITION_PARAMETER_OPTIONAL_ATTRIBUTES = { NODE_DEFINITION_PARAMETER_DEFAULTVALUE_ATTRIBUTE };
662 private final static String[] NODE_DEFINITION_NODE_PARAMETER_OPTIONAL_ATTRIBUTES = { };
664 public class NodeDefinitionParametersSectionHandler extends SectionHandler {
665 private Map nodeParameters;
666 private Map stringParameters;
668 public NodeDefinitionParametersSectionHandler() {
669 nodeParameters = new HashMap();
670 stringParameters = new HashMap();
673 public SectionHandler startElement(String aTag, Map anAttributes) throws ProducerConfigExc {
674 String parameterName;
677 if (aTag.equals("node")) {
678 ReaderTool.checkAttributes(anAttributes, NODE_DEFINITION_PARAMETER_REQUIRED_ATTRIBUTES, NODE_DEFINITION_NODE_PARAMETER_OPTIONAL_ATTRIBUTES);
679 parameterName = (String) anAttributes.get( NODE_DEFINITION_PARAMETER_NAME_ATTRIBUTE );
681 if (nodeParameters.containsKey(parameterName))
682 throw new ProducerConfigExc("Duplicate parameter name: '" + parameterName + "'");
684 ReaderTool.checkValidIdentifier( parameterName );
686 nodeParameters.put(parameterName, parameterName);
688 return new EmptySectionHandler();
690 else if (aTag.equals("string")) {
691 ReaderTool.checkAttributes(anAttributes, NODE_DEFINITION_PARAMETER_REQUIRED_ATTRIBUTES, NODE_DEFINITION_PARAMETER_OPTIONAL_ATTRIBUTES);
692 parameterName = (String) anAttributes.get( NODE_DEFINITION_PARAMETER_NAME_ATTRIBUTE );
694 if (stringParameters.containsKey(parameterName))
695 throw new ProducerConfigExc("Duplicate parameter name: '" + parameterName + "'");
697 ReaderTool.checkValidIdentifier( parameterName );
699 defaultValue = (String) anAttributes.get( NODE_DEFINITION_PARAMETER_DEFAULTVALUE_ATTRIBUTE );
701 stringParameters.put(parameterName, defaultValue);
703 return new EmptySectionHandler();
705 else throw new ProducerConfigExc("Only 'string' and 'node' tags allowed here, '" + aTag + "' encountered.");
709 public void endElement(SectionHandler aHandler) {
712 public void finishSection() {
715 public Map getNodeParameters() {
716 return nodeParameters;
719 public Map getStringParameters() {
720 return stringParameters;
727 / (expecting producers)
728 producers/ (expecting nodedefinition, producer)
729 nodedefinition (expecting parameters, definition)
730 parameters (expecting parameter declarations)
731 definition (expecting nodes, subnodes)