org.springframework.extensions.config.source
Class BaseConfigSource

java.lang.Object
  extended by org.springframework.extensions.config.source.BaseConfigSource
All Implemented Interfaces:
ConfigSource
Direct Known Subclasses:
ClassPathConfigSource, FileConfigSource, HTTPConfigSource, JarConfigSource, UrlConfigSource, WebAppConfigSource

public abstract class BaseConfigSource
extends Object
implements ConfigSource

Base class for ConfigSource implementations, provides support for parsing comma separated sources and iterating around them

Author:
gavinc

Constructor Summary
protected BaseConfigSource()
          Default constructor.
protected BaseConfigSource(List<String> sourceStrings)
           
 
Method Summary
protected  void addSourceString(String sourceString)
          Conditionally adds the source to the set of source strings if its trimmed length is greater than 0.
 List<ConfigDeployment> getConfigDeployments()
          Converts all the sources given in the constructor into a list of input streams.
protected abstract  InputStream getInputStream(String sourceString)
          Retrieves an InputStream to the source represented by the given source location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseConfigSource

protected BaseConfigSource()
Default constructor. If this contstructor is used source files must be added using the addSourceString method.


BaseConfigSource

protected BaseConfigSource(List<String> sourceStrings)
Parameters:
sourceStrings - a list of implementation-specific sources. The meaning of the source is particular to the implementation, eg. for a file config source they would be file names.
Method Detail

addSourceString

protected void addSourceString(String sourceString)
Conditionally adds the source to the set of source strings if its trimmed length is greater than 0.


getConfigDeployments

public final List<ConfigDeployment> getConfigDeployments()
Converts all the sources given in the constructor into a list of input streams.

Specified by:
getConfigDeployments in interface ConfigSource
See Also:
getInputStream(String)

getInputStream

protected abstract InputStream getInputStream(String sourceString)
Retrieves an InputStream to the source represented by the given source location. The meaning of the source location will depend on the implementation.

Parameters:
sourceString - the source location
Returns:
Returns an InputStream to the named source location


Copyright © 2009 SpringSource, Inc. All Rights Reserved.