code: public void scan(String classNamePattern, SaveHandler saveHandler) throws IOException {
          if (classNamePattern == null) {
              throw new IllegalArgumentException("classNamePattern must not be null");
          }
  
          classNamePattern = classNamePattern.replace(PACKAGE_SEPARATOR_CHAR, REGULAR_FILE_SEPARATOR_CHAR);
          String basePackageName = determineBasePackageName(classNamePattern);
          if (basePackageName == null) {
              return;
          }
  
          String subPattern;
          if (classNamePattern.length() > basePackageName.length()) {
              subPattern = classNamePattern.substring(basePackageName.length());
          } else {
              subPattern = StringUtils.EMPTY;
          }
  
          WildcardPattern pattern = WildcardPattern.compile(subPattern, REGULAR_FILE_SEPARATOR_CHAR);
          WildcardMatcher matcher = new WildcardMatcher(pattern);
  
          Enumeration<URL> resources = classLoader.getResources(basePackageName);
  
          if (!StringUtils.endsWith(basePackageName, REGULAR_FILE_SEPARATOR_CHAR)) {
              basePackageName += REGULAR_FILE_SEPARATOR_CHAR;
          }
  
          while (resources.hasMoreElements()) {
              URL resource = resources.nextElement();
  
              if (log.isDebugEnabled()) {
                  log.debug("Scanning for components in path: " + resource.getFile());
              }
  
              if (isJarResource(resource)) {
                  scanFromJarResource(resource, matcher, saveHandler);
              } else {
                  scan(resource.getFile(), basePackageName, null, matcher, saveHandler);
              }
          }
      }
docs: Find all classes that match the class name pattern.
  
  @param classNamePattern the class name pattern
  @param saveHandler the save handler
  @throws IOException if an I/O error has occurred