consciouscode.seedling.config
Class ConfigLoaderSequence
java.lang.Object
consciouscode.seedling.config.ConfigLoaderSequence
- All Implemented Interfaces:
- ConfigLoader
public class ConfigLoaderSequence
- extends Object
- implements ConfigLoader
A composite ConfigLoader
that attempts loading a node's
ConfigResource
from each child loader in sequence.
Only the first successful resource is returned.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConfigLoaderSequence
public ConfigLoaderSequence()
ConfigLoaderSequence
public ConfigLoaderSequence(ConfigLoader... loaders)
getLoaders
public ConfigLoader[] getLoaders()
addLoader
public void addLoader(ConfigLoader loader)
loadConfigResource
public ConfigResource loadConfigResource(ResourceTree resources,
NodePath fullPath)
throws ConfigLoadingException
- Description copied from interface:
ConfigLoader
- Returns a configuration resource for a specified node, if one exists in
the given resource tree.
- Specified by:
loadConfigResource
in interface ConfigLoader
fullPath
- identifies the desired node. It must be a full path.
- Returns:
null
if no configuration resource exists for the
node within the resource tree.
- Throws:
ConfigLoadingException
nodeNameForResource
public String nodeNameForResource(String resourceName)
- Determines whether the given resource will be used to configure a node,
and if so, returns the name of the node.
Typically a resource must have an extension recognized by one of this
factory's
ConfigLoader
s.
- Specified by:
nodeNameForResource
in interface ConfigLoader
- Parameters:
resourceName
- name of a file that may configure a node.
- Returns:
- the node name, or
null
if the resource won't configure
a node.
Copyright © 2001–2012
Todd V. Jonker. All Rights Reserved.