org.sape.carbon.core.config.node
Interface Folder

All Superinterfaces:
Node
All Known Subinterfaces:
FolderLink
All Known Implementing Classes:
AbstractFolder, FolderLinkImpl

public interface Folder
extends Node

A Folder is a Node that contains other Nodes. The central mehtods of this interface provide functionality to add and fetch Nodes contained within a Folder. Copyright 2002 Sapient

Since:
carbon 1.0
Version:
$Revision: 1.13 $($Author: dvoet $ / $Date: 2003/05/05 21:21:18 $)
Author:
Douglas Voet, March 2002

Field Summary
 
Fields inherited from interface org.sape.carbon.core.config.node.Node
DELIMITER
 
Method Summary
 ConfigurationDocument addConfigurationDocument(String name, Configuration config)
          Creates a new child ConfigurationDocument and returns a reference to the newly created ConfigurationDocument.
 LinkNode addLink(String name, LinkNodeConfiguration linkConfiguration)
          Adds a link to the folder.
 Folder addSubFolder(String name)
          Creates a new child Folder and returns a reference to the newly created Folder.
 NodeFactory getConfigurationDocumentFactory()
          Gets the factory this node used in the addConfigurationDocument method to create children.
 NodeFactory getLinkNodeFactory()
          Gets the factory this node used in the addLinkNode method to create children.
 NodeFactory getSubFolderFactory()
          Gets the factory this node used in the addSubFolder method to create children.
 
Methods inherited from interface org.sape.carbon.core.config.node.Node
addNodeListener, addNodeListener, containsChild, fetchChild, fetchChildren, getAbsoluteName, getAllowsChildren, getName, getParent, isRemoved, refresh, remove
 

Method Detail

addConfigurationDocument

public ConfigurationDocument addConfigurationDocument(String name,
                                                      Configuration config)
                                               throws NodeCreationException
Creates a new child ConfigurationDocument and returns a reference to the newly created ConfigurationDocument.

Parameters:
name - Name of the ConfigurationDocument to be created.
config - the document to add to the Folder
Returns:
The newly created ConfigurationDocument.
Throws:
NodeCreationException - when the node can not be created, possibly because the node element already exists in this node, or creation of the node is otherwise forbidden. An exception should also be thrown when this node's getAllowsChildren method returns false.

addSubFolder

public Folder addSubFolder(String name)
                    throws NodeCreationException
Creates a new child Folder and returns a reference to the newly created Folder.

Parameters:
name - Name of the Folder to be created.
Returns:
The newly created Folder.
Throws:
NodeCreationException - when the node can not be created, possibly because the node element already exists in this node, or creation of the node is otherwise forbidden. An exception should also be thrown when this node's getAllowsChildren method returns false.

addLink

public LinkNode addLink(String name,
                        LinkNodeConfiguration linkConfiguration)
                 throws NodeCreationException
Adds a link to the folder.

Parameters:
name - name of the link to add
linkConfiguration - the link configuration to create
Returns:
newly created LinkNode
Throws:
NodeCreationException - indicates an error adding the link

getSubFolderFactory

public NodeFactory getSubFolderFactory()
Gets the factory this node used in the addSubFolder method to create children. This can be used by sub Folders to create their own children.

Returns:
NodeFactory factory object used to create Folders

getConfigurationDocumentFactory

public NodeFactory getConfigurationDocumentFactory()
Gets the factory this node used in the addConfigurationDocument method to create children. This can be used by sub Folders to create their own children.

Returns:
NodeFactory factory object used to create ConfigurationDocuments

getLinkNodeFactory

public NodeFactory getLinkNodeFactory()
Gets the factory this node used in the addLinkNode method to create children. This can be used by sub Folders to create their own children.

Returns:
NodeFactory factory object used to create ConfigurationDocuments


Copyright 1999-2003 Sapient Corporation. All Rights Reserved.