// Path: startupheroes-checks/src/main/java/es/startuphero/checkstyle/util/AnnotationUtils.java
// public static List<String> getKeys(DetailAST annotationAst) {
//   List<DetailAST> keyValuePairAstList =
//       CommonUtils.getChildsByType(annotationAst, TokenTypes.ANNOTATION_MEMBER_VALUE_PAIR);
//   return keyValuePairAstList.stream()
//                             .map(keyValuePairAst -> keyValuePairAst.getFirstChild().getText())
//                             .collect(Collectors.toList());
// }
// 
// Path: startupheroes-checks/src/main/java/es/startuphero/checkstyle/util/CommonUtils.java
// public static String getSimpleName(String fullName) {
//   String[] packageNames = fullName.split("\\.");
//   return packageNames[packageNames.length - 1];
// }
// 
// Path: startupheroes-checks/src/main/java/es/startuphero/checkstyle/util/CommonUtils.java
// public static Splitter getSplitterOnComma() {
//   return Splitter.on(",").omitEmptyStrings().trimResults();
// }
// 
// Path: startupheroes-checks/src/main/java/es/startuphero/checkstyle/util/CommonUtils.java
// public static Map<String, String> splitProperty(String property) {
//   return getSplitterOnComma().withKeyValueSeparator(":").split(property);
// }


import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
import com.puppycrawl.tools.checkstyle.api.DetailAST;
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import static es.startuphero.checkstyle.util.AnnotationUtils.getKeys;
import static es.startuphero.checkstyle.util.CommonUtils.getSimpleName;
import static es.startuphero.checkstyle.util.CommonUtils.getSplitterOnComma;
import static es.startuphero.checkstyle.util.CommonUtils.splitProperty;
import static java.util.Objects.nonNull;
package es.startuphero.checkstyle.checks.annotation;



/**
 * @author ozlem.ulag
 */
public class ForbiddenAnnotationKeyCheck extends AbstractCheck {

  /**
   * A key is pointing to the warning message text in "messages.properties" file.
   */
  private static final String MSG_KEY = "forbidden.annotation.key";

  /**
   * set forbidden keys that used inside annotation.
   *
   * annotation -> forbidden keys
   */
  private Map<String, Set<String>> annotationForbiddenKeysMap = new HashMap<>();

  @Override
  public int[] getDefaultTokens() {
    return getAcceptableTokens();
  }

  @Override
  public int[] getAcceptableTokens() {
    return new int[] {TokenTypes.ANNOTATION};
  }

  @Override
  public int[] getRequiredTokens() {
    return getAcceptableTokens();
  }

  @Override
  public void visitToken(DetailAST ast) {
    Set<String> checkedAnnotations = annotationForbiddenKeysMap.keySet();
// Path: startupheroes-checks/src/main/java/es/startuphero/checkstyle/util/AnnotationUtils.java
// public static List<String> getKeys(DetailAST annotationAst) {
//   List<DetailAST> keyValuePairAstList =
//       CommonUtils.getChildsByType(annotationAst, TokenTypes.ANNOTATION_MEMBER_VALUE_PAIR);
//   return keyValuePairAstList.stream()
//                             .map(keyValuePairAst -> keyValuePairAst.getFirstChild().getText())
//                             .collect(Collectors.toList());
// }
// 
// Path: startupheroes-checks/src/main/java/es/startuphero/checkstyle/util/CommonUtils.java
// public static String getSimpleName(String fullName) {
//   String[] packageNames = fullName.split("\\.");
//   return packageNames[packageNames.length - 1];
// }
// 
// Path: startupheroes-checks/src/main/java/es/startuphero/checkstyle/util/CommonUtils.java
// public static Splitter getSplitterOnComma() {
//   return Splitter.on(",").omitEmptyStrings().trimResults();
// }
// 
// Path: startupheroes-checks/src/main/java/es/startuphero/checkstyle/util/CommonUtils.java
// public static Map<String, String> splitProperty(String property) {
//   return getSplitterOnComma().withKeyValueSeparator(":").split(property);
// }


// Path: startupheroes-checks/src/main/java/es/startuphero/checkstyle/checks/annotation/ForbiddenAnnotationKeyCheck.java
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
import com.puppycrawl.tools.checkstyle.api.DetailAST;
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import static es.startuphero.checkstyle.util.AnnotationUtils.getKeys;
import static es.startuphero.checkstyle.util.CommonUtils.getSimpleName;
import static es.startuphero.checkstyle.util.CommonUtils.getSplitterOnComma;
import static es.startuphero.checkstyle.util.CommonUtils.splitProperty;
import static java.util.Objects.nonNull;

package es.startuphero.checkstyle.checks.annotation;



/**
 * @author ozlem.ulag
 */
public class ForbiddenAnnotationKeyCheck extends AbstractCheck {

  /**
   * A key is pointing to the warning message text in "messages.properties" file.
   */
  private static final String MSG_KEY = "forbidden.annotation.key";

  /**
   * set forbidden keys that used inside annotation.
   *
   * annotation -> forbidden keys
   */
  private Map<String, Set<String>> annotationForbiddenKeysMap = new HashMap<>();

  @Override
  public int[] getDefaultTokens() {
    return getAcceptableTokens();
  }

  @Override
  public int[] getAcceptableTokens() {
    return new int[] {TokenTypes.ANNOTATION};
  }

  @Override
  public int[] getRequiredTokens() {
    return getAcceptableTokens();
  }

  @Override
  public void visitToken(DetailAST ast) {
    Set<String> checkedAnnotations = annotationForbiddenKeysMap.keySet();
    String annotationSimpleName = getSimpleName(ast);