org.apache.derbyTesting.functionTests.tests.jdbcapi
Class DataSourceReferenceTest.DataSourceDescriptor

java.lang.Object
  extended by org.apache.derbyTesting.functionTests.tests.jdbcapi.DataSourceReferenceTest.DataSourceDescriptor
Enclosing class:
DataSourceReferenceTest

private static class DataSourceReferenceTest.DataSourceDescriptor
extends java.lang.Object

A class describing the bean properties of a data source.

A data source is a class implementing javax.sql.CommonDataSource.

The data source description consists of the following:

In addition it has a name for convenience.


Field Summary
private  java.lang.String dsName
          Name of the description.
private  java.util.Properties propertyDefaults
          Default values for bean properties having a default.
private  java.util.Properties propertyValues
          Set values for the data source being described.
 
Constructor Summary
DataSourceReferenceTest.DataSourceDescriptor(java.lang.String dsName)
          Creates a new data source description.
DataSourceReferenceTest.DataSourceDescriptor(java.lang.String dsName, DataSourceReferenceTest.DataSourceDescriptor copyFrom)
          Creates a new data source description, based off an existing description.
 
Method Summary
(package private)  void addProperty(java.lang.String name, java.lang.String value)
          Adds a property to the description, with a value and no associated default value.
(package private)  void addProperty(java.lang.String name, java.lang.String value, java.lang.String defaultValue)
          Adds a property to the description, with a value and an associated default value.
(package private)  java.lang.String getName()
          Returns the convenience name of this descriptor.
(package private)  int getPropertyCount()
          Returns the number of bean properties defined by this descriptor.
(package private)  java.lang.String getPropertyDefault(java.lang.String name)
          Returns the default value for the specified property.
(package private)  java.util.Iterator getPropertyIterator()
          Returns an iterator over all bean property names.
(package private)  java.lang.String getPropertyValue(java.lang.String name)
          Returns the value of the specified property.
(package private)  boolean hasProperty(java.lang.String name)
          Tells if the specified property is defined by this descriptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dsName

private final java.lang.String dsName
Name of the description.


propertyValues

private final java.util.Properties propertyValues
Set values for the data source being described.

Note that the keys of this property object describe which bean properties exist for the data source.


propertyDefaults

private final java.util.Properties propertyDefaults
Default values for bean properties having a default.

Note that not all properties have a default, and the data source may therefore have more properties than there entries in this list of properties.

Constructor Detail

DataSourceReferenceTest.DataSourceDescriptor

DataSourceReferenceTest.DataSourceDescriptor(java.lang.String dsName)
Creates a new data source description.

Parameters:
dsName - convenience name for the description/source

DataSourceReferenceTest.DataSourceDescriptor

DataSourceReferenceTest.DataSourceDescriptor(java.lang.String dsName,
                                             DataSourceReferenceTest.DataSourceDescriptor copyFrom)
Creates a new data source description, based off an existing description.

All properties and values defined in the existing descriptor will also be defined in the new descriptor.

Parameters:
dsName - convenience name for the description/source
copyFrom - existing descriptor to copy properties/values from
Method Detail

getName

java.lang.String getName()
Returns the convenience name of this descriptor.

Returns:
A convenience name.

addProperty

void addProperty(java.lang.String name,
                 java.lang.String value)
Adds a property to the description, with a value and no associated default value.

Parameters:
name - property name
value - property value
Throws:
java.lang.NullPointerException - if name or value is null

addProperty

void addProperty(java.lang.String name,
                 java.lang.String value,
                 java.lang.String defaultValue)
Adds a property to the description, with a value and an associated default value.

Parameters:
name - property name
value - property value
defaultValue - default property value
Throws:
java.lang.NullPointerException - if name, value or defaultValue is null

getPropertyValue

java.lang.String getPropertyValue(java.lang.String name)
Returns the value of the specified property.

Parameters:
name - property name
Returns:
The value set for this property.
Throws:
java.lang.NullPointerException - if name is null
AssertionFailedError - if the property name is not defined by this descriptor

getPropertyDefault

java.lang.String getPropertyDefault(java.lang.String name)
Returns the default value for the specified property.

Parameters:
name - property name
Returns:
The default value if specified, null if a default value is not specified.
Throws:
java.lang.NullPointerException - if name is null
AssertionFailedError - if the property name is not defined by this descriptor

getPropertyIterator

java.util.Iterator getPropertyIterator()
Returns an iterator over all bean property names.

Returns:
An iterator.

hasProperty

boolean hasProperty(java.lang.String name)
Tells if the specified property is defined by this descriptor.

Parameters:
name - property name
Returns:
true if defined, false if not.

getPropertyCount

int getPropertyCount()
Returns the number of bean properties defined by this descriptor.

Returns:
The number of bean properties.

Built on Sat 2009-11-28 18:44:18-0800, from revision 885187

Apache Derby V10.6 Internals - Copyright © 2004,2008 The Apache Software Foundation. All Rights Reserved.