code: public Class getClass(String key, Class defaultValue, Class[] assignables)
      {
          String className = properties.getProperty(key);
  
          if (className == null)
          {
          	if (defaultValue == null)
          	{
          		logger.info("No value for key '" + key + "'");
                  return null;
          	}
          	else
          	{
  	            className = defaultValue.getName();
  	            properties.put(key, className);
  	            logger.debug("No value for key \"" + key + "\", using default "
  	                    + className + ".");
  	            return defaultValue;
          	}
          }
  
          Class clazz = null;
          try
          {
              clazz = ClassHelper.getClass(className);
          }
          catch (ClassNotFoundException e)
          {
              clazz = defaultValue;
              logger.warn(
                      "Value \""
                      + className
                      + "\" is illegal for key \""
                      + key
                      + "\" (should be a class, using default value "
                      + defaultValue
                      + ")", e);
          }
  
          for (int i = 0; i < assignables.length; i++)
          {
              Class assignable = assignables[i];
              if (!assignable.isAssignableFrom(clazz))
              {
                  String extendsOrImplements;
                  if (assignable.isInterface())
                  {
                      extendsOrImplements = "implement the interface ";
                  }
                  else
                  {
                      extendsOrImplements = "extend the class ";
  
                  }
                  logger.error(
                          "The specified class \""
                          + className
                          + "\" does not "
                          + extendsOrImplements
                          + assignables[i].getName()
                          + ", which is a requirement for the key \""
                          + key
                          + "\". Using default class "
                          + defaultValue);
                  clazz = defaultValue;
              }
  
          }
  
          return clazz;
      }
docs: Returns the class specified by the value for the specified key. If no
  value for this key is found in the configuration, no class of this name
  can be found or the specified class is not assignable to each
  class/interface in <code>assignables defaultValue</code> is returned.
  
  @param key the key
  @param defaultValue the default Value
  @param assignables classes and/or interfaces the specified class must
  extend/implement.
  @return the value for the key, or <code>defaultValue</code>