org.apache.cocoon.components.treeprocessor
Interface TreeBuilder

All Superinterfaces:
org.apache.avalon.framework.component.Component
All Known Implementing Classes:
DefaultTreeBuilder

public interface TreeBuilder
extends org.apache.avalon.framework.component.Component

Version:
CVS $Id: TreeBuilder.java,v 1.2 2002/03/17 21:55:22 sylvain Exp $
Author:
Sylvain Wallez

Method Summary
 ProcessingNode build(org.apache.avalon.framework.configuration.Configuration tree)
          Build a processing tree from a Configuration.
 ProcessingNode build(Source source)
           
 ProcessingNodeBuilder createNodeBuilder(org.apache.avalon.framework.configuration.Configuration config)
           
 java.util.List getDisposableNodes()
          Return the list of ProcessingNodes part of this tree that are Disposable.
 java.lang.String getFileName()
           
 java.lang.String getLanguage()
          Returns the language that is being built (e.g.
 java.lang.String getNamespace()
          Get the namespace URI that builders should use to find their nodes.
 java.lang.String getParameterName()
          Returns the name of the parameter element.
 TreeProcessor getProcessor()
           
 ProcessingNode getRegisteredNode(java.lang.String name)
           
 java.lang.String getTypeForStatement(org.apache.avalon.framework.configuration.Configuration statement, java.lang.String role)
          Get the type for a statement : it returns the 'type' attribute if present, and otherwhise the default hint for the ComponentSelector identified by the role role.
 void registerNode(java.lang.String name, ProcessingNode node)
          Register a ProcessingNode under a given name.
 void setProcessor(TreeProcessor processor)
           
 ProcessingNode setupNode(ProcessingNode node, org.apache.avalon.framework.configuration.Configuration config)
          Setup a ProcessingNode by setting its location, calling all the lifecycle interfaces it implements and giving it the parameter map if it's a ParameterizableNode.
 

Method Detail

setProcessor

public void setProcessor(TreeProcessor processor)

getProcessor

public TreeProcessor getProcessor()

getLanguage

public java.lang.String getLanguage()
Returns the language that is being built (e.g. "sitemap").

getParameterName

public java.lang.String getParameterName()
Returns the name of the parameter element.

registerNode

public void registerNode(java.lang.String name,
                         ProcessingNode node)
Register a ProcessingNode under a given name. For example, ResourceNodeBuilder stores here the ProcessingNodes it produces for use by sitemap pipelines. This allows to turn the tree into a graph.

getRegisteredNode

public ProcessingNode getRegisteredNode(java.lang.String name)
Throws:
java.lang.IllegalStateException -  

createNodeBuilder

public ProcessingNodeBuilder createNodeBuilder(org.apache.avalon.framework.configuration.Configuration config)
                                        throws java.lang.Exception

getNamespace

public java.lang.String getNamespace()
Get the namespace URI that builders should use to find their nodes.

build

public ProcessingNode build(org.apache.avalon.framework.configuration.Configuration tree)
                     throws java.lang.Exception
Build a processing tree from a Configuration.

build

public ProcessingNode build(Source source)
                     throws java.lang.Exception

getFileName

public java.lang.String getFileName()

getDisposableNodes

public java.util.List getDisposableNodes()
Return the list of ProcessingNodes part of this tree that are Disposable. Care should be taken to properly dispose them before trashing the processing tree.

setupNode

public ProcessingNode setupNode(ProcessingNode node,
                                org.apache.avalon.framework.configuration.Configuration config)
                         throws java.lang.Exception
Setup a ProcessingNode by setting its location, calling all the lifecycle interfaces it implements and giving it the parameter map if it's a ParameterizableNode.

As a convenience, the node is returned by this method to allow constructs like return treeBuilder.setupNode(new MyNode(), config).


getTypeForStatement

public java.lang.String getTypeForStatement(org.apache.avalon.framework.configuration.Configuration statement,
                                            java.lang.String role)
                                     throws org.apache.avalon.framework.configuration.ConfigurationException
Get the type for a statement : it returns the 'type' attribute if present, and otherwhise the default hint for the ComponentSelector identified by the role role.
Throws:
org.apache.avalon.framework.configuration.ConfigurationException - if the default type could not be found.


Copyright © 1999-2002 Apache Software Foundation. All Rights Reserved.