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

import com.chenyang.druid.sql.ast.SQLExpr;
import com.chenyang.druid.sql.ast.statement.SQLCreateFunctionStatement;
import com.chenyang.druid.sql.ast.statement.SQLDDLStatement;
import com.chenyang.druid.sql.dialect.hive.visitor.HiveASTVisitor;
import com.chenyang.druid.sql.visitor.SQLASTVisitor;

public class HiveCreateFunctionStatement extends SQLCreateFunctionStatement implements SQLDDLStatement {
   protected SQLExpr className;
   protected SQLExpr locationn;
   protected SQLExpr symbol;
   protected ResourceType resourceType;

   public void accept0(SQLASTVisitor visitor) {
      if (visitor instanceof HiveASTVisitor) {
         this.accept0((HiveASTVisitor)visitor);
      } else {
         super.accept0(visitor);
      }

   }

   protected void accept0(HiveASTVisitor visitor) {
      if (visitor.visit(this)) {
         this.acceptChild(visitor, this.name);
         this.acceptChild(visitor, this.className);
         this.acceptChild(visitor, this.locationn);
         this.acceptChild(visitor, this.symbol);
      }

      visitor.endVisit(this);
   }

   public SQLExpr getClassName() {
      return this.className;
   }

   public void setClassName(SQLExpr x) {
      if (x != null) {
         x.setParent(this);
      }

      this.className = x;
   }

   public SQLExpr getLocationn() {
      return this.locationn;
   }

   public void setLocationn(SQLExpr x) {
      if (x != null) {
         x.setParent(this);
      }

      this.locationn = x;
   }

   public SQLExpr getSymbol() {
      return this.symbol;
   }

   public void setSymbol(SQLExpr x) {
      if (x != null) {
         x.setParent(this);
      }

      this.symbol = x;
   }

   public ResourceType getResourceType() {
      return this.resourceType;
   }

   public void setResourceType(ResourceType resourceType) {
      this.resourceType = resourceType;
   }

   public static enum ResourceType {
      JAR,
      FILE,
      ARCHIVE;
   }
}
