consciouscode.seedling.config
Class StandardConfigLayer

java.lang.Object
  extended by consciouscode.seedling.config.StandardConfigLayer
All Implemented Interfaces:
ConfigLayer
Direct Known Subclasses:
MockConfigLayer

public class StandardConfigLayer
extends Object
implements ConfigLayer

A ConfigLayer that reads resources from a ResourceTree, using a ConfigLoader.


Constructor Summary
protected StandardConfigLayer()
           
  StandardConfigLayer(ResourceTree resources, ConfigLoader loader)
           
 
Method Summary
 void collectNodeNames(String branchPath, Collection<String> names)
           
 ConfigLoader getConfigLoader()
           
 Iterable<ConfigResource> getConfigResources(NodeReference nodeRef)
          Finds all configuration resources in this layer that are relevant to a specified node.
 ResourceTree getResourceTree()
           
 URL getResourceUrl(String path)
           
protected  ConfigResource loadConfig(NodePath configPath)
           
protected  ConfigResource loadImplicitBranchConfig(NodePath configPath)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StandardConfigLayer

public StandardConfigLayer(ResourceTree resources,
                           ConfigLoader loader)

StandardConfigLayer

protected StandardConfigLayer()
Method Detail

getResourceTree

public ResourceTree getResourceTree()

getConfigLoader

public ConfigLoader getConfigLoader()

getConfigResources

public Iterable<ConfigResource> getConfigResources(NodeReference nodeRef)
                                            throws ConfigurationException
Description copied from interface: ConfigLayer
Finds all configuration resources in this layer that are relevant to a specified node.

Specified by:
getConfigResources in interface ConfigLayer
Parameters:
nodeRef - identifies the desired node.
Returns:
a sequence of resources, highest priority first. Neither the returned Iterable nor any of its entries may be null.
Throws:
ConfigurationException - if there's a problem loading the relevant configuration resources.

collectNodeNames

public void collectNodeNames(String branchPath,
                             Collection<String> names)
Specified by:
collectNodeNames in interface ConfigLayer
Parameters:
branchPath - must be an absolute path.

getResourceUrl

public URL getResourceUrl(String path)

toString

public String toString()
Overrides:
toString in class Object

loadConfig

protected ConfigResource loadConfig(NodePath configPath)
                             throws ConfigLoadingException
Throws:
ConfigLoadingException

loadImplicitBranchConfig

protected ConfigResource loadImplicitBranchConfig(NodePath configPath)


Copyright © 2001–2012 Todd V. Jonker. All Rights Reserved.