// Path: startupheroes-checks/src/main/java/es/startuphero/checkstyle/util/ClassUtils.java
// public static Boolean isEntity(DetailAST classAst, String fullEntityAnnotation) {
//   return AnnotationUtils.hasAnnotation(classAst, fullEntityAnnotation);
// }
// 
// Path: startupheroes-checks/src/main/java/es/startuphero/checkstyle/util/ClassUtils.java
// public static Boolean isExtendsAnotherClass(DetailAST classAst) {
//   return nonNull(classAst.findFirstToken(TokenTypes.EXTENDS_CLAUSE));
// }
// 
// Path: startupheroes-checks/src/main/java/es/startuphero/checkstyle/util/VariableUtils.java
// public static List<String> getVariableNames(DetailAST classAst) {
//   return getVariables(classAst).stream()
//                                .map(VariableUtils::getVariableName)
//                                .collect(toList());
// }


import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
import com.puppycrawl.tools.checkstyle.api.DetailAST;
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import static es.startuphero.checkstyle.util.ClassUtils.isEntity;
import static es.startuphero.checkstyle.util.ClassUtils.isExtendsAnotherClass;
import static es.startuphero.checkstyle.util.VariableUtils.getVariableNames;
package es.startuphero.checkstyle.checks.variable;



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

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

  /**
   * set type annotation to understand that a class is an entity.
   */
  private String typeAnnotation;

  /**
   * set abstract type annotation to understand that a class is abstract.
   */
  private String abstractTypeAnnotation;

  /**
   * set mandatory variables that must exist in each entity.
   */
  private Set<String> mandatoryVariables = new HashSet<>();

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

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

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

  @Override
  public void visitToken(DetailAST ast) {
// Path: startupheroes-checks/src/main/java/es/startuphero/checkstyle/util/ClassUtils.java
// public static Boolean isEntity(DetailAST classAst, String fullEntityAnnotation) {
//   return AnnotationUtils.hasAnnotation(classAst, fullEntityAnnotation);
// }
// 
// Path: startupheroes-checks/src/main/java/es/startuphero/checkstyle/util/ClassUtils.java
// public static Boolean isExtendsAnotherClass(DetailAST classAst) {
//   return nonNull(classAst.findFirstToken(TokenTypes.EXTENDS_CLAUSE));
// }
// 
// Path: startupheroes-checks/src/main/java/es/startuphero/checkstyle/util/VariableUtils.java
// public static List<String> getVariableNames(DetailAST classAst) {
//   return getVariables(classAst).stream()
//                                .map(VariableUtils::getVariableName)
//                                .collect(toList());
// }


// Path: startupheroes-checks/src/main/java/es/startuphero/checkstyle/checks/variable/MissingVariableCheck.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.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import static es.startuphero.checkstyle.util.ClassUtils.isEntity;
import static es.startuphero.checkstyle.util.ClassUtils.isExtendsAnotherClass;
import static es.startuphero.checkstyle.util.VariableUtils.getVariableNames;

package es.startuphero.checkstyle.checks.variable;



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

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

  /**
   * set type annotation to understand that a class is an entity.
   */
  private String typeAnnotation;

  /**
   * set abstract type annotation to understand that a class is abstract.
   */
  private String abstractTypeAnnotation;

  /**
   * set mandatory variables that must exist in each entity.
   */
  private Set<String> mandatoryVariables = new HashSet<>();

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

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

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

  @Override
  public void visitToken(DetailAST ast) {
    if ((isEntity(ast, typeAnnotation) ||