org.apache.cocoon.components.treeprocessor
Interface TreeBuilder

All Superinterfaces:
Component
All Known Implementing Classes:
DefaultTreeBuilder, SitemapLanguage

public interface TreeBuilder
extends Component

Version:
CVS $Id: TreeBuilder.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Sylvain Wallez

Method Summary
 ProcessingNode build(Configuration tree)
          Build a processing tree from a Configuration.
 ProcessingNode build(Source source)
           
 ProcessingNodeBuilder createNodeBuilder(Configuration config)
           
 Object getAttribute(String name)
          Get the value of an attribute.
 List getDisposableNodes()
          Return the list of ProcessingNodes part of this tree that are Disposable.
 String getFileName()
           
 String getLanguage()
          Returns the language that is being built (e.g.
 String getNamespace()
          Get the namespace URI that builders should use to find their nodes.
 String getParameterName()
          Returns the name of the parameter element.
 ConcreteTreeProcessor getProcessor()
           
 ProcessingNode getRegisteredNode(String name)
           
 ComponentManager getSitemapComponentManager()
          Return the sitemap component manager
 String getTypeForStatement(Configuration statement, 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.
 boolean registerNode(String name, ProcessingNode node)
          Register a ProcessingNode under a given name.
 void setAttribute(String name, Object value)
          Add an attribute.
 void setProcessor(ConcreteTreeProcessor processor)
           
 ProcessingNode setupNode(ProcessingNode node, 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

void setProcessor(ConcreteTreeProcessor processor)

getProcessor

ConcreteTreeProcessor getProcessor()

getLanguage

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


getParameterName

String getParameterName()
Returns the name of the parameter element.


registerNode

boolean registerNode(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. If a node with the name is already registed, the process fails!

Returns:
If the node could be registered, true is returned; otherwise false.

getRegisteredNode

ProcessingNode getRegisteredNode(String name)
Throws:
IllegalStateException

createNodeBuilder

ProcessingNodeBuilder createNodeBuilder(Configuration config)
                                        throws Exception
Throws:
Exception

getNamespace

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


build

ProcessingNode build(Configuration tree)
                     throws Exception
Build a processing tree from a Configuration.

Throws:
Exception

build

ProcessingNode build(Source source)
                     throws Exception
Throws:
Exception

getFileName

String getFileName()

getDisposableNodes

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

ProcessingNode setupNode(ProcessingNode node,
                         Configuration config)
                         throws 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).

Throws:
Exception

getTypeForStatement

String getTypeForStatement(Configuration statement,
                           String role)
                           throws 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:
ConfigurationException - if the default type could not be found.

getSitemapComponentManager

ComponentManager getSitemapComponentManager()
Return the sitemap component manager


setAttribute

void setAttribute(String name,
                  Object value)
Add an attribute. Useful to transmit information between distant (in the tree) node builders


getAttribute

Object getAttribute(String name)
Get the value of an attribute.



Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.