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.dialect.postgresql.ast.stmt.PGFunctionTableSource;
17 
18 
19 import hunt.collection;
20 
21 import hunt.sql.ast.SQLExpr;
22 import hunt.sql.ast.SQLParameter;
23 import hunt.sql.ast.statement.SQLExprTableSource;
24 import hunt.sql.dialect.postgresql.ast.PGSQLObject;
25 import hunt.sql.dialect.postgresql.visitor.PGASTVisitor;
26 import hunt.sql.visitor.SQLASTVisitor;
27 import hunt.sql.ast.SQLObject;
28 
29 public class PGFunctionTableSource : SQLExprTableSource , PGSQLObject {
30 
31     private  List!(SQLParameter) parameters;
32 
33     public this(){
34         parameters = new ArrayList!(SQLParameter)();
35     }
36 
37     public this(SQLExpr expr){
38         this();
39         this.expr = expr;
40     }
41 
42     public List!(SQLParameter) getParameters() {
43         return parameters;
44     }
45 
46     
47     override  protected void accept0(SQLASTVisitor visitor) {
48         this.accept0(cast(PGASTVisitor) visitor);
49     }
50 
51     public void accept0(PGASTVisitor visitor) {
52         if (visitor.visit(this)) {
53             acceptChild(visitor, this.expr);
54             acceptChild!SQLParameter(visitor, this.parameters);
55         }
56         visitor.endVisit(this);
57     }
58 }