未验证 提交 f8c44796 编写于 作者: L Liang Zhang 提交者: GitHub

Refactor SQLParserConfiguration.getSQLVisitorFacadeClasses (#7932)

* Add SQLVisitorFacade.getType

* Refactor SQLParserConfiguration.getSQLVisitorFacadeClasses

* Remove useless SQLVisitorFacadeFactory

* Remove SQLVisitorType
上级 b20ef54d
......@@ -19,12 +19,16 @@ 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.SQLVisitorFacadeFactory;
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.MySQLSQLVisitorFacadeFactory;
import org.apache.shardingsphere.sql.parser.mysql.visitor.format.facade.MySQLFormatSQLVisitorFacade;
import org.apache.shardingsphere.sql.parser.mysql.visitor.statement.facade.MySQLStatementSQLVisitorFacade;
import org.apache.shardingsphere.sql.parser.spi.SQLParserConfiguration;
import java.util.HashMap;
import java.util.Map;
/**
* SQL parser configuration for MySQL.
*/
......@@ -46,7 +50,10 @@ public final class MySQLParserConfiguration implements SQLParserConfiguration {
}
@Override
public Class<? extends SQLVisitorFacadeFactory> getVisitorFacadeFactoryClass() {
return MySQLSQLVisitorFacadeFactory.class;
public Map<String, Class<? extends SQLVisitorFacade>> getSQLVisitorFacadeClasses() {
Map<String, Class<? extends SQLVisitorFacade>> result = new HashMap<>(2, 1);
result.put("STATEMENT", MySQLStatementSQLVisitorFacade.class);
result.put("FORMAT", MySQLFormatSQLVisitorFacade.class);
return result;
}
}
/*
* 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.SQLVisitorFacadeFactory;
import org.apache.shardingsphere.sql.parser.mysql.visitor.format.facade.MySQLFormatSQLVisitorFacade;
import org.apache.shardingsphere.sql.parser.mysql.visitor.statement.facade.MySQLStatementSQLVisitorFacade;
/**
* MySQL SQL visitor facade engine.
*/
public final class MySQLSQLVisitorFacadeFactory implements SQLVisitorFacadeFactory {
@Override
public Class<MySQLStatementSQLVisitorFacade> getStatementSQLVisitorFacadeClass() {
return MySQLStatementSQLVisitorFacade.class;
}
@Override
public Class<MySQLFormatSQLVisitorFacade> getFormatSQLVisitorFacadeClass() {
return MySQLFormatSQLVisitorFacade.class;
}
}
......@@ -65,4 +65,9 @@ public final class MySQLFormatSQLVisitorFacade implements SQLVisitorFacade {
public Class<? extends RLSQLVisitor> getRLVisitorClass() {
return MySQLRLFormatSQLVisitor.class;
}
@Override
public String getType() {
return "FORMAT";
}
}
......@@ -65,4 +65,9 @@ public final class MySQLStatementSQLVisitorFacade implements SQLVisitorFacade {
public Class<? extends RLSQLVisitor> getRLVisitorClass() {
return MySQLRLStatementSQLVisitor.class;
}
@Override
public String getType() {
return "STATEMENT";
}
}
......@@ -19,12 +19,16 @@ 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.SQLVisitorFacadeFactory;
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.OracleSQLVisitorFacadeFactory;
import org.apache.shardingsphere.sql.parser.oracle.visitor.format.facade.OracleFormatSQLVisitorFacade;
import org.apache.shardingsphere.sql.parser.oracle.visitor.statement.facade.OracleStatementSQLVisitorFacade;
import org.apache.shardingsphere.sql.parser.spi.SQLParserConfiguration;
import java.util.HashMap;
import java.util.Map;
/**
* SQL parser configuration for Oracle.
*/
......@@ -46,7 +50,10 @@ public final class OracleParserConfiguration implements SQLParserConfiguration {
}
@Override
public Class<? extends SQLVisitorFacadeFactory> getVisitorFacadeFactoryClass() {
return OracleSQLVisitorFacadeFactory.class;
public Map<String, Class<? extends SQLVisitorFacade>> getSQLVisitorFacadeClasses() {
Map<String, Class<? extends SQLVisitorFacade>> result = new HashMap<>(2, 1);
result.put("STATEMENT", OracleStatementSQLVisitorFacade.class);
result.put("FORMAT", OracleFormatSQLVisitorFacade.class);
return result;
}
}
/*
* 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.SQLVisitorFacadeFactory;
import org.apache.shardingsphere.sql.parser.oracle.visitor.statement.facade.OracleStatementSQLVisitorFacade;
/**
* Oracle SQL visitor facade engine.
*/
public final class OracleSQLVisitorFacadeFactory implements SQLVisitorFacadeFactory {
@Override
public Class<OracleStatementSQLVisitorFacade> getStatementSQLVisitorFacadeClass() {
return OracleStatementSQLVisitorFacade.class;
}
@Override
public Class<OracleStatementSQLVisitorFacade> getFormatSQLVisitorFacadeClass() {
return OracleStatementSQLVisitorFacade.class;
}
}
......@@ -59,4 +59,9 @@ public final class OracleFormatSQLVisitorFacade implements SQLVisitorFacade {
public Class<? extends RLSQLVisitor> getRLVisitorClass() {
throw new UnsupportedOperationException();
}
@Override
public String getType() {
return "FORMAT";
}
}
......@@ -64,4 +64,9 @@ public final class OracleStatementSQLVisitorFacade implements SQLVisitorFacade {
public Class<? extends RLSQLVisitor> getRLVisitorClass() {
return null;
}
@Override
public String getType() {
return "STATEMENT";
}
}
......@@ -19,12 +19,16 @@ 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.SQLVisitorFacadeFactory;
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.PostgreSQLSQLVisitorFacadeFactory;
import org.apache.shardingsphere.sql.parser.postgresql.visitor.format.facade.PostgreSQLFormatSQLVisitorFacade;
import org.apache.shardingsphere.sql.parser.postgresql.visitor.statement.facade.PostgreSQLStatementSQLVisitorFacade;
import org.apache.shardingsphere.sql.parser.spi.SQLParserConfiguration;
import java.util.HashMap;
import java.util.Map;
/**
* SQL parser configuration for PostgreSQL.
*/
......@@ -46,7 +50,10 @@ public final class PostgreSQLParserConfiguration implements SQLParserConfigurati
}
@Override
public Class<? extends SQLVisitorFacadeFactory> getVisitorFacadeFactoryClass() {
return PostgreSQLSQLVisitorFacadeFactory.class;
public Map<String, Class<? extends SQLVisitorFacade>> getSQLVisitorFacadeClasses() {
Map<String, Class<? extends SQLVisitorFacade>> result = new HashMap<>(2, 1);
result.put("STATEMENT", PostgreSQLStatementSQLVisitorFacade.class);
result.put("FORMAT", PostgreSQLFormatSQLVisitorFacade.class);
return result;
}
}
/*
* 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.SQLVisitorFacadeFactory;
import org.apache.shardingsphere.sql.parser.postgresql.visitor.format.facade.PostgreSQLFormatSQLVisitorFacade;
import org.apache.shardingsphere.sql.parser.postgresql.visitor.statement.facade.PostgreSQLStatementSQLVisitorFacade;
/**
* PostgreSQL SQL visitor facade engine.
*/
public final class PostgreSQLSQLVisitorFacadeFactory implements SQLVisitorFacadeFactory {
@Override
public Class<PostgreSQLStatementSQLVisitorFacade> getStatementSQLVisitorFacadeClass() {
return PostgreSQLStatementSQLVisitorFacade.class;
}
@Override
public Class<PostgreSQLFormatSQLVisitorFacade> getFormatSQLVisitorFacadeClass() {
return PostgreSQLFormatSQLVisitorFacade.class;
}
}
......@@ -59,4 +59,9 @@ public final class PostgreSQLFormatSQLVisitorFacade implements SQLVisitorFacade
public Class<? extends RLSQLVisitor> getRLVisitorClass() {
throw new UnsupportedOperationException();
}
@Override
public String getType() {
return "FORMAT";
}
}
......@@ -64,4 +64,9 @@ public final class PostgreSQLStatementSQLVisitorFacade implements SQLVisitorFaca
public Class<? extends RLSQLVisitor> getRLVisitorClass() {
return null;
}
@Override
public String getType() {
return "STATEMENT";
}
}
......@@ -19,11 +19,15 @@ 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.SQLVisitorFacadeFactory;
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.SQL92SQLVisitorFacadeFactory;
import org.apache.shardingsphere.sql.parser.sql92.visitor.format.facade.SQL92FormatSQLVisitorFacade;
import org.apache.shardingsphere.sql.parser.sql92.visitor.statement.facade.SQL92StatementSQLVisitorFacade;
import java.util.HashMap;
import java.util.Map;
/**
* SQL parser configuration for SQL92.
......@@ -46,7 +50,10 @@ public final class SQL92ParserConfiguration implements SQLParserConfiguration {
}
@Override
public Class<? extends SQLVisitorFacadeFactory> getVisitorFacadeFactoryClass() {
return SQL92SQLVisitorFacadeFactory.class;
public Map<String, Class<? extends SQLVisitorFacade>> getSQLVisitorFacadeClasses() {
Map<String, Class<? extends SQLVisitorFacade>> result = new HashMap<>(2, 1);
result.put("STATEMENT", SQL92StatementSQLVisitorFacade.class);
result.put("FORMAT", SQL92FormatSQLVisitorFacade.class);
return result;
}
}
/*
* 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.SQLVisitorFacadeFactory;
import org.apache.shardingsphere.sql.parser.sql92.visitor.format.facade.SQL92FormatSQLVisitorFacade;
import org.apache.shardingsphere.sql.parser.sql92.visitor.statement.facade.SQL92StatementSQLVisitorFacade;
/**
* SQL92 SQL visitor facade engine.
*/
public final class SQL92SQLVisitorFacadeFactory implements SQLVisitorFacadeFactory {
@Override
public Class<? extends SQLVisitorFacade> getStatementSQLVisitorFacadeClass() {
return SQL92StatementSQLVisitorFacade.class;
}
@Override
public Class<? extends SQLVisitorFacade> getFormatSQLVisitorFacadeClass() {
return SQL92FormatSQLVisitorFacade.class;
}
}
......@@ -59,4 +59,9 @@ public final class SQL92FormatSQLVisitorFacade implements SQLVisitorFacade {
public Class<? extends RLSQLVisitor> getRLVisitorClass() {
throw new UnsupportedOperationException();
}
@Override
public String getType() {
return "FORMAT";
}
}
......@@ -64,4 +64,9 @@ public final class SQL92StatementSQLVisitorFacade implements SQLVisitorFacade {
public Class<? extends RLSQLVisitor> getRLVisitorClass() {
return null;
}
@Override
public String getType() {
return "STATEMENT";
}
}
......@@ -19,11 +19,15 @@ 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.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.api.visitor.SQLVisitorFacadeFactory;
import org.apache.shardingsphere.sql.parser.sqlserver.visitor.SQLServerSQLVisitorFacadeFactory;
import org.apache.shardingsphere.sql.parser.sqlserver.visitor.format.facade.SQLServerFormatSQLVisitorFacade;
import org.apache.shardingsphere.sql.parser.sqlserver.visitor.statement.facade.SQLServerStatementSQLVisitorFacade;
import java.util.HashMap;
import java.util.Map;
/**
* SQL parser configuration for SQLServer.
......@@ -46,7 +50,10 @@ public final class SQLServerParserConfiguration implements SQLParserConfiguratio
}
@Override
public Class<? extends SQLVisitorFacadeFactory> getVisitorFacadeFactoryClass() {
return SQLServerSQLVisitorFacadeFactory.class;
public Map<String, Class<? extends SQLVisitorFacade>> getSQLVisitorFacadeClasses() {
Map<String, Class<? extends SQLVisitorFacade>> result = new HashMap<>(2, 1);
result.put("STATEMENT", SQLServerStatementSQLVisitorFacade.class);
result.put("FORMAT", SQLServerFormatSQLVisitorFacade.class);
return result;
}
}
/*
* 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.SQLVisitorFacadeFactory;
import org.apache.shardingsphere.sql.parser.sqlserver.visitor.format.facade.SQLServerFormatSQLVisitorFacade;
import org.apache.shardingsphere.sql.parser.sqlserver.visitor.statement.facade.SQLServerStatementSQLVisitorFacade;
/**
* SQLServer SQL visitor facade engine.
*/
public final class SQLServerSQLVisitorFacadeFactory implements SQLVisitorFacadeFactory {
@Override
public Class<? extends SQLVisitorFacade> getStatementSQLVisitorFacadeClass() {
return SQLServerStatementSQLVisitorFacade.class;
}
@Override
public Class<? extends SQLVisitorFacade> getFormatSQLVisitorFacadeClass() {
return SQLServerFormatSQLVisitorFacade.class;
}
}
......@@ -59,4 +59,9 @@ public final class SQLServerFormatSQLVisitorFacade implements SQLVisitorFacade {
public Class<? extends RLSQLVisitor> getRLVisitorClass() {
throw new UnsupportedOperationException();
}
@Override
public String getType() {
return "FORMAT";
}
}
......@@ -64,4 +64,9 @@ public final class SQLServerStatementSQLVisitorFacade implements SQLVisitorFacad
public Class<? extends RLSQLVisitor> getRLVisitorClass() {
return null;
}
@Override
public String getType() {
return "STATEMENT";
}
}
......@@ -22,7 +22,6 @@ import lombok.NoArgsConstructor;
import lombok.SneakyThrows;
import org.antlr.v4.runtime.tree.ParseTreeVisitor;
import org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitorFacade;
import org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitorFacadeFactory;
import org.apache.shardingsphere.sql.parser.core.SQLParserConfigurationRegistry;
import org.apache.shardingsphere.sql.parser.exception.SQLParsingException;
import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatementType;
......@@ -46,8 +45,7 @@ public final class SQLFormatVisitorFactory {
@SneakyThrows(ReflectiveOperationException.class)
private static SQLVisitorFacade getSQLVisitorFacadeEngine(final String databaseTypeName) {
SQLVisitorFacadeFactory facade = SQLParserConfigurationRegistry.getInstance().getSQLParserConfiguration(databaseTypeName).getVisitorFacadeFactoryClass().getConstructor().newInstance();
return facade.getFormatSQLVisitorFacadeClass().getConstructor().newInstance();
return SQLParserConfigurationRegistry.getInstance().getSQLParserConfiguration(databaseTypeName).getSQLVisitorFacadeClasses().get("FORMAT").getConstructor().newInstance();
}
@SneakyThrows(ReflectiveOperationException.class)
......
......@@ -22,7 +22,6 @@ import lombok.NoArgsConstructor;
import lombok.SneakyThrows;
import org.antlr.v4.runtime.tree.ParseTreeVisitor;
import org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitorFacade;
import org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitorFacadeFactory;
import org.apache.shardingsphere.sql.parser.core.SQLParserConfigurationRegistry;
import org.apache.shardingsphere.sql.parser.exception.SQLParsingException;
import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatementType;
......@@ -46,8 +45,7 @@ public final class SQLStatementVisitorFactory {
@SneakyThrows(ReflectiveOperationException.class)
private static SQLVisitorFacade getSQLVisitorFacadeEngine(final String databaseTypeName) {
SQLVisitorFacadeFactory facade = SQLParserConfigurationRegistry.getInstance().getSQLParserConfiguration(databaseTypeName).getVisitorFacadeFactoryClass().getConstructor().newInstance();
return facade.getStatementSQLVisitorFacadeClass().getConstructor().newInstance();
return SQLParserConfigurationRegistry.getInstance().getSQLParserConfiguration(databaseTypeName).getSQLVisitorFacadeClasses().get("STATEMENT").getConstructor().newInstance();
}
@SneakyThrows(ReflectiveOperationException.class)
......
......@@ -63,4 +63,11 @@ public interface SQLVisitorFacade {
* @return RL visitor class
*/
Class<? extends SQLVisitor> getRLVisitorClass();
/**
* Get SQL visitor facade type.
*
* @return SQL visitor facade type
*/
String getType();
}
/*
* 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 facade engine.
*/
public interface SQLVisitorFacadeFactory {
/**
* Get statement visitor facade class.
*
* @return DML visitor class
*/
Class<? extends SQLVisitorFacade> getStatementSQLVisitorFacadeClass();
/**
* Get format visitor facade class.
*
* @return DDL visitor class
*/
Class<? extends SQLVisitorFacade> getFormatSQLVisitorFacadeClass();
}
/*
* 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
}
......@@ -19,7 +19,9 @@ 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.SQLVisitorFacadeFactory;
import org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitorFacade;
import java.util.Map;
/**
* SQL parser configuration.
......@@ -48,9 +50,9 @@ public interface SQLParserConfiguration {
Class<? extends SQLParser> getParserClass();
/**
* Get SQL visitor facade factory class.
* Get SQL visitor facade classes.
*
* @return SQL visitor facade factory class
* @return SQL visitor facade classes
*/
Class<? extends SQLVisitorFacadeFactory> getVisitorFacadeFactoryClass();
Map<String, Class<? extends SQLVisitorFacade>> getSQLVisitorFacadeClasses();
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册