Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Shardingsphere
提交
666c1e2a
Shardingsphere
项目概览
apache
/
Shardingsphere
通知
56
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Shardingsphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
666c1e2a
编写于
10月 22, 2020
作者:
J
Juan Pan(Trista)
提交者:
GitHub
10月 22, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refactor FormatSQLVisitorFacade (#7887)
上级
dca16847
变更
41
隐藏空白更改
内联
并排
Showing
41 changed file
with
1101 addition
and
40 deletion
+1101
-40
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/MySQLParserConfiguration.java
...dingsphere/sql/parser/mysql/MySQLParserConfiguration.java
+4
-4
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/MySQLSQLVisitorFacade.java
...phere/sql/parser/mysql/visitor/MySQLSQLVisitorFacade.java
+40
-0
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/format/MySQLFormatSQLVisitor.java
...ql/parser/mysql/visitor/format/MySQLFormatSQLVisitor.java
+29
-0
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/format/MySQLFormatSQLVisitorFacade.java
...ser/mysql/visitor/format/MySQLFormatSQLVisitorFacade.java
+68
-0
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/format/impl/MySQLDALFormatSQLVisitor.java
...r/mysql/visitor/format/impl/MySQLDALFormatSQLVisitor.java
+27
-0
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/format/impl/MySQLDCLFormatSQLVisitor.java
...r/mysql/visitor/format/impl/MySQLDCLFormatSQLVisitor.java
+27
-0
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/format/impl/MySQLDDLFormatSQLVisitor.java
...r/mysql/visitor/format/impl/MySQLDDLFormatSQLVisitor.java
+27
-0
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/format/impl/MySQLDMLFormatSQLVisitor.java
...r/mysql/visitor/format/impl/MySQLDMLFormatSQLVisitor.java
+27
-0
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/format/impl/MySQLRLFormatSQLVisitor.java
...er/mysql/visitor/format/impl/MySQLRLFormatSQLVisitor.java
+27
-0
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/format/impl/MySQLTCLFormatSQLVisitor.java
...r/mysql/visitor/format/impl/MySQLTCLFormatSQLVisitor.java
+27
-0
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/OracleParserConfiguration.java
...ngsphere/sql/parser/oracle/OracleParserConfiguration.java
+4
-4
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/OracleSQLVisitorFacade.java
...ere/sql/parser/oracle/visitor/OracleSQLVisitorFacade.java
+40
-0
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/format/OracleFormatSQLVisitorFacade.java
...r/oracle/visitor/format/OracleFormatSQLVisitorFacade.java
+62
-0
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementSQLVisitorFacade.java
...le/visitor/statement/OracleStatementSQLVisitorFacade.java
+1
-1
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/PostgreSQLParserConfiguration.java
.../sql/parser/postgresql/PostgreSQLParserConfiguration.java
+4
-4
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/PostgreSQLSQLVisitorFacade.java
...parser/postgresql/visitor/PostgreSQLSQLVisitorFacade.java
+40
-0
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/format/PostgreSQLFormatSQLVisitorFacade.java
...esql/visitor/format/PostgreSQLFormatSQLVisitorFacade.java
+62
-0
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementSQLVisitorFacade.java
...isitor/statement/PostgreSQLStatementSQLVisitorFacade.java
+1
-1
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/sql92/SQL92ParserConfiguration.java
...dingsphere/sql/parser/sql92/SQL92ParserConfiguration.java
+4
-4
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/sql92/visitor/SQL92SQLVisitorFacade.java
...phere/sql/parser/sql92/visitor/SQL92SQLVisitorFacade.java
+40
-0
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/sql92/visitor/format/SQL92FormatSQLVisitorFacade.java
...ser/sql92/visitor/format/SQL92FormatSQLVisitorFacade.java
+62
-0
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementSQLVisitorFacade.java
...l92/visitor/statement/SQL92StatementSQLVisitorFacade.java
+1
-1
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/SQLServerParserConfiguration.java
...re/sql/parser/sqlserver/SQLServerParserConfiguration.java
+4
-4
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/visitor/SQLServerSQLVisitorFacade.java
...l/parser/sqlserver/visitor/SQLServerSQLVisitorFacade.java
+40
-0
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/visitor/format/SQLServerFormatSQLVisitorFacade.java
...erver/visitor/format/SQLServerFormatSQLVisitorFacade.java
+62
-0
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementSQLVisitorFacade.java
...visitor/statement/SQLServerStatementSQLVisitorFacade.java
+1
-1
shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/visitor/SQLVisitorRule.java
...hardingsphere/sql/parser/core/visitor/SQLVisitorRule.java
+4
-4
shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/visitor/format/FormatSQLVisitorFactory.java
...l/parser/core/visitor/format/FormatSQLVisitorFactory.java
+69
-0
shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/visitor/statement/StatementSQLVisitorFactory.java
...er/core/visitor/statement/StatementSQLVisitorFactory.java
+6
-4
shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/engine/statement/standard/StandardSQLParserEngine.java
...er/engine/statement/standard/StandardSQLParserEngine.java
+2
-2
shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/test/java/org/apache/shardingsphere/sql/parser/core/visitor/SQLVisitorRuleTest.java
...ingsphere/sql/parser/core/visitor/SQLVisitorRuleTest.java
+3
-4
shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/SQLVisitorFacade.java
...ardingsphere/sql/parser/api/visitor/SQLVisitorFacade.java
+41
-0
shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/SQLVisitorType.java
...shardingsphere/sql/parser/api/visitor/SQLVisitorType.java
+26
-0
shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/format/FormatSQLVisitorFacade.java
...sql/parser/api/visitor/format/FormatSQLVisitorFacade.java
+73
-0
shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/format/impl/DALFormatSQLVisitor.java
...l/parser/api/visitor/format/impl/DALFormatSQLVisitor.java
+24
-0
shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/format/impl/DCLFormatSQLVisitor.java
...l/parser/api/visitor/format/impl/DCLFormatSQLVisitor.java
+24
-0
shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/format/impl/DDLFormatSQLVisitor.java
...l/parser/api/visitor/format/impl/DDLFormatSQLVisitor.java
+24
-0
shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/format/impl/DMLFormatSQLVisitor.java
...l/parser/api/visitor/format/impl/DMLFormatSQLVisitor.java
+24
-0
shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/format/impl/RLFormatSQLVisitor.java
...ql/parser/api/visitor/format/impl/RLFormatSQLVisitor.java
+24
-0
shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/format/impl/TCLFormatSQLVisitor.java
...l/parser/api/visitor/format/impl/TCLFormatSQLVisitor.java
+24
-0
shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/spi/SQLParserConfiguration.java
...shardingsphere/sql/parser/spi/SQLParserConfiguration.java
+2
-2
未找到文件。
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/MySQLParserConfiguration.java
浏览文件 @
666c1e2a
...
...
@@ -19,10 +19,10 @@ package org.apache.shardingsphere.sql.parser.mysql;
import
org.apache.shardingsphere.sql.parser.api.lexer.SQLLexer
;
import
org.apache.shardingsphere.sql.parser.api.parser.SQLParser
;
import
org.apache.shardingsphere.sql.parser.api.visitor.
statement.Statement
SQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.mysql.lexer.MySQLLexer
;
import
org.apache.shardingsphere.sql.parser.mysql.parser.MySQLParser
;
import
org.apache.shardingsphere.sql.parser.mysql.visitor.
statement.MySQLStatement
SQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.mysql.visitor.
MySQL
SQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.spi.SQLParserConfiguration
;
/**
...
...
@@ -46,7 +46,7 @@ public final class MySQLParserConfiguration implements SQLParserConfiguration {
}
@Override
public
Class
<?
extends
S
tatementS
QLVisitorFacade
>
getVisitorFacadeClass
()
{
return
MySQLS
tatementS
QLVisitorFacade
.
class
;
public
Class
<?
extends
SQLVisitorFacade
>
getVisitorFacadeClass
()
{
return
MySQLSQLVisitorFacade
.
class
;
}
}
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/MySQLSQLVisitorFacade.java
0 → 100644
浏览文件 @
666c1e2a
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.mysql.visitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.FormatSQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.api.visitor.statement.StatementSQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.mysql.visitor.format.MySQLFormatSQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.MySQLStatementSQLVisitorFacade
;
/**
* MySQL SQL visitor facade.
*/
public
final
class
MySQLSQLVisitorFacade
implements
SQLVisitorFacade
{
@Override
public
Class
<?
extends
StatementSQLVisitorFacade
>
getStatementSQLVisitorFacadeClass
()
{
return
MySQLStatementSQLVisitorFacade
.
class
;
}
@Override
public
Class
<?
extends
FormatSQLVisitorFacade
>
getFormatSQLVisitorFacadeClass
()
{
return
MySQLFormatSQLVisitorFacade
.
class
;
}
}
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/format/MySQLFormatSQLVisitor.java
0 → 100644
浏览文件 @
666c1e2a
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.mysql.visitor.format
;
import
lombok.AccessLevel
;
import
lombok.Getter
;
import
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementBaseVisitor
;
/**
* MySQL Format SQL visitor.
*/
@Getter
(
AccessLevel
.
PROTECTED
)
public
abstract
class
MySQLFormatSQLVisitor
extends
MySQLStatementBaseVisitor
<
String
>
{
}
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/format/MySQLFormatSQLVisitorFacade.java
0 → 100644
浏览文件 @
666c1e2a
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.mysql.visitor.format
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.FormatSQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.DALFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.DCLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.DDLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.DMLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.RLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.TCLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.mysql.visitor.format.impl.MySQLDALFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.mysql.visitor.format.impl.MySQLDCLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.mysql.visitor.format.impl.MySQLDDLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.mysql.visitor.format.impl.MySQLDMLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.mysql.visitor.format.impl.MySQLRLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.mysql.visitor.format.impl.MySQLTCLFormatSQLVisitor
;
/**
* Format SQL Visitor facade for MySQL.
*/
public
final
class
MySQLFormatSQLVisitorFacade
implements
FormatSQLVisitorFacade
{
@Override
public
Class
<?
extends
DMLFormatSQLVisitor
>
getDMLVisitorClass
()
{
return
MySQLDMLFormatSQLVisitor
.
class
;
}
@Override
public
Class
<?
extends
DDLFormatSQLVisitor
>
getDDLVisitorClass
()
{
return
MySQLDDLFormatSQLVisitor
.
class
;
}
@Override
public
Class
<?
extends
TCLFormatSQLVisitor
>
getTCLVisitorClass
()
{
return
MySQLTCLFormatSQLVisitor
.
class
;
}
@Override
public
Class
<?
extends
DCLFormatSQLVisitor
>
getDCLVisitorClass
()
{
return
MySQLDCLFormatSQLVisitor
.
class
;
}
@Override
public
Class
<?
extends
DALFormatSQLVisitor
>
getDALVisitorClass
()
{
return
MySQLDALFormatSQLVisitor
.
class
;
}
@Override
public
Class
<?
extends
RLFormatSQLVisitor
>
getRLVisitorClass
()
{
return
MySQLRLFormatSQLVisitor
.
class
;
}
}
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/format/impl/MySQLDALFormatSQLVisitor.java
0 → 100644
浏览文件 @
666c1e2a
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.mysql.visitor.format.impl
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.DALFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.mysql.visitor.format.MySQLFormatSQLVisitor
;
/**
* DAL Format SQL visitor for MySQL.
*/
public
final
class
MySQLDALFormatSQLVisitor
extends
MySQLFormatSQLVisitor
implements
DALFormatSQLVisitor
{
}
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/format/impl/MySQLDCLFormatSQLVisitor.java
0 → 100644
浏览文件 @
666c1e2a
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.mysql.visitor.format.impl
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.DCLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.mysql.visitor.format.MySQLFormatSQLVisitor
;
/**
* DCL Format SQL visitor for MySQL.
*/
public
final
class
MySQLDCLFormatSQLVisitor
extends
MySQLFormatSQLVisitor
implements
DCLFormatSQLVisitor
{
}
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/format/impl/MySQLDDLFormatSQLVisitor.java
0 → 100644
浏览文件 @
666c1e2a
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.mysql.visitor.format.impl
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.DDLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.mysql.visitor.format.MySQLFormatSQLVisitor
;
/**
* DDL Format SQL visitor for MySQL.
*/
public
final
class
MySQLDDLFormatSQLVisitor
extends
MySQLFormatSQLVisitor
implements
DDLFormatSQLVisitor
{
}
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/format/impl/MySQLDMLFormatSQLVisitor.java
0 → 100644
浏览文件 @
666c1e2a
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.mysql.visitor.format.impl
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.DMLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.mysql.visitor.format.MySQLFormatSQLVisitor
;
/**
* DML Format SQL visitor for MySQL.
*/
public
final
class
MySQLDMLFormatSQLVisitor
extends
MySQLFormatSQLVisitor
implements
DMLFormatSQLVisitor
{
}
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/format/impl/MySQLRLFormatSQLVisitor.java
0 → 100644
浏览文件 @
666c1e2a
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.mysql.visitor.format.impl
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.RLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.mysql.visitor.format.MySQLFormatSQLVisitor
;
/**
* RL Format SQL visitor for MySQL.
*/
public
final
class
MySQLRLFormatSQLVisitor
extends
MySQLFormatSQLVisitor
implements
RLFormatSQLVisitor
{
}
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/format/impl/MySQLTCLFormatSQLVisitor.java
0 → 100644
浏览文件 @
666c1e2a
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.mysql.visitor.format.impl
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.TCLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.mysql.visitor.format.MySQLFormatSQLVisitor
;
/**
* TCL Format SQL visitor for MySQL.
*/
public
final
class
MySQLTCLFormatSQLVisitor
extends
MySQLFormatSQLVisitor
implements
TCLFormatSQLVisitor
{
}
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/OracleParserConfiguration.java
浏览文件 @
666c1e2a
...
...
@@ -19,10 +19,10 @@ package org.apache.shardingsphere.sql.parser.oracle;
import
org.apache.shardingsphere.sql.parser.api.lexer.SQLLexer
;
import
org.apache.shardingsphere.sql.parser.api.parser.SQLParser
;
import
org.apache.shardingsphere.sql.parser.api.visitor.
statement.Statement
SQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.oracle.lexer.OracleLexer
;
import
org.apache.shardingsphere.sql.parser.oracle.parser.OracleParser
;
import
org.apache.shardingsphere.sql.parser.oracle.visitor.OracleS
tatementS
QLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.oracle.visitor.OracleSQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.spi.SQLParserConfiguration
;
/**
...
...
@@ -46,7 +46,7 @@ public final class OracleParserConfiguration implements SQLParserConfiguration {
}
@Override
public
Class
<?
extends
S
tatementS
QLVisitorFacade
>
getVisitorFacadeClass
()
{
return
OracleS
tatementS
QLVisitorFacade
.
class
;
public
Class
<?
extends
SQLVisitorFacade
>
getVisitorFacadeClass
()
{
return
OracleSQLVisitorFacade
.
class
;
}
}
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/OracleSQLVisitorFacade.java
0 → 100644
浏览文件 @
666c1e2a
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.oracle.visitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.FormatSQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.api.visitor.statement.StatementSQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.oracle.visitor.format.OracleFormatSQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.oracle.visitor.statement.OracleStatementSQLVisitorFacade
;
/**
* Oracle SQL visitor facade.
*/
public
final
class
OracleSQLVisitorFacade
implements
SQLVisitorFacade
{
@Override
public
Class
<?
extends
StatementSQLVisitorFacade
>
getStatementSQLVisitorFacadeClass
()
{
return
OracleStatementSQLVisitorFacade
.
class
;
}
@Override
public
Class
<?
extends
FormatSQLVisitorFacade
>
getFormatSQLVisitorFacadeClass
()
{
return
OracleFormatSQLVisitorFacade
.
class
;
}
}
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/format/OracleFormatSQLVisitorFacade.java
0 → 100644
浏览文件 @
666c1e2a
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.oracle.visitor.format
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.FormatSQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.DALFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.DCLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.DDLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.DMLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.RLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.TCLFormatSQLVisitor
;
/**
* Format SQL Visitor facade for MySQL.
*/
public
final
class
OracleFormatSQLVisitorFacade
implements
FormatSQLVisitorFacade
{
@Override
public
Class
<?
extends
DMLFormatSQLVisitor
>
getDMLVisitorClass
()
{
throw
new
UnsupportedOperationException
();
}
@Override
public
Class
<?
extends
DDLFormatSQLVisitor
>
getDDLVisitorClass
()
{
throw
new
UnsupportedOperationException
();
}
@Override
public
Class
<?
extends
TCLFormatSQLVisitor
>
getTCLVisitorClass
()
{
throw
new
UnsupportedOperationException
();
}
@Override
public
Class
<?
extends
DCLFormatSQLVisitor
>
getDCLVisitorClass
()
{
throw
new
UnsupportedOperationException
();
}
@Override
public
Class
<?
extends
DALFormatSQLVisitor
>
getDALVisitorClass
()
{
throw
new
UnsupportedOperationException
();
}
@Override
public
Class
<?
extends
RLFormatSQLVisitor
>
getRLVisitorClass
()
{
throw
new
UnsupportedOperationException
();
}
}
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/OracleStatementSQLVisitorFacade.java
→
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/
statement/
OracleStatementSQLVisitorFacade.java
浏览文件 @
666c1e2a
...
...
@@ -15,7 +15,7 @@
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.oracle.visitor
;
package
org.apache.shardingsphere.sql.parser.oracle.visitor
.statement
;
import
org.apache.shardingsphere.sql.parser.api.visitor.statement.StatementSQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.api.visitor.statement.impl.DALStatementSQLVisitor
;
...
...
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/PostgreSQLParserConfiguration.java
浏览文件 @
666c1e2a
...
...
@@ -19,10 +19,10 @@ package org.apache.shardingsphere.sql.parser.postgresql;
import
org.apache.shardingsphere.sql.parser.api.lexer.SQLLexer
;
import
org.apache.shardingsphere.sql.parser.api.parser.SQLParser
;
import
org.apache.shardingsphere.sql.parser.api.visitor.
statement.Statement
SQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.postgresql.lexer.PostgreSQLLexer
;
import
org.apache.shardingsphere.sql.parser.postgresql.parser.PostgreSQLParser
;
import
org.apache.shardingsphere.sql.parser.postgresql.visitor.PostgreSQLS
tatementS
QLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.postgresql.visitor.PostgreSQLSQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.spi.SQLParserConfiguration
;
/**
...
...
@@ -46,7 +46,7 @@ public final class PostgreSQLParserConfiguration implements SQLParserConfigurati
}
@Override
public
Class
<?
extends
S
tatementS
QLVisitorFacade
>
getVisitorFacadeClass
()
{
return
PostgreSQLS
tatementS
QLVisitorFacade
.
class
;
public
Class
<?
extends
SQLVisitorFacade
>
getVisitorFacadeClass
()
{
return
PostgreSQLSQLVisitorFacade
.
class
;
}
}
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/PostgreSQLSQLVisitorFacade.java
0 → 100644
浏览文件 @
666c1e2a
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.postgresql.visitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.FormatSQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.api.visitor.statement.StatementSQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.postgresql.visitor.format.PostgreSQLFormatSQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.postgresql.visitor.statement.PostgreSQLStatementSQLVisitorFacade
;
/**
* PostgreSQL SQL visitor facade.
*/
public
final
class
PostgreSQLSQLVisitorFacade
implements
SQLVisitorFacade
{
@Override
public
Class
<?
extends
StatementSQLVisitorFacade
>
getStatementSQLVisitorFacadeClass
()
{
return
PostgreSQLStatementSQLVisitorFacade
.
class
;
}
@Override
public
Class
<?
extends
FormatSQLVisitorFacade
>
getFormatSQLVisitorFacadeClass
()
{
return
PostgreSQLFormatSQLVisitorFacade
.
class
;
}
}
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/format/PostgreSQLFormatSQLVisitorFacade.java
0 → 100644
浏览文件 @
666c1e2a
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.postgresql.visitor.format
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.FormatSQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.DALFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.DCLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.DDLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.DMLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.RLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.TCLFormatSQLVisitor
;
/**
* Format SQL Visitor facade for MySQL.
*/
public
final
class
PostgreSQLFormatSQLVisitorFacade
implements
FormatSQLVisitorFacade
{
@Override
public
Class
<?
extends
DMLFormatSQLVisitor
>
getDMLVisitorClass
()
{
throw
new
UnsupportedOperationException
();
}
@Override
public
Class
<?
extends
DDLFormatSQLVisitor
>
getDDLVisitorClass
()
{
throw
new
UnsupportedOperationException
();
}
@Override
public
Class
<?
extends
TCLFormatSQLVisitor
>
getTCLVisitorClass
()
{
throw
new
UnsupportedOperationException
();
}
@Override
public
Class
<?
extends
DCLFormatSQLVisitor
>
getDCLVisitorClass
()
{
throw
new
UnsupportedOperationException
();
}
@Override
public
Class
<?
extends
DALFormatSQLVisitor
>
getDALVisitorClass
()
{
throw
new
UnsupportedOperationException
();
}
@Override
public
Class
<?
extends
RLFormatSQLVisitor
>
getRLVisitorClass
()
{
throw
new
UnsupportedOperationException
();
}
}
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/PostgreSQLStatementSQLVisitorFacade.java
→
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/
statement/
PostgreSQLStatementSQLVisitorFacade.java
浏览文件 @
666c1e2a
...
...
@@ -15,7 +15,7 @@
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.postgresql.visitor
;
package
org.apache.shardingsphere.sql.parser.postgresql.visitor
.statement
;
import
org.apache.shardingsphere.sql.parser.api.visitor.statement.StatementSQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.api.visitor.statement.impl.DALStatementSQLVisitor
;
...
...
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/sql92/SQL92ParserConfiguration.java
浏览文件 @
666c1e2a
...
...
@@ -19,11 +19,11 @@ package org.apache.shardingsphere.sql.parser.sql92;
import
org.apache.shardingsphere.sql.parser.api.lexer.SQLLexer
;
import
org.apache.shardingsphere.sql.parser.api.parser.SQLParser
;
import
org.apache.shardingsphere.sql.parser.api.visitor.
statement.Statement
SQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.spi.SQLParserConfiguration
;
import
org.apache.shardingsphere.sql.parser.sql92.lexer.SQL92Lexer
;
import
org.apache.shardingsphere.sql.parser.sql92.parser.SQL92Parser
;
import
org.apache.shardingsphere.sql.parser.sql92.visitor.SQL92S
tatementS
QLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.sql92.visitor.SQL92SQLVisitorFacade
;
/**
* SQL parser configuration for SQL92.
...
...
@@ -46,7 +46,7 @@ public final class SQL92ParserConfiguration implements SQLParserConfiguration {
}
@Override
public
Class
<?
extends
S
tatementS
QLVisitorFacade
>
getVisitorFacadeClass
()
{
return
SQL92S
tatementS
QLVisitorFacade
.
class
;
public
Class
<?
extends
SQLVisitorFacade
>
getVisitorFacadeClass
()
{
return
SQL92SQLVisitorFacade
.
class
;
}
}
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/sql92/visitor/SQL92SQLVisitorFacade.java
0 → 100644
浏览文件 @
666c1e2a
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.sql92.visitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.FormatSQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.api.visitor.statement.StatementSQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.sql92.visitor.format.SQL92FormatSQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.sql92.visitor.statement.SQL92StatementSQLVisitorFacade
;
/**
* SQL92 SQL visitor facade.
*/
public
final
class
SQL92SQLVisitorFacade
implements
SQLVisitorFacade
{
@Override
public
Class
<?
extends
StatementSQLVisitorFacade
>
getStatementSQLVisitorFacadeClass
()
{
return
SQL92StatementSQLVisitorFacade
.
class
;
}
@Override
public
Class
<?
extends
FormatSQLVisitorFacade
>
getFormatSQLVisitorFacadeClass
()
{
return
SQL92FormatSQLVisitorFacade
.
class
;
}
}
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/sql92/visitor/format/SQL92FormatSQLVisitorFacade.java
0 → 100644
浏览文件 @
666c1e2a
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.sql92.visitor.format
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.FormatSQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.DALFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.DCLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.DDLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.DMLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.RLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.TCLFormatSQLVisitor
;
/**
* Format SQL Visitor facade for MySQL.
*/
public
final
class
SQL92FormatSQLVisitorFacade
implements
FormatSQLVisitorFacade
{
@Override
public
Class
<?
extends
DMLFormatSQLVisitor
>
getDMLVisitorClass
()
{
throw
new
UnsupportedOperationException
();
}
@Override
public
Class
<?
extends
DDLFormatSQLVisitor
>
getDDLVisitorClass
()
{
throw
new
UnsupportedOperationException
();
}
@Override
public
Class
<?
extends
TCLFormatSQLVisitor
>
getTCLVisitorClass
()
{
throw
new
UnsupportedOperationException
();
}
@Override
public
Class
<?
extends
DCLFormatSQLVisitor
>
getDCLVisitorClass
()
{
throw
new
UnsupportedOperationException
();
}
@Override
public
Class
<?
extends
DALFormatSQLVisitor
>
getDALVisitorClass
()
{
throw
new
UnsupportedOperationException
();
}
@Override
public
Class
<?
extends
RLFormatSQLVisitor
>
getRLVisitorClass
()
{
throw
new
UnsupportedOperationException
();
}
}
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/sql92/visitor/SQL92StatementSQLVisitorFacade.java
→
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/sql92/visitor/
statement/
SQL92StatementSQLVisitorFacade.java
浏览文件 @
666c1e2a
...
...
@@ -15,7 +15,7 @@
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.sql92.visitor
;
package
org.apache.shardingsphere.sql.parser.sql92.visitor
.statement
;
import
org.apache.shardingsphere.sql.parser.api.visitor.statement.StatementSQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.api.visitor.statement.impl.DALStatementSQLVisitor
;
...
...
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/SQLServerParserConfiguration.java
浏览文件 @
666c1e2a
...
...
@@ -19,11 +19,11 @@ package org.apache.shardingsphere.sql.parser.sqlserver;
import
org.apache.shardingsphere.sql.parser.api.lexer.SQLLexer
;
import
org.apache.shardingsphere.sql.parser.api.parser.SQLParser
;
import
org.apache.shardingsphere.sql.parser.api.visitor.
statement.Statement
SQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.spi.SQLParserConfiguration
;
import
org.apache.shardingsphere.sql.parser.sqlserver.lexer.SQLServerLexer
;
import
org.apache.shardingsphere.sql.parser.sqlserver.parser.SQLServerParser
;
import
org.apache.shardingsphere.sql.parser.sqlserver.visitor.SQLServerS
tatementS
QLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.sqlserver.visitor.SQLServerSQLVisitorFacade
;
/**
* SQL parser configuration for SQLServer.
...
...
@@ -46,7 +46,7 @@ public final class SQLServerParserConfiguration implements SQLParserConfiguratio
}
@Override
public
Class
<?
extends
S
tatementS
QLVisitorFacade
>
getVisitorFacadeClass
()
{
return
SQLServerS
tatementS
QLVisitorFacade
.
class
;
public
Class
<?
extends
SQLVisitorFacade
>
getVisitorFacadeClass
()
{
return
SQLServerSQLVisitorFacade
.
class
;
}
}
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/visitor/SQLServerSQLVisitorFacade.java
0 → 100644
浏览文件 @
666c1e2a
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.sqlserver.visitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.FormatSQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.api.visitor.statement.StatementSQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.sqlserver.visitor.format.SQLServerFormatSQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.sqlserver.visitor.statement.SQLServerStatementSQLVisitorFacade
;
/**
* SQLServer SQL visitor facade.
*/
public
final
class
SQLServerSQLVisitorFacade
implements
SQLVisitorFacade
{
@Override
public
Class
<?
extends
StatementSQLVisitorFacade
>
getStatementSQLVisitorFacadeClass
()
{
return
SQLServerStatementSQLVisitorFacade
.
class
;
}
@Override
public
Class
<?
extends
FormatSQLVisitorFacade
>
getFormatSQLVisitorFacadeClass
()
{
return
SQLServerFormatSQLVisitorFacade
.
class
;
}
}
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/visitor/format/SQLServerFormatSQLVisitorFacade.java
0 → 100644
浏览文件 @
666c1e2a
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.sqlserver.visitor.format
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.FormatSQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.DALFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.DCLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.DDLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.DMLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.RLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.TCLFormatSQLVisitor
;
/**
* Format SQL Visitor facade for MySQL.
*/
public
final
class
SQLServerFormatSQLVisitorFacade
implements
FormatSQLVisitorFacade
{
@Override
public
Class
<?
extends
DMLFormatSQLVisitor
>
getDMLVisitorClass
()
{
throw
new
UnsupportedOperationException
();
}
@Override
public
Class
<?
extends
DDLFormatSQLVisitor
>
getDDLVisitorClass
()
{
throw
new
UnsupportedOperationException
();
}
@Override
public
Class
<?
extends
TCLFormatSQLVisitor
>
getTCLVisitorClass
()
{
throw
new
UnsupportedOperationException
();
}
@Override
public
Class
<?
extends
DCLFormatSQLVisitor
>
getDCLVisitorClass
()
{
throw
new
UnsupportedOperationException
();
}
@Override
public
Class
<?
extends
DALFormatSQLVisitor
>
getDALVisitorClass
()
{
throw
new
UnsupportedOperationException
();
}
@Override
public
Class
<?
extends
RLFormatSQLVisitor
>
getRLVisitorClass
()
{
throw
new
UnsupportedOperationException
();
}
}
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/visitor/SQLServerStatementSQLVisitorFacade.java
→
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/visitor/
statement/
SQLServerStatementSQLVisitorFacade.java
浏览文件 @
666c1e2a
...
...
@@ -15,7 +15,7 @@
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.sqlserver.visitor
;
package
org.apache.shardingsphere.sql.parser.sqlserver.visitor
.statement
;
import
org.apache.shardingsphere.sql.parser.api.visitor.statement.StatementSQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.api.visitor.statement.impl.DALStatementSQLVisitor
;
...
...
shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/visitor/
statement/Statement
SQLVisitorRule.java
→
shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/visitor/SQLVisitorRule.java
浏览文件 @
666c1e2a
...
...
@@ -15,7 +15,7 @@
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.core.visitor
.statement
;
package
org.apache.shardingsphere.sql.parser.core.visitor
;
import
lombok.Getter
;
import
lombok.RequiredArgsConstructor
;
...
...
@@ -26,7 +26,7 @@ import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatementTyp
* Statement SQL Visitor rule.
*/
@RequiredArgsConstructor
public
enum
S
tatementS
QLVisitorRule
{
public
enum
SQLVisitorRule
{
SELECT
(
"Select"
,
SQLStatementType
.
DML
),
...
...
@@ -201,9 +201,9 @@ public enum StatementSQLVisitorRule {
* @param parseTreeClass parse tree class
* @return visitor rule
*/
public
static
S
tatementS
QLVisitorRule
valueOf
(
final
Class
<?
extends
ParseTree
>
parseTreeClass
)
{
public
static
SQLVisitorRule
valueOf
(
final
Class
<?
extends
ParseTree
>
parseTreeClass
)
{
String
parseTreeClassName
=
parseTreeClass
.
getSimpleName
();
for
(
S
tatementS
QLVisitorRule
each
:
values
())
{
for
(
SQLVisitorRule
each
:
values
())
{
if
(
each
.
getContextName
().
equals
(
parseTreeClassName
))
{
return
each
;
}
...
...
shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/visitor/format/FormatSQLVisitorFactory.java
0 → 100644
浏览文件 @
666c1e2a
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.core.visitor.format
;
import
lombok.AccessLevel
;
import
lombok.NoArgsConstructor
;
import
lombok.SneakyThrows
;
import
org.antlr.v4.runtime.tree.ParseTreeVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.FormatSQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.core.SQLParserConfigurationRegistry
;
import
org.apache.shardingsphere.sql.parser.core.visitor.SQLVisitorRule
;
import
org.apache.shardingsphere.sql.parser.exception.SQLParsingException
;
import
org.apache.shardingsphere.sql.parser.spi.SQLParserConfiguration
;
import
org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatementType
;
/**
* Format SQL visitor factory.
*/
@NoArgsConstructor
(
access
=
AccessLevel
.
PRIVATE
)
public
final
class
FormatSQLVisitorFactory
{
/**
* New instance of statement SQL visitor.
*
* @param databaseTypeName name of database type
* @param SQLVisitorRule visitor rule
* @return parse tree visitor
*/
public
static
ParseTreeVisitor
newInstance
(
final
String
databaseTypeName
,
final
SQLVisitorRule
SQLVisitorRule
)
{
return
createParseTreeVisitor
(
SQLParserConfigurationRegistry
.
getInstance
().
getSQLParserConfiguration
(
databaseTypeName
),
SQLVisitorRule
.
getType
());
}
@SneakyThrows
(
ReflectiveOperationException
.
class
)
private
static
ParseTreeVisitor
createParseTreeVisitor
(
final
SQLParserConfiguration
config
,
final
SQLStatementType
type
)
{
FormatSQLVisitorFacade
visitorFacade
=
config
.
getVisitorFacadeClass
().
getConstructor
().
newInstance
().
getFormatSQLVisitorFacadeClass
().
getConstructor
().
newInstance
();
switch
(
type
)
{
case
DML:
return
(
ParseTreeVisitor
)
visitorFacade
.
getDMLVisitorClass
().
getConstructor
().
newInstance
();
case
DDL:
return
(
ParseTreeVisitor
)
visitorFacade
.
getDDLVisitorClass
().
getConstructor
().
newInstance
();
case
TCL:
return
(
ParseTreeVisitor
)
visitorFacade
.
getTCLVisitorClass
().
getConstructor
().
newInstance
();
case
DCL:
return
(
ParseTreeVisitor
)
visitorFacade
.
getDCLVisitorClass
().
getConstructor
().
newInstance
();
case
DAL:
return
(
ParseTreeVisitor
)
visitorFacade
.
getDALVisitorClass
().
getConstructor
().
newInstance
();
case
RL:
return
(
ParseTreeVisitor
)
visitorFacade
.
getRLVisitorClass
().
getConstructor
().
newInstance
();
default
:
throw
new
SQLParsingException
(
"Can not support SQL statement type: `%s`"
,
type
);
}
}
}
shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/visitor/statement/StatementSQLVisitorFactory.java
浏览文件 @
666c1e2a
...
...
@@ -23,6 +23,7 @@ import lombok.SneakyThrows;
import
org.antlr.v4.runtime.tree.ParseTreeVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.statement.StatementSQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.core.SQLParserConfigurationRegistry
;
import
org.apache.shardingsphere.sql.parser.core.visitor.SQLVisitorRule
;
import
org.apache.shardingsphere.sql.parser.exception.SQLParsingException
;
import
org.apache.shardingsphere.sql.parser.spi.SQLParserConfiguration
;
import
org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatementType
;
...
...
@@ -37,16 +38,17 @@ public final class StatementSQLVisitorFactory {
* New instance of statement SQL visitor.
*
* @param databaseTypeName name of database type
* @param
statement
SQLVisitorRule visitor rule
* @param SQLVisitorRule visitor rule
* @return parse tree visitor
*/
public
static
ParseTreeVisitor
newInstance
(
final
String
databaseTypeName
,
final
S
tatementSQLVisitorRule
statement
SQLVisitorRule
)
{
return
createParseTreeVisitor
(
SQLParserConfigurationRegistry
.
getInstance
().
getSQLParserConfiguration
(
databaseTypeName
),
statement
SQLVisitorRule
.
getType
());
public
static
ParseTreeVisitor
newInstance
(
final
String
databaseTypeName
,
final
S
QLVisitorRule
SQLVisitorRule
)
{
return
createParseTreeVisitor
(
SQLParserConfigurationRegistry
.
getInstance
().
getSQLParserConfiguration
(
databaseTypeName
),
SQLVisitorRule
.
getType
());
}
@SneakyThrows
(
ReflectiveOperationException
.
class
)
private
static
ParseTreeVisitor
createParseTreeVisitor
(
final
SQLParserConfiguration
config
,
final
SQLStatementType
type
)
{
StatementSQLVisitorFacade
visitorFacade
=
config
.
getVisitorFacadeClass
().
getConstructor
().
newInstance
();
StatementSQLVisitorFacade
visitorFacade
=
config
.
getVisitorFacadeClass
().
getConstructor
().
newInstance
().
getStatementSQLVisitorFacadeClass
().
getConstructor
().
newInstance
();
switch
(
type
)
{
case
DML:
return
(
ParseTreeVisitor
)
visitorFacade
.
getDMLVisitorClass
().
getConstructor
().
newInstance
();
...
...
shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/engine/statement/standard/StandardSQLParserEngine.java
浏览文件 @
666c1e2a
...
...
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.sql.parser.engine.statement.standard;
import
lombok.RequiredArgsConstructor
;
import
org.antlr.v4.runtime.tree.ParseTree
;
import
org.apache.shardingsphere.sql.parser.core.visitor.statement.StatementSQLVisitorFactory
;
import
org.apache.shardingsphere.sql.parser.core.visitor.
statement.Statement
SQLVisitorRule
;
import
org.apache.shardingsphere.sql.parser.core.visitor.SQLVisitorRule
;
import
org.apache.shardingsphere.sql.parser.engine.statement.StatementSQLParserEngine
;
import
org.apache.shardingsphere.sql.parser.core.parser.SQLParserExecutor
;
import
org.apache.shardingsphere.sql.parser.hook.ParsingHookRegistry
;
...
...
@@ -70,7 +70,7 @@ public final class StandardSQLParserEngine implements StatementSQLParserEngine {
}
}
ParseTree
parseTree
=
new
SQLParserExecutor
(
databaseTypeName
,
sql
).
execute
().
getRootNode
();
SQLStatement
result
=
(
SQLStatement
)
StatementSQLVisitorFactory
.
newInstance
(
databaseTypeName
,
S
tatementS
QLVisitorRule
.
valueOf
(
parseTree
.
getClass
())).
visit
(
parseTree
);
SQLStatement
result
=
(
SQLStatement
)
StatementSQLVisitorFactory
.
newInstance
(
databaseTypeName
,
SQLVisitorRule
.
valueOf
(
parseTree
.
getClass
())).
visit
(
parseTree
);
if
(
useCache
)
{
cache
.
put
(
sql
,
result
);
}
...
...
shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/test/java/org/apache/shardingsphere/sql/parser/core/visitor/S
tatementS
QLVisitorRuleTest.java
→
shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/test/java/org/apache/shardingsphere/sql/parser/core/visitor/SQLVisitorRuleTest.java
浏览文件 @
666c1e2a
...
...
@@ -18,21 +18,20 @@
package
org.apache.shardingsphere.sql.parser.core.visitor
;
import
org.antlr.v4.runtime.tree.ParseTree
;
import
org.apache.shardingsphere.sql.parser.core.visitor.statement.StatementSQLVisitorRule
;
import
org.junit.Test
;
import
static
org
.
hamcrest
.
CoreMatchers
.
is
;
import
static
org
.
junit
.
Assert
.
assertThat
;
public
final
class
S
tatementS
QLVisitorRuleTest
{
public
final
class
SQLVisitorRuleTest
{
@Test
public
void
assertValueOfParseTreeClassSuccess
()
{
assertThat
(
S
tatementSQLVisitorRule
.
valueOf
(
SelectContext
.
class
),
is
(
Statement
SQLVisitorRule
.
SELECT
));
assertThat
(
S
QLVisitorRule
.
valueOf
(
SelectContext
.
class
),
is
(
SQLVisitorRule
.
SELECT
));
}
@Test
(
expected
=
IllegalArgumentException
.
class
)
public
void
assertValueOfParseTreeClassFailure
()
{
S
tatementS
QLVisitorRule
.
valueOf
(
ParseTree
.
class
);
SQLVisitorRule
.
valueOf
(
ParseTree
.
class
);
}
}
shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/SQLVisitorFacade.java
0 → 100644
浏览文件 @
666c1e2a
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.api.visitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.FormatSQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.api.visitor.statement.StatementSQLVisitorFacade
;
/**
* SQL visitor facade.
*/
public
interface
SQLVisitorFacade
{
/**
* Get Statement visitor facade class.
*
* @return DML visitor class
*/
Class
<?
extends
StatementSQLVisitorFacade
>
getStatementSQLVisitorFacadeClass
();
/**
* Get Format visitor facade class.
*
* @return DDL visitor class
*/
Class
<?
extends
FormatSQLVisitorFacade
>
getFormatSQLVisitorFacadeClass
();
}
shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/SQLVisitorType.java
0 → 100644
浏览文件 @
666c1e2a
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.api.visitor
;
/**
* SQL visitor type.
*/
public
enum
SQLVisitorType
{
STATEMENT
,
FORMAT
}
shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/format/FormatSQLVisitorFacade.java
0 → 100644
浏览文件 @
666c1e2a
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.api.visitor.format
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.DALFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.DCLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.DDLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.DMLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.RLFormatSQLVisitor
;
import
org.apache.shardingsphere.sql.parser.api.visitor.format.impl.TCLFormatSQLVisitor
;
/**
* Format SQL visitor facade.
*/
public
interface
FormatSQLVisitorFacade
{
/**
* Get DML visitor class.
*
* @return DML visitor class
*/
Class
<?
extends
DMLFormatSQLVisitor
>
getDMLVisitorClass
();
/**
* Get DDL visitor class.
*
* @return DDL visitor class
*/
Class
<?
extends
DDLFormatSQLVisitor
>
getDDLVisitorClass
();
/**
* Get TCL visitor class.
*
* @return TCL visitor class
*/
Class
<?
extends
TCLFormatSQLVisitor
>
getTCLVisitorClass
();
/**
* Get DCL visitor class.
*
* @return DCL visitor class
*/
Class
<?
extends
DCLFormatSQLVisitor
>
getDCLVisitorClass
();
/**
* Get DAL visitor class.
*
* @return DAL visitor class
*/
Class
<?
extends
DALFormatSQLVisitor
>
getDALVisitorClass
();
/**
* Get RL visitor class.
*
* @return RL visitor class
*/
Class
<?
extends
RLFormatSQLVisitor
>
getRLVisitorClass
();
}
shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/format/impl/DALFormatSQLVisitor.java
0 → 100644
浏览文件 @
666c1e2a
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.api.visitor.format.impl
;
/**
* DAL format SQL visitor.
*/
public
interface
DALFormatSQLVisitor
{
}
shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/format/impl/DCLFormatSQLVisitor.java
0 → 100644
浏览文件 @
666c1e2a
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.api.visitor.format.impl
;
/**
* DCL format SQL visitor.
*/
public
interface
DCLFormatSQLVisitor
{
}
shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/format/impl/DDLFormatSQLVisitor.java
0 → 100644
浏览文件 @
666c1e2a
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.api.visitor.format.impl
;
/**
* DDL format SQL visitor.
*/
public
interface
DDLFormatSQLVisitor
{
}
shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/format/impl/DMLFormatSQLVisitor.java
0 → 100644
浏览文件 @
666c1e2a
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.api.visitor.format.impl
;
/**
* DML format SQL visitor.
*/
public
interface
DMLFormatSQLVisitor
{
}
shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/format/impl/RLFormatSQLVisitor.java
0 → 100644
浏览文件 @
666c1e2a
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.api.visitor.format.impl
;
/**
* RL format SQL visitor.
*/
public
interface
RLFormatSQLVisitor
{
}
shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/format/impl/TCLFormatSQLVisitor.java
0 → 100644
浏览文件 @
666c1e2a
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.shardingsphere.sql.parser.api.visitor.format.impl
;
/**
* TCL format SQL visitor.
*/
public
interface
TCLFormatSQLVisitor
{
}
shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/spi/SQLParserConfiguration.java
浏览文件 @
666c1e2a
...
...
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.sql.parser.spi;
import
org.apache.shardingsphere.sql.parser.api.lexer.SQLLexer
;
import
org.apache.shardingsphere.sql.parser.api.parser.SQLParser
;
import
org.apache.shardingsphere.sql.parser.api.visitor.
statement.Statement
SQLVisitorFacade
;
import
org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitorFacade
;
/**
* SQL parser configuration.
...
...
@@ -52,5 +52,5 @@ public interface SQLParserConfiguration {
*
* @return SQL visitor facade class
*/
Class
<?
extends
S
tatementS
QLVisitorFacade
>
getVisitorFacadeClass
();
Class
<?
extends
SQLVisitorFacade
>
getVisitorFacadeClass
();
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录