class MessageKeyVerifier implements IMessageKeyVerifier {

  public List<Cal10nError> verify(Locale locale) {
    List<Cal10nError> errorList = new ArrayList<Cal10nError>();

    String baseName = AnnotationExtractor.getBaseName(enumType);

    if (baseName == null) {
      errorList.add(new Cal10nError(ErrorType.MISSING_BN_ANNOTATION, "",
          enumType, locale, ""));
      // no point in continuing
      return errorList;
    }

    String charset = AnnotationExtractor.getCharset(enumType, Locale.FRENCH);
    ResourceBundle rb = CAL10NResourceBundleFinder.getBundle(this.getClass()
        .getClassLoader(), baseName, locale, charset);

    ErrorFactory errorFactory = new ErrorFactory(enumType, locale, baseName);

    if (rb == null) {
      errorList.add(errorFactory.buildError(ErrorType.FAILED_TO_FIND_RB, ""));
   // no point in continuing
      return errorList;
    }
    
    Set<String> rbKeySet = buildKeySetFromEnumeration(rb.getKeys());

    if (rbKeySet.size() == 0) {
      errorList.add(errorFactory.buildError(ErrorType.EMPTY_RB, ""));
    }

    Enum<?>[] enumArray = enumType.getEnumConstants();
    if (enumArray == null || enumArray.length == 0) {
      errorList.add(errorFactory.buildError(ErrorType.EMPTY_ENUM, ""));
    }

    if (errorList.size() != 0) {
      return errorList;
    }

    for (Enum<?> e : enumArray) {
      String enumKey = e.toString();
      if (rbKeySet.contains(enumKey)) {
        rbKeySet.remove(enumKey);
      } else {
        errorList.add(errorFactory.buildError(ErrorType.ABSENT_IN_RB, enumKey));
      }
    }

    for (String rbKey : rbKeySet) {
      errorList.add(errorFactory.buildError(ErrorType.ABSENT_IN_ENUM, rbKey));
    }
    return errorList;
  }

  public  MessageKeyVerifier(Class<? extends Enum<?>> enumClass);
  @SuppressWarnings("unchecked") public  MessageKeyVerifier(String enumTypeAsStr);

}