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

import com.alibaba.druid.sql.ast.SQLExpr;
import com.alibaba.druid.sql.ast.SQLHint;
import com.alibaba.druid.sql.ast.SQLObjectImpl;
import com.alibaba.druid.sql.visitor.SQLASTVisitor;

public class SQLExprHint extends SQLObjectImpl implements SQLHint {
   private SQLExpr expr;

   public SQLExprHint() {
   }

   public SQLExprHint(SQLExpr expr) {
      this.setExpr(expr);
   }

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

   public void setExpr(SQLExpr expr) {
      if (expr != null) {
         expr.setParent(this);
      }

      this.expr = expr;
   }

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

      visitor.endVisit(this);
   }

   public SQLExprHint clone() {
      SQLExprHint x = new SQLExprHint();
      if (this.expr != null) {
         x.setExpr(this.expr.clone());
      }

      return x;
   }
}
