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.SQLAlterTableConvertCharSet; 17 18 import hunt.sql.ast.SQLExpr; 19 import hunt.sql.ast.SQLObjectImpl; 20 import hunt.sql.visitor.SQLASTVisitor; 21 import hunt.sql.ast.statement.SQLAlterTableItem; 22 23 public class SQLAlterTableConvertCharSet : SQLObjectImpl , SQLAlterTableItem { 24 25 private SQLExpr charset; 26 private SQLExpr collate; 27 28 public this() { 29 30 } 31 32 public SQLExpr getCharset() { 33 return charset; 34 } 35 36 public void setCharset(SQLExpr charset) { 37 if (charset !is null) { 38 charset.setParent(this); 39 } 40 this.charset = charset; 41 } 42 43 public SQLExpr getCollate() { 44 return collate; 45 } 46 47 public void setCollate(SQLExpr collate) { 48 if (collate !is null) { 49 collate.setParent(this); 50 } 51 this.collate = collate; 52 } 53 54 override protected void accept0(SQLASTVisitor visitor) { 55 if (visitor.visit(this)) { 56 acceptChild(visitor, charset); 57 acceptChild(visitor, collate); 58 } 59 visitor.endVisit(this); 60 } 61 62 }