浏览代码

jfinal 3.6

James 7 年之前
父节点
当前提交
d18be2539a
共有 1 个文件被更改,包括 6 次插入6 次删除
  1. 6 6
      src/main/java/com/jfinal/aop/AopFactory.java

+ 6 - 6
src/main/java/com/jfinal/aop/AopFactory.java

@@ -50,7 +50,7 @@ public class AopFactory {
 		Object ret;
 		if ( ! singleton ) {
 			ret = createObject(targetClass);
-			inject(targetClass, ret, injectDepth);
+			doInject(targetClass, ret, injectDepth);
 			return (T)ret;
 		}
 		
@@ -60,7 +60,7 @@ public class AopFactory {
 				ret = singletonCache.get(targetClass);
 				if (ret == null) {
 					ret = createObject(targetClass);
-					inject(targetClass, ret, injectDepth);
+					doInject(targetClass, ret, injectDepth);
 					singletonCache.put(targetClass, ret);
 				}
 			}
@@ -71,7 +71,7 @@ public class AopFactory {
 	
 	public <T> T inject(T targetObject) {
 		try {
-			inject(targetObject.getClass(), targetObject, injectDepth);
+			doInject(targetObject.getClass(), targetObject, injectDepth);
 			return targetObject;
 		} catch (ReflectiveOperationException e) {
 			throw new RuntimeException(e);
@@ -80,7 +80,7 @@ public class AopFactory {
 	
 	public <T> T inject(T targetObject, int injectDepth) {
 		try {
-			inject(targetObject.getClass(), targetObject, injectDepth);
+			doInject(targetObject.getClass(), targetObject, injectDepth);
 			return targetObject;
 		} catch (ReflectiveOperationException e) {
 			throw new RuntimeException(e);
@@ -89,11 +89,11 @@ public class AopFactory {
 	
 	// 方法原型的参数测试过可以是:Class<? super T> targetClass, T targetObject
 	public <T> T inject(Class<T> targetClass, T targetObject) throws ReflectiveOperationException {
-		inject(targetClass, targetObject, injectDepth);
+		doInject(targetClass, targetObject, injectDepth);
 		return targetObject;
 	}
 	
-	public void inject(Class<?> targetClass, Object targetObject, int injectDepth) throws ReflectiveOperationException {
+	protected void doInject(Class<?> targetClass, Object targetObject, int injectDepth) throws ReflectiveOperationException {
 		if ((injectDepth--) <= 0) {
 			return ;
 		}