mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
package org.dromara.hutool.extra.aop.proxy;
|
||||
|
||||
import org.dromara.hutool.core.reflect.ConstructorUtil;
|
||||
import org.dromara.hutool.core.spi.ServiceLoaderUtil;
|
||||
import org.dromara.hutool.core.spi.SpiUtil;
|
||||
import org.dromara.hutool.extra.aop.aspects.Aspect;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -56,7 +56,7 @@ public interface ProxyFactory extends Serializable {
|
||||
* @return 代理工厂
|
||||
*/
|
||||
static ProxyFactory of() {
|
||||
return ServiceLoaderUtil.loadFirstAvailable(ProxyFactory.class);
|
||||
return SpiUtil.loadFirstAvailable(ProxyFactory.class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -13,12 +13,11 @@
|
||||
package org.dromara.hutool.extra.expression.engine;
|
||||
|
||||
import org.dromara.hutool.core.lang.Singleton;
|
||||
import org.dromara.hutool.core.spi.ServiceLoaderUtil;
|
||||
import org.dromara.hutool.core.spi.SpiUtil;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.log.StaticLog;
|
||||
|
||||
import org.dromara.hutool.extra.expression.ExpressionEngine;
|
||||
import org.dromara.hutool.extra.expression.ExpressionException;
|
||||
import org.dromara.hutool.log.StaticLog;
|
||||
|
||||
/**
|
||||
* 表达式语言引擎工厂类,用于根据用户引入的表达式jar,自动创建对应的引擎对象
|
||||
@@ -56,7 +55,7 @@ public class ExpressionFactory {
|
||||
* @return {@link ExpressionEngine}
|
||||
*/
|
||||
private static ExpressionEngine doCreate() {
|
||||
final ExpressionEngine engine = ServiceLoaderUtil.loadFirstAvailable(ExpressionEngine.class);
|
||||
final ExpressionEngine engine = SpiUtil.loadFirstAvailable(ExpressionEngine.class);
|
||||
if(null != engine){
|
||||
return engine;
|
||||
}
|
||||
|
@@ -13,12 +13,11 @@
|
||||
package org.dromara.hutool.extra.pinyin.engine;
|
||||
|
||||
import org.dromara.hutool.core.lang.Singleton;
|
||||
import org.dromara.hutool.core.spi.ServiceLoaderUtil;
|
||||
import org.dromara.hutool.core.spi.SpiUtil;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.log.StaticLog;
|
||||
|
||||
import org.dromara.hutool.extra.pinyin.PinyinEngine;
|
||||
import org.dromara.hutool.extra.pinyin.PinyinException;
|
||||
import org.dromara.hutool.log.StaticLog;
|
||||
|
||||
/**
|
||||
* 简单拼音引擎工厂,用于根据用户引入的拼音库jar,自动创建对应的拼音引擎对象
|
||||
@@ -55,7 +54,7 @@ public class PinyinFactory {
|
||||
* @return {@link PinyinEngine}
|
||||
*/
|
||||
private static PinyinEngine doCreate() {
|
||||
final PinyinEngine engine = ServiceLoaderUtil.loadFirstAvailable(PinyinEngine.class);
|
||||
final PinyinEngine engine = SpiUtil.loadFirstAvailable(PinyinEngine.class);
|
||||
if(null != engine){
|
||||
return engine;
|
||||
}
|
||||
|
@@ -14,8 +14,8 @@ package org.dromara.hutool.extra.template.engine;
|
||||
|
||||
import org.dromara.hutool.core.lang.Singleton;
|
||||
import org.dromara.hutool.core.reflect.ConstructorUtil;
|
||||
import org.dromara.hutool.core.spi.SpiUtil;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.spi.ServiceLoaderUtil;
|
||||
import org.dromara.hutool.extra.template.TemplateConfig;
|
||||
import org.dromara.hutool.extra.template.TemplateEngine;
|
||||
import org.dromara.hutool.extra.template.TemplateException;
|
||||
@@ -75,7 +75,7 @@ public class TemplateFactory {
|
||||
if(null != customEngineClass){
|
||||
engine = ConstructorUtil.newInstance(customEngineClass);
|
||||
}else{
|
||||
engine = ServiceLoaderUtil.loadFirstAvailable(TemplateEngine.class);
|
||||
engine = SpiUtil.loadFirstAvailable(TemplateEngine.class);
|
||||
}
|
||||
if(null != engine){
|
||||
return engine.init(config);
|
||||
|
@@ -13,7 +13,7 @@
|
||||
package org.dromara.hutool.extra.tokenizer.engine;
|
||||
|
||||
import org.dromara.hutool.core.lang.Singleton;
|
||||
import org.dromara.hutool.core.spi.ServiceLoaderUtil;
|
||||
import org.dromara.hutool.core.spi.SpiUtil;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.extra.tokenizer.TokenizerEngine;
|
||||
import org.dromara.hutool.extra.tokenizer.TokenizerException;
|
||||
@@ -55,7 +55,7 @@ public class TokenizerFactory {
|
||||
* @return {@link TokenizerEngine}
|
||||
*/
|
||||
private static TokenizerEngine doCreate() {
|
||||
final TokenizerEngine engine = ServiceLoaderUtil.loadFirstAvailable(TokenizerEngine.class);
|
||||
final TokenizerEngine engine = SpiUtil.loadFirstAvailable(TokenizerEngine.class);
|
||||
if(null != engine){
|
||||
return engine;
|
||||
}
|
||||
|
Reference in New Issue
Block a user