org.tubo.configuration.reader
Class AbstractConfigurationReader

java.lang.Object
  extended by org.tubo.configuration.reader.AbstractConfigurationReader
All Implemented Interfaces:
ConfigurationReader
Direct Known Subclasses:
XMLDigesterConfigurationReader

public abstract class AbstractConfigurationReader
extends java.lang.Object
implements ConfigurationReader

Created: Jun 23, 2005 6:36:17 AM Last Modification Date: $Date: 2006-10-19 12:11:35 -0300 (Thu, 19 Oct 2006) $

Version:
$Revision: 17 $
Author:
jvlio (jvlio@users.sourceforge.net)

Field Summary
static java.lang.String RCS_ID
           
 
Constructor Summary
AbstractConfigurationReader()
           
 
Method Summary
 Configuration append(java.io.Reader reader, Configuration config)
          This method append configuration data stored in reader object to config object, replacing duplicated items.
 Configuration append(java.lang.String resource, Configuration config)
          This method append configuration data stored on resource object to config object, replacing duplicated items.
 Configuration append(java.net.URL url, Configuration config)
          This method append configuration data linked by URL to config object, replacing duplicated items.
protected  Configuration createEmptyConfigurationObject()
           
 java.lang.ClassLoader getReaderClassLoader()
           
 Configuration load(java.lang.String resource)
          Create a new Configuration Object based on resource configuration.
protected abstract  Configuration parse(java.io.Reader reader, Configuration config)
          Parse resource and fill configuration object.
protected  Configuration recursiveIncludeAppend(Configuration config)
           
 void setReaderClassLoader(java.lang.ClassLoader classLoader)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RCS_ID

public static final java.lang.String RCS_ID
See Also:
Constant Field Values
Constructor Detail

AbstractConfigurationReader

public AbstractConfigurationReader()
Method Detail

getReaderClassLoader

public java.lang.ClassLoader getReaderClassLoader()
Returns:

setReaderClassLoader

public void setReaderClassLoader(java.lang.ClassLoader classLoader)
Parameters:
classLoader -

load

public Configuration load(java.lang.String resource)
                   throws TuboConfigurationException
Create a new Configuration Object based on resource configuration. This method use createEmptyConfigurationObject to create a new Configuration implementation.

Specified by:
load in interface ConfigurationReader
Parameters:
resource - Configuration Resource
Returns:
A new configuration
Throws:
TuboConfigurationException - If something occurs.

append

public Configuration append(java.lang.String resource,
                            Configuration config)
                     throws TuboConfigurationException
This method append configuration data stored on resource object to config object, replacing duplicated items.

Specified by:
append in interface ConfigurationReader
Parameters:
resource - A class loader resource. see ClassLoader.getResource()
Returns:
config object with resource data append.
Throws:
TuboConfigurationException

append

public Configuration append(java.net.URL url,
                            Configuration config)
                     throws TuboConfigurationException
This method append configuration data linked by URL to config object, replacing duplicated items.

Specified by:
append in interface ConfigurationReader
Parameters:
url - Link to configuration data
Returns:
config object with resource data append.
Throws:
TuboConfigurationException

append

public Configuration append(java.io.Reader reader,
                            Configuration config)
                     throws TuboConfigurationException
This method append configuration data stored in reader object to config object, replacing duplicated items.

Specified by:
append in interface ConfigurationReader
Parameters:
reader -
config -
Returns:
Throws:
TuboConfigurationException

createEmptyConfigurationObject

protected Configuration createEmptyConfigurationObject()
Returns:

recursiveIncludeAppend

protected Configuration recursiveIncludeAppend(Configuration config)
                                        throws TuboConfigurationException
Parameters:
config -
Returns:
Throws:
TuboConfigurationException

parse

protected abstract Configuration parse(java.io.Reader reader,
                                       Configuration config)
                                throws TuboConfigurationException
Parse resource and fill configuration object.

Parameters:
reader - Resource reader
config - Configuration Repository
Returns:
Return the same config object with configuration append.
Throws:
TuboConfigurationException


Copyright © 2004-2007 Tubo. All Rights Reserved.