org.jcreme.enumerations
Class SQLEnumerationInitializer

java.lang.Object
  extended byorg.jcreme.enumerations.SQLEnumerationInitializer
All Implemented Interfaces:
EnumerationInitializer

public class SQLEnumerationInitializer
extends java.lang.Object
implements EnumerationInitializer

This implementation of EnumerationAdaptator enables to load the values from a database. This is achieved through the use of an EnumerationLoader. That loader is specialized for a database system.

Version:
$Revision: 1.2 $
Author:
$Author: dbregeon $

Constructor Summary
SQLEnumerationInitializer(EnumerationLoader loader, java.lang.String databaseURL, java.lang.String userName, java.lang.String password)
          Creates a new instance of BaseEnumerationAdaptator
 
Method Summary
 void loadValues(java.lang.Class enumerationClass)
          This method enables to load the values associated with the given class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLEnumerationInitializer

public SQLEnumerationInitializer(EnumerationLoader loader,
                                 java.lang.String databaseURL,
                                 java.lang.String userName,
                                 java.lang.String password)
                          throws java.lang.IllegalArgumentException
Creates a new instance of BaseEnumerationAdaptator

Parameters:
loader - the database access layer.
databaseURL - the JDBC URL to access the database.
userName - the database login name.
password - the password for the database user.
Throws:
java.lang.IllegalArgumentException - if one of the parameters is null or if the database connection fails.
Method Detail

loadValues

public void loadValues(java.lang.Class enumerationClass)
                throws java.lang.IllegalArgumentException
This method enables to load the values associated with the given class. After a call to this method, the values are available through the usual class methods.

Specified by:
loadValues in interface EnumerationInitializer
Parameters:
enumerationClass - a subclass of the EnumerationClass.
Throws:
java.lang.IllegalArgumentException - if the given class is null, not a subclass of Enumeration or an abstract sublass of Enumeration.


Copyright 2006 null. All Rights Reserved.