1 /* 2 * Copyright 2015-2018 HuntLabs.cn 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 module hunt.sql.ast.statement.SQLDropServerStatement; 17 18 import hunt.sql.ast.SQLExpr; 19 import hunt.sql.ast.SQLObject; 20 import hunt.sql.ast.SQLStatementImpl; 21 import hunt.sql.visitor.SQLASTVisitor; 22 import hunt.sql.ast.statement.SQLDropStatement; 23 24 25 import hunt.collection; 26 27 public class SQLDropServerStatement : SQLStatementImpl , SQLDropStatement { 28 29 private SQLExpr name; 30 private bool ifExists; 31 32 public this() { 33 34 } 35 36 public this(string dbType) { 37 super (dbType); 38 } 39 40 41 override protected void accept0(SQLASTVisitor visitor) { 42 if (visitor.visit(this)) { 43 acceptChild(visitor, name); 44 } 45 visitor.endVisit(this); 46 } 47 48 public SQLExpr getName() { 49 return name; 50 } 51 52 public void setName(SQLExpr x) { 53 if (x !is null) { 54 x.setParent(this); 55 } 56 this.name = x; 57 } 58 59 override 60 public List!SQLObject getChildren() { 61 List!SQLObject children = new ArrayList!SQLObject(); 62 if (name !is null) { 63 children.add(name); 64 } 65 return children; 66 } 67 68 public bool isIfExists() { 69 return ifExists; 70 } 71 72 public void setIfExists(bool ifExists) { 73 this.ifExists = ifExists; 74 } 75 }