docs: private void checkFactoryClassAndMethod(ClassDescriptorDef classDef, String checkLevel) throws ConstraintException
      {
          if (CHECKLEVEL_NONE.equals(checkLevel))
          {
              return;
          }
          String factoryClassName  = classDef.getProperty(PropertyHelper.OJB_PROPERTY_FACTORY_CLASS);
          String factoryMethodName = classDef.getProperty(PropertyHelper.OJB_PROPERTY_FACTORY_METHOD);
  
          if ((factoryClassName == null) && (factoryMethodName == null))
          {
              return;
          }
          if ((factoryClassName != null) && (factoryMethodName == null))
          {
              throw new ConstraintException("Class "+classDef.getName()+" has a factory-class but no factory-method.");
          }
          if ((factoryClassName == null) && (factoryMethodName != null))
          {
              throw new ConstraintException("Class "+classDef.getName()+" has a factory-method but no factory-class.");
          }
  
          if (CHECKLEVEL_STRICT.equals(checkLevel))
          {    
              Class  factoryClass;
              Method factoryMethod;
      
              try
              {
                  factoryClass = InheritanceHelper.getClass(factoryClassName);
              }
              catch (ClassNotFoundException ex)
              {
                  throw new ConstraintException("The class "+factoryClassName+" specified as factory-class of class "+classDef.getName()+" was not found on the classpath");
              }
              try
              {
                  factoryMethod = factoryClass.getDeclaredMethod(factoryMethodName, new Class[0]);
              }
              catch (NoSuchMethodException ex)
              {
                  factoryMethod = null;
              }
              catch (Exception ex)
              {
                  throw new ConstraintException("Exception while checking the factory-class "+factoryClassName+" of class "+classDef.getName()+": "+ex.getMessage());
              }
              if (factoryMethod == null)
              {    
                  try
                  {
                      factoryMethod = factoryClass.getMethod(factoryMethodName, new Class[0]);
                  }
                  catch (NoSuchMethodException ex)
                  {
                      throw new ConstraintException("No suitable factory-method "+factoryMethodName+" found in the factory-class "+factoryClassName+" of class "+classDef.getName());
                  }
                  catch (Exception ex)
                  {
                      throw new ConstraintException("Exception while checking the factory-class "+factoryClassName+" of class "+classDef.getName()+": "+ex.getMessage());
                  }
              }
      
              // checking return type and modifiers
              Class             returnType = factoryMethod.getReturnType();
              InheritanceHelper helper     = new InheritanceHelper();
      
              if ("void".equals(returnType.getName()))
              {
                  throw new ConstraintException("The factory-method "+factoryMethodName+" in factory-class "+factoryClassName+" of class "+classDef.getName()+" must return a value");
              }
              try
              {
                  if (!helper.isSameOrSubTypeOf(returnType.getName(), classDef.getName()))
                  {
                      throw new ConstraintException("The method "+factoryMethodName+" in factory-class "+factoryClassName+" of class "+classDef.getName()+" must return the type "+classDef.getName()+" or a subtype of it");
                  }
              }
              catch (ClassNotFoundException ex)
              {
                  throw new ConstraintException("Could not find the class "+ex.getMessage()+" on the classpath while checking the factory-method "+factoryMethodName+" in the factory-class "+factoryClassName+" of class "+classDef.getName());
              }
              
              if (!Modifier.isStatic(factoryMethod.getModifiers()))
              {
                  throw new ConstraintException("The factory-method "+factoryMethodName+" in factory-class "+factoryClassName+" of class "+classDef.getName()+" must be static");
              }
          }
      }