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

import com.chenyang.druid.sql.ast.SQLName;
import com.chenyang.druid.sql.ast.SQLObject;
import com.chenyang.druid.sql.ast.SQLStatementImpl;
import com.chenyang.druid.sql.ast.expr.SQLIdentifierExpr;
import com.chenyang.druid.sql.visitor.SQLASTVisitor;
import java.util.Collections;
import java.util.List;

public class SQLCloseStatement extends SQLStatementImpl {
   private SQLName cursorName;

   public SQLName getCursorName() {
      return this.cursorName;
   }

   public void setCursorName(String cursorName) {
      this.setCursorName((SQLName)(new SQLIdentifierExpr(cursorName)));
   }

   public void setCursorName(SQLName cursorName) {
      if (cursorName != null) {
         cursorName.setParent(this);
      }

      this.cursorName = cursorName;
   }

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

      visitor.endVisit(this);
   }

   public List<SQLObject> getChildren() {
      return Collections.emptyList();
   }
}
