package com.chenyang.druid.sql.dialect.sqlserver.ast.stmt;

import com.chenyang.druid.sql.ast.SQLExpr;
import com.chenyang.druid.sql.ast.SQLName;
import com.chenyang.druid.sql.dialect.sqlserver.ast.SQLServerObjectImpl;
import com.chenyang.druid.sql.dialect.sqlserver.ast.SQLServerStatement;
import com.chenyang.druid.sql.dialect.sqlserver.ast.SQLServerStatementImpl;
import com.chenyang.druid.sql.dialect.sqlserver.visitor.SQLServerASTVisitor;
import java.util.ArrayList;
import java.util.List;

public class SQLServerExecStatement extends SQLServerStatementImpl implements SQLServerStatement {
   private SQLName returnStatus;
   private SQLName moduleName;
   private List<SQLServerParameter> parameters = new ArrayList();

   public SQLName getModuleName() {
      return this.moduleName;
   }

   public void setModuleName(SQLName moduleName) {
      this.moduleName = moduleName;
   }

   public List<SQLServerParameter> getParameters() {
      return this.parameters;
   }

   public void accept0(SQLServerASTVisitor visitor) {
      if (visitor.visit(this)) {
         this.acceptChild(visitor, this.returnStatus);
         this.acceptChild(visitor, this.moduleName);
         this.acceptChild(visitor, this.parameters);
      }

      visitor.endVisit(this);
   }

   public SQLName getReturnStatus() {
      return this.returnStatus;
   }

   public void setReturnStatus(SQLName returnStatus) {
      this.returnStatus = returnStatus;
   }

   public static class SQLServerParameter extends SQLServerObjectImpl {
      private SQLExpr expr;
      private boolean type;

      public SQLExpr getExpr() {
         return this.expr;
      }

      public void setExpr(SQLExpr expr) {
         this.expr = expr;
      }

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

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

      public void accept0(SQLServerASTVisitor visitor) {
         if (visitor.visit(this)) {
            this.acceptChild(visitor, this.expr);
         }

         visitor.endVisit(this);
      }
   }
}
