private static class DataSourceReferenceTest.DataSourceDescriptor
extends java.lang.Object
A data source is a class implementing
javax.sql.CommonDataSource
.
The data source description consists of the following:
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
DataSourceDescriptor(java.lang.String dsName)
Creates a new data source description.
|
DataSourceDescriptor(java.lang.String dsName,
DataSourceReferenceTest.DataSourceDescriptor copyFrom)
Creates a new data source description, based off an existing
description.
|
Modifier and Type | Method and Description |
---|---|
(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.
|
private final java.lang.String dsName
private final java.util.Properties propertyValues
Note that the keys of this property object describe which bean properties exist for the data source.
private final java.util.Properties propertyDefaults
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.
DataSourceDescriptor(java.lang.String dsName)
dsName
- convenience name for the description/sourceDataSourceDescriptor(java.lang.String dsName, DataSourceReferenceTest.DataSourceDescriptor copyFrom)
All properties and values defined in the existing descriptor will also be defined in the new descriptor.
dsName
- convenience name for the description/sourcecopyFrom
- existing descriptor to copy properties/values fromjava.lang.String getName()
void addProperty(java.lang.String name, java.lang.String value)
name
- property namevalue
- property valuejava.lang.NullPointerException
- if name
or
value
is null
void addProperty(java.lang.String name, java.lang.String value, java.lang.String defaultValue)
name
- property namevalue
- property valuedefaultValue
- default property valuejava.lang.NullPointerException
- if name
, value
or defaultValue
is null
java.lang.String getPropertyValue(java.lang.String name)
name
- property namejava.lang.NullPointerException
- if name
is
null
AssertionFailedError
- if the property name is not defined by
this descriptorjava.lang.String getPropertyDefault(java.lang.String name)
name
- property namenull if a default
value is not specified.
java.lang.NullPointerException
- if name
is
null
AssertionFailedError
- if the property name is not defined by
this descriptorjava.util.Iterator getPropertyIterator()
boolean hasProperty(java.lang.String name)
name
- property nametrue
if defined, false
if not.int getPropertyCount()
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.