23 | * 此类解析由模板语言(比如Freemarker)构建的字符串,并返回模板执行结果。 24 | *
25 | * 26 | * @author datagear@163.com 27 | * 28 | */ 29 | public interface TemplateResolver 30 | { 31 | /** 32 | * 解析。 33 | * 34 | * @param template 35 | * @param templateContext 36 | * @return 37 | * @throws TemplateResolverException 38 | */ 39 | String resolve(String template, TemplateContext templateContext) throws TemplateResolverException; 40 | } 41 | -------------------------------------------------------------------------------- /datagear-analysis/src/main/java/org/datagear/analysis/support/html/HtmlTitleHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-present datagear.tech 3 | * 4 | * This file is part of DataGear. 5 | * 6 | * DataGear is free software: you can redistribute it and/or modify it under the terms of 7 | * the GNU Lesser General Public License as published by the Free Software Foundation, 8 | * either version 3 of the License, or (at your option) any later version. 9 | * 10 | * DataGear is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 11 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | * See the GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License along with DataGear. 15 | * If not, see<title></title>
处理器。
22 | *
23 | * @author datagear@163.com
24 | *
25 | */
26 | public interface HtmlTitleHandler
27 | {
28 | /**
29 | * 返回要追加的标题内容。
30 | *
31 | * @param title
32 | * @return
33 | */
34 | String suffix(String title);
35 | }
36 |
--------------------------------------------------------------------------------
/datagear-analysis/src/main/java/org/datagear/analysis/support/html/HtmlTplDashboardImportBuilder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018-present datagear.tech
3 | *
4 | * This file is part of DataGear.
5 | *
6 | * DataGear is free software: you can redistribute it and/or modify it under the terms of
7 | * the GNU Lesser General Public License as published by the Free Software Foundation,
8 | * either version 3 of the License, or (at your option) any later version.
9 | *
10 | * DataGear is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 | * See the GNU Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public License along with DataGear.
15 | * If not, see 26 | * {@linkplain DefaultConnectionSource}使用此类在获取连接之前处理连接参数。 27 | *
28 | * 29 | * @author datagear@163.com 30 | * 31 | */ 32 | public interface PropertiesProcessor 33 | { 34 | /** 35 | * 处理连接参数。 36 | *37 | * 比如修改已设参数,或者添加新参数。 38 | *
39 | * 40 | * @param driver 41 | * @param url 42 | * @param properties 43 | */ 44 | void process(Driver driver, String url, Properties properties); 45 | } 46 | -------------------------------------------------------------------------------- /datagear-connection/src/main/java/org/datagear/connection/SimpleDriverChecker.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-present datagear.tech 3 | * 4 | * This file is part of DataGear. 5 | * 6 | * DataGear is free software: you can redistribute it and/or modify it under the terms of 7 | * the GNU Lesser General Public License as published by the Free Software Foundation, 8 | * either version 3 of the License, or (at your option) any later version. 9 | * 10 | * DataGear is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 11 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | * See the GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License along with DataGear. 15 | * If not, see25 | * 它仅使用{@linkplain Driver#acceptsURL(String)}校验。 26 | *
27 | * 28 | * @author datagear@163.com 29 | * 30 | */ 31 | public class SimpleDriverChecker extends AbstractDriverChecker 32 | { 33 | public SimpleDriverChecker() 34 | { 35 | super(); 36 | } 37 | 38 | @Override 39 | protected boolean checkConnection(Driver driver, ConnectionOption connectionOption) throws Throwable 40 | { 41 | return true; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /datagear-connection/src/main/java/org/datagear/connection/URLSensor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-present datagear.tech 3 | * 4 | * This file is part of DataGear. 5 | * 6 | * DataGear is free software: you can redistribute it and/or modify it under the terms of 7 | * the GNU Lesser General Public License as published by the Free Software Foundation, 8 | * either version 3 of the License, or (at your option) any later version. 9 | * 10 | * DataGear is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 11 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | * See the GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License along with DataGear. 15 | * If not, see33 | * 插入或更新。 34 | *
35 | * 36 | * @param entity 37 | */ 38 | void save(DashboardShareSet entity); 39 | } 40 | -------------------------------------------------------------------------------- /datagear-management/src/main/java/org/datagear/management/service/DtbsSourceService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-present datagear.tech 3 | * 4 | * This file is part of DataGear. 5 | * 6 | * DataGear is free software: you can redistribute it and/or modify it under the terms of 7 | * the GNU Lesser General Public License as published by the Free Software Foundation, 8 | * either version 3 of the License, or (at your option) any later version. 9 | * 10 | * DataGear is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 11 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | * See the GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License along with DataGear. 15 | * If not, see25 | * 参考{@linkplain DatabaseMetaData#getTypeInfo()}结果集{@code SEARCHABLE}列说明。 26 | *
27 | * 28 | * @author datagear@163.com 29 | * 30 | */ 31 | public enum SearchableType 32 | { 33 | /** 不可用于WHERE */ 34 | NO, 35 | 36 | /** 仅可用于WHERE中的LIKE */ 37 | ONLY_LIKE, 38 | 39 | /** 仅不可用于WHERE中的LIKE */ 40 | EXPCEPT_LIKE, 41 | 42 | /** 可用于WHERE中的任何情况 */ 43 | ALL 44 | } 45 | -------------------------------------------------------------------------------- /datagear-meta/src/main/java/org/datagear/meta/SimpleTable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-present datagear.tech 3 | * 4 | * This file is part of DataGear. 5 | * 6 | * DataGear is free software: you can redistribute it and/or modify it under the terms of 7 | * the GNU Lesser General Public License as published by the Free Software Foundation, 8 | * either version 3 of the License, or (at your option) any later version. 9 | * 10 | * DataGear is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 11 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | * See the GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License along with DataGear. 15 | * If not, see25 | * 此类继承自{@linkplain DBMetaResolver}的所有方法仅在{@linkplain #supports(java.sql.Connection)}返回{@code true}时可用。 26 | *
27 | * 28 | * @author datagear@163.com 29 | * 30 | */ 31 | public interface DevotedDBMetaResolver extends DBMetaResolver, ConnectionSensor 32 | { 33 | } 34 | -------------------------------------------------------------------------------- /datagear-meta/src/main/java/org/datagear/meta/resolver/WildcardDevotedDBMetaResolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-present datagear.tech 3 | * 4 | * This file is part of DataGear. 5 | * 6 | * DataGear is free software: you can redistribute it and/or modify it under the terms of 7 | * the GNU Lesser General Public License as published by the Free Software Foundation, 8 | * either version 3 of the License, or (at your option) any later version. 9 | * 10 | * DataGear is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 11 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | * See the GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License along with DataGear. 15 | * If not, see23 | * 此类用于获取、释放资源。 24 | *
25 | * 26 | * @author datagear@163.com 27 | * 28 | * @param23 | * 校验SQL语句对于指定{@linkplain DatabaseProfile}是否合法,比如是否包含不允许出现的关键字。 24 | *
25 | * 26 | * @author datagear@163.com 27 | * 28 | */ 29 | public interface SqlValidator 30 | { 31 | /** 32 | * 校验。 33 | * 34 | * @param sql 35 | * @param profile 36 | * @return 37 | */ 38 | SqlValidation validate(String sql, DatabaseProfile profile); 39 | } 40 | -------------------------------------------------------------------------------- /datagear-util/src/test/java/org/datagear/util/IDUtilTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-present datagear.tech 3 | * 4 | * This file is part of DataGear. 5 | * 6 | * DataGear is free software: you can redistribute it and/or modify it under the terms of 7 | * the GNU Lesser General Public License as published by the Free Software Foundation, 8 | * either version 3 of the License, or (at your option) any later version. 9 | * 10 | * DataGear is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 11 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | * See the GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License along with DataGear. 15 | * If not, see