package com.chenyang.druid.sql.ast.statement;

import com.chenyang.druid.DbType;
import com.chenyang.druid.sql.ast.SQLCommentHint;
import com.chenyang.druid.sql.ast.SQLObject;
import com.chenyang.druid.sql.ast.SQLStatement;
import com.chenyang.druid.sql.ast.SQLStatementImpl;
import com.chenyang.druid.sql.visitor.SQLASTVisitor;
import java.util.ArrayList;
import java.util.List;

public class SQLExplainStatement extends SQLStatementImpl {
   protected String type;
   protected String format;
   protected boolean extended;
   protected boolean dependency;
   protected boolean authorization;
   protected boolean optimizer;
   protected SQLStatement statement;
   protected List<SQLCommentHint> hints;
   protected boolean parenthesis;

   public SQLExplainStatement() {
   }

   public SQLExplainStatement(DbType dbType) {
      super(dbType);
   }

   public SQLStatement getStatement() {
      return this.statement;
   }

   public void setStatement(SQLStatement statement) {
      if (statement != null) {
         statement.setParent(this);
      }

      this.statement = statement;
   }

   public String getType() {
      return this.type;
   }

   public void setType(String type) {
      this.type = type;
   }

   protected void accept0(SQLASTVisitor visitor) {
      if (visitor.visit(this)) {
         this.acceptChild(visitor, this.statement);
      }

      visitor.endVisit(this);
   }

   public List<SQLCommentHint> getHints() {
      return this.hints;
   }

   public void setHints(List<SQLCommentHint> hints) {
      this.hints = hints;
   }

   public List<SQLObject> getChildren() {
      List<SQLObject> children = new ArrayList();
      if (this.statement != null) {
         children.add(this.statement);
      }

      return children;
   }

   public boolean isExtended() {
      return this.extended;
   }

   public void setExtended(boolean extended) {
      this.extended = extended;
   }

   public boolean isDependency() {
      return this.dependency;
   }

   public void setDependency(boolean dependency) {
      this.dependency = dependency;
   }

   public boolean isAuthorization() {
      return this.authorization;
   }

   public void setAuthorization(boolean authorization) {
      this.authorization = authorization;
   }

   public boolean isOptimizer() {
      return this.optimizer;
   }

   public void setOptimizer(boolean optimizer) {
      this.optimizer = optimizer;
   }

   public String getFormat() {
      return this.format;
   }

   public void setFormat(String format) {
      this.format = format;
   }

   public boolean isParenthesis() {
      return this.parenthesis;
   }

   public void setParenthesis(boolean parenthesis) {
      this.parenthesis = parenthesis;
   }
}
