1 16 package org.apache.cocoon.components.treeprocessor; 17 18 import org.apache.avalon.framework.component.ComponentException; 19 import org.apache.avalon.framework.component.ComponentManager; 20 import org.apache.avalon.framework.component.Recomposable; 21 import org.apache.avalon.framework.configuration.Configuration; 22 import org.apache.avalon.framework.configuration.ConfigurationException; 23 import org.apache.avalon.framework.logger.AbstractLogEnabled; 24 25 30 public abstract class AbstractProcessingNodeBuilder extends AbstractLogEnabled 31 implements ProcessingNodeBuilder, Recomposable { 32 33 protected TreeBuilder treeBuilder; 34 35 protected ComponentManager manager; 36 37 public void compose(ComponentManager manager) throws ComponentException { 38 this.manager = manager; 39 } 40 41 public void recompose(ComponentManager manager) throws ComponentException { 42 this.manager = manager; 43 } 44 45 public void setBuilder(TreeBuilder treeBuilder) { 46 this.treeBuilder = treeBuilder; 47 } 48 49 54 protected boolean hasParameters() { 55 return true; 56 } 57 58 62 protected void checkNamespace(Configuration config) throws ConfigurationException { 63 if (!this.treeBuilder.getNamespace().equals(config.getNamespace())) { 64 String msg = "Invalid namespace '" + config.getNamespace() + "' at " + config.getLocation(); 65 throw new ConfigurationException(msg); 66 } 67 } 68 } 69 | Popular Tags |