Package | Description |
---|---|
cn.hutool.cron |
定时任务模块,提供类Crontab表达式的定时任务,实现参考了Cron4j,同时可以支持秒级别的定时任务定义和年的定义(同时兼容Crontab、Cron4j、Quartz表达式)
定时任务模块由三部分组成: Scheduler 定时任务调度器,用于整体管理任务的增删、启停和触发运行。 |
cn.hutool.db |
Hutool-db是一个在JDBC基础上封装的数据库操作工具类,通过包装,使用ActiveRecord思想操作数据库。
|
cn.hutool.db.ds |
数据源封装,对各类数据库连接池的封装
|
cn.hutool.db.ds.bee |
BeeCP封装
见:https://github.com/Chris2018998/BeeCP
|
cn.hutool.db.ds.c3p0 |
C3P0封装
|
cn.hutool.db.ds.dbcp |
DBCP封装
|
cn.hutool.db.ds.druid |
Druid封装
|
cn.hutool.db.ds.hikari |
Hikari封装
|
cn.hutool.db.ds.jndi |
JNDI封装
|
cn.hutool.db.ds.pooled |
Hutool对连接池的简单实现
|
cn.hutool.db.ds.simple |
JDBC中DriverManager简易封装
|
cn.hutool.db.ds.tomcat |
Tomcat-Pool封装
|
cn.hutool.db.nosql.mongo |
MongoDB数据库操作的封装
|
cn.hutool.db.nosql.redis |
Redis(Jedis)数据库操作的封装
|
cn.hutool.extra.mail |
邮件封装,基于javax-mail库,入口为MailUtil
|
cn.hutool.setting |
Setting模块主要针对Properties文件读写做封装,同时定义一套自己的配置文件规范,实现兼容性良好的配置工具。
|
cn.hutool.setting.profile |
配置环境封装,例如Profile可以自定义不同环境下的配置文件位置
|
Modifier and Type | Method and Description |
---|---|
Scheduler |
Scheduler.schedule(Setting cronSetting)
批量加入配置文件中的定时任务
配置文件格式为: xxx.xxx.xxx.Class.method = * * * * * |
static void |
CronUtil.schedule(Setting cronSetting)
批量加入配置文件中的定时任务
|
static void |
CronUtil.setCronSetting(Setting cronSetting)
自定义定时任务配置文件
|
Modifier and Type | Method and Description |
---|---|
static Setting |
GlobalDbConfig.createDbSetting()
获取自定义或默认位置数据库配置
Setting |
Modifier and Type | Method and Description |
---|---|
static void |
DbUtil.removeShowSqlParams(Setting setting)
移除配置文件中的Show SQL相关配置项
此方法用于移除用户配置在分组下的配置项目 |
static void |
DbUtil.setShowSqlGlobal(Setting setting)
从配置文件中读取SQL打印选项,读取后会去除相应属性
|
Modifier and Type | Method and Description |
---|---|
Setting |
AbstractDSFactory.getSetting()
获取配置,用于自定义添加配置项
|
Modifier and Type | Method and Description |
---|---|
static DSFactory |
DSFactory.create(Setting setting)
创建数据源实现工厂
此方法通过“试错”方式查找引入项目的连接池库,按照优先级寻找,一旦寻找到则创建对应的数据源工厂 连接池优先级:Hikari > Druid > Tomcat > Dbcp > C3p0 > Hutool Pooled |
protected abstract DataSource |
AbstractDSFactory.createDataSource(String jdbcUrl,
String driver,
String user,
String pass,
Setting poolSetting)
创建新的
DataSource |
Constructor and Description |
---|
AbstractDSFactory(String dataSourceName,
Class<? extends DataSource> dataSourceClass,
Setting setting)
构造
|
Modifier and Type | Method and Description |
---|---|
protected DataSource |
BeeDSFactory.createDataSource(String jdbcUrl,
String driver,
String user,
String pass,
Setting poolSetting) |
Constructor and Description |
---|
BeeDSFactory(Setting setting) |
Modifier and Type | Method and Description |
---|---|
protected DataSource |
C3p0DSFactory.createDataSource(String jdbcUrl,
String driver,
String user,
String pass,
Setting poolSetting) |
Constructor and Description |
---|
C3p0DSFactory(Setting setting)
构造
|
Modifier and Type | Method and Description |
---|---|
protected DataSource |
DbcpDSFactory.createDataSource(String jdbcUrl,
String driver,
String user,
String pass,
Setting poolSetting) |
Constructor and Description |
---|
DbcpDSFactory(Setting setting) |
Modifier and Type | Method and Description |
---|---|
protected DataSource |
DruidDSFactory.createDataSource(String jdbcUrl,
String driver,
String user,
String pass,
Setting poolSetting) |
Constructor and Description |
---|
DruidDSFactory(Setting setting)
构造
|
Modifier and Type | Method and Description |
---|---|
protected DataSource |
HikariDSFactory.createDataSource(String jdbcUrl,
String driver,
String user,
String pass,
Setting poolSetting) |
Constructor and Description |
---|
HikariDSFactory(Setting setting) |
Modifier and Type | Method and Description |
---|---|
protected DataSource |
JndiDSFactory.createDataSource(String jdbcUrl,
String driver,
String user,
String pass,
Setting poolSetting) |
Constructor and Description |
---|
JndiDSFactory(Setting setting) |
Modifier and Type | Method and Description |
---|---|
protected DataSource |
PooledDSFactory.createDataSource(String jdbcUrl,
String driver,
String user,
String pass,
Setting poolSetting) |
Constructor and Description |
---|
DbSetting(Setting setting)
构造
|
PooledDSFactory(Setting setting) |
Modifier and Type | Method and Description |
---|---|
protected DataSource |
SimpleDSFactory.createDataSource(String jdbcUrl,
String driver,
String user,
String pass,
Setting poolSetting) |
Constructor and Description |
---|
SimpleDataSource(Setting setting,
String group)
构造
|
SimpleDSFactory(Setting setting) |
Modifier and Type | Method and Description |
---|---|
protected DataSource |
TomcatDSFactory.createDataSource(String jdbcUrl,
String driver,
String user,
String pass,
Setting poolSetting) |
Constructor and Description |
---|
TomcatDSFactory(Setting setting)
构造
|
Modifier and Type | Method and Description |
---|---|
static MongoDS |
MongoFactory.getDS(Setting setting,
Collection<String> groups)
获取MongoDB数据源
|
static MongoDS |
MongoFactory.getDS(Setting setting,
String... groups)
获取MongoDB数据源
|
void |
MongoDS.setSetting(Setting setting)
设定MongoDB配置文件
|
Constructor and Description |
---|
MongoDS(Setting mongoSetting,
String... groups)
构造MongoDB数据源
当提供多个数据源时,这些数据源将为一个副本集或者mongos 调用者必须持有MongoDS实例,否则会被垃圾回收导致写入失败! |
MongoDS(Setting mongoSetting,
String host,
int port)
构造MongoDB数据源
调用者必须持有MongoDS实例,否则会被垃圾回收导致写入失败! |
Modifier and Type | Method and Description |
---|---|
static RedisDS |
RedisDS.create(Setting setting,
String group)
创建RedisDS
|
Constructor and Description |
---|
RedisDS(Setting setting,
String group)
构造
|
Constructor and Description |
---|
MailAccount(Setting setting)
构造
|
Modifier and Type | Method and Description |
---|---|
Setting |
Setting.addSetting(Setting setting)
添加一个Stting到主配置中
|
Setting |
Setting.clear(String group)
清除指定分组下的所有键值对
|
static Setting |
Setting.create()
构建一个空的Setting,用于手动加入参数
|
static Setting |
SettingUtil.get(String name)
获取当前环境下的配置文件
name可以为不包括扩展名的文件名(默认.setting为结尾),也可以是文件名全称 |
static Setting |
SettingUtil.getFirstFound(String... names)
获取给定路径找到的第一个配置文件
* name可以为不包括扩展名的文件名(默认.setting为结尾),也可以是文件名全称 |
Setting |
Setting.getSetting(String group)
获取group分组下所有配置键值对,组成新的Setting
|
Setting |
Setting.putAll(String group,
Map<? extends String,? extends String> m)
加入多个键值对到某个分组下
|
Setting |
Setting.set(String key,
String value)
设置值
|
Setting |
Setting.setByGroup(String key,
String group,
String value)
将键值对加入到对应分组中
此方法用于与getXXX统一参数顺序 |
Setting |
Setting.setCharset(Charset charset)
自定义字符编码
|
Setting |
Setting.setVarRegex(String regex)
设置变量的正则
正则只能有一个group表示变量本身,剩余为字符 例如 \$\{(name)\}表示${name}变量名为name的一个变量表示 |
Modifier and Type | Method and Description |
---|---|
Setting |
Setting.addSetting(Setting setting)
添加一个Stting到主配置中
|
Modifier and Type | Method and Description |
---|---|
Setting |
Profile.getSetting(String name)
获取当前环境下的配置文件
|
static Setting |
GlobalProfile.getSetting(String settingName)
获得全局的当前环境下对应的配置文件
|
Copyright © 2024. All rights reserved.