Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
后端镜像
java镜像
Springside4
提交
dd7d68d1
S
Springside4
项目概览
后端镜像
/
java镜像
/
Springside4
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Springside4
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
dd7d68d1
编写于
7月 24, 2012
作者:
C
Calvin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#21 将sprignside-core 部分类移动到springside-extension项目
上级
281a21b8
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
27 addition
and
19 deletion
+27
-19
modules/core/src/main/java/org/springside/modules/orm/Hibernates.java
.../src/main/java/org/springside/modules/orm/Hibernates.java
+2
-1
modules/core/src/main/java/org/springside/modules/utils/Exceptions.java
...rc/main/java/org/springside/modules/utils/Exceptions.java
+2
-2
modules/core/src/main/java/org/springside/modules/utils/PropertiesLoader.java
...n/java/org/springside/modules/utils/PropertiesLoader.java
+10
-13
modules/extension/src/main/java/org/springside/modules/log/Log4jManager.java
...rc/main/java/org/springside/modules/log/Log4jManager.java
+0
-1
modules/extension/src/main/java/org/springside/modules/tools/FreeMarkers.java
...c/main/java/org/springside/modules/tools/FreeMarkers.java
+11
-1
modules/extension/src/main/java/org/springside/modules/web/Servlets.java
...on/src/main/java/org/springside/modules/web/Servlets.java
+0
-0
modules/extension/src/test/java/org/springside/modules/log/Log4jManagerTest.java
...est/java/org/springside/modules/log/Log4jManagerTest.java
+0
-0
modules/extension/src/test/java/org/springside/modules/tools/FreemarkersTest.java
...st/java/org/springside/modules/tools/FreemarkersTest.java
+2
-1
modules/extension/src/test/java/org/springside/modules/web/ServletsTest.java
...rc/test/java/org/springside/modules/web/ServletsTest.java
+0
-0
modules/extension/src/test/resources/testTemplate.ftl
modules/extension/src/test/resources/testTemplate.ftl
+0
-0
未找到文件。
modules/core/src/main/java/org/springside/modules/orm/Hibernates.java
浏览文件 @
dd7d68d1
...
@@ -14,8 +14,9 @@ import org.hibernate.dialect.Oracle10gDialect;
...
@@ -14,8 +14,9 @@ import org.hibernate.dialect.Oracle10gDialect;
public
class
Hibernates
{
public
class
Hibernates
{
/**
/**
* Initialize the lazy property value
, eg
.
* Initialize the lazy property value.
*
*
* eg.
* Hibernates.initLazyProperty(user.getGroups());
* Hibernates.initLazyProperty(user.getGroups());
*/
*/
public
static
void
initLazyProperty
(
Object
proxyedPropertyValue
)
{
public
static
void
initLazyProperty
(
Object
proxyedPropertyValue
)
{
...
...
modules/core/src/main/java/org/springside/modules/utils/Exceptions.java
浏览文件 @
dd7d68d1
...
@@ -38,10 +38,10 @@ public class Exceptions {
...
@@ -38,10 +38,10 @@ public class Exceptions {
/**
/**
* 判断异常是否由某些底层的异常引起.
* 判断异常是否由某些底层的异常引起.
*/
*/
public
static
boolean
isCausedBy
(
Exception
ex
,
Class
...
causeExceptionClasses
)
{
public
static
boolean
isCausedBy
(
Exception
ex
,
Class
<?
extends
Exception
>
...
causeExceptionClasses
)
{
Throwable
cause
=
ex
.
getCause
();
Throwable
cause
=
ex
.
getCause
();
while
(
cause
!=
null
)
{
while
(
cause
!=
null
)
{
for
(
Class
causeClass
:
causeExceptionClasses
)
{
for
(
Class
<?
extends
Exception
>
causeClass
:
causeExceptionClasses
)
{
if
(
causeClass
.
isInstance
(
cause
))
{
if
(
causeClass
.
isInstance
(
cause
))
{
return
true
;
return
true
;
}
}
...
...
modules/core/src/main/java/org/springside/modules/utils/PropertiesLoader.java
浏览文件 @
dd7d68d1
...
@@ -20,10 +20,7 @@ import org.springframework.core.io.Resource;
...
@@ -20,10 +20,7 @@ import org.springframework.core.io.Resource;
import
org.springframework.core.io.ResourceLoader
;
import
org.springframework.core.io.ResourceLoader
;
/**
/**
* Properties文件载入工具类. 可载入多个properties文件, 相同的属性在最后载入的文件中的值将会覆盖之前的值.
* Properties文件载入工具类. 可载入多个properties文件, 相同的属性在最后载入的文件中的值将会覆盖之前的值,但以System的Property优先.
*
* 本类有两种使用方法:
* 1.
*
*
* @author calvin
* @author calvin
*/
*/
...
@@ -44,7 +41,7 @@ public class PropertiesLoader {
...
@@ -44,7 +41,7 @@ public class PropertiesLoader {
}
}
/**
/**
* 取出Property
,但以System的Property优先.
* 取出Property
。
*/
*/
private
String
getValue
(
String
key
)
{
private
String
getValue
(
String
key
)
{
String
systemProperty
=
System
.
getProperty
(
key
);
String
systemProperty
=
System
.
getProperty
(
key
);
...
@@ -55,7 +52,7 @@ public class PropertiesLoader {
...
@@ -55,7 +52,7 @@ public class PropertiesLoader {
}
}
/**
/**
* 取出String类型的Property
,但以System的Property优先
,如果都為Null则抛出异常.
* 取出String类型的Property,如果都為Null则抛出异常.
*/
*/
public
String
getProperty
(
String
key
)
{
public
String
getProperty
(
String
key
)
{
String
value
=
getValue
(
key
);
String
value
=
getValue
(
key
);
...
@@ -66,7 +63,7 @@ public class PropertiesLoader {
...
@@ -66,7 +63,7 @@ public class PropertiesLoader {
}
}
/**
/**
* 取出String类型的Property
,但以System的Property优先
.如果都為Null則返回Default值.
* 取出String类型的Property.如果都為Null則返回Default值.
*/
*/
public
String
getProperty
(
String
key
,
String
defaultValue
)
{
public
String
getProperty
(
String
key
,
String
defaultValue
)
{
String
value
=
getValue
(
key
);
String
value
=
getValue
(
key
);
...
@@ -74,7 +71,7 @@ public class PropertiesLoader {
...
@@ -74,7 +71,7 @@ public class PropertiesLoader {
}
}
/**
/**
* 取出Integer类型的Property
,但以System的Property优先
.如果都為Null或内容错误则抛出异常.
* 取出Integer类型的Property.如果都為Null或内容错误则抛出异常.
*/
*/
public
Integer
getInteger
(
String
key
)
{
public
Integer
getInteger
(
String
key
)
{
String
value
=
getValue
(
key
);
String
value
=
getValue
(
key
);
...
@@ -85,7 +82,7 @@ public class PropertiesLoader {
...
@@ -85,7 +82,7 @@ public class PropertiesLoader {
}
}
/**
/**
* 取出Integer类型的Property
,但以System的Property优先
.如果都為Null則返回Default值,如果内容错误则抛出异常
* 取出Integer类型的Property.如果都為Null則返回Default值,如果内容错误则抛出异常
*/
*/
public
Integer
getInteger
(
String
key
,
Integer
defaultValue
)
{
public
Integer
getInteger
(
String
key
,
Integer
defaultValue
)
{
String
value
=
getValue
(
key
);
String
value
=
getValue
(
key
);
...
@@ -93,7 +90,7 @@ public class PropertiesLoader {
...
@@ -93,7 +90,7 @@ public class PropertiesLoader {
}
}
/**
/**
* 取出Double类型的Property
,但以System的Property优先
.如果都為Null或内容错误则抛出异常.
* 取出Double类型的Property.如果都為Null或内容错误则抛出异常.
*/
*/
public
Double
getDouble
(
String
key
)
{
public
Double
getDouble
(
String
key
)
{
String
value
=
getValue
(
key
);
String
value
=
getValue
(
key
);
...
@@ -104,7 +101,7 @@ public class PropertiesLoader {
...
@@ -104,7 +101,7 @@ public class PropertiesLoader {
}
}
/**
/**
* 取出Double类型的Property
,但以System的Property优先
.如果都為Null則返回Default值,如果内容错误则抛出异常
* 取出Double类型的Property.如果都為Null則返回Default值,如果内容错误则抛出异常
*/
*/
public
Double
getDouble
(
String
key
,
Integer
defaultValue
)
{
public
Double
getDouble
(
String
key
,
Integer
defaultValue
)
{
String
value
=
getValue
(
key
);
String
value
=
getValue
(
key
);
...
@@ -112,7 +109,7 @@ public class PropertiesLoader {
...
@@ -112,7 +109,7 @@ public class PropertiesLoader {
}
}
/**
/**
* 取出Boolean类型的Property
,但以System的Property优先
.如果都為Null抛出异常,如果内容不是true/false则返回false.
* 取出Boolean类型的Property.如果都為Null抛出异常,如果内容不是true/false则返回false.
*/
*/
public
Boolean
getBoolean
(
String
key
)
{
public
Boolean
getBoolean
(
String
key
)
{
String
value
=
getValue
(
key
);
String
value
=
getValue
(
key
);
...
@@ -123,7 +120,7 @@ public class PropertiesLoader {
...
@@ -123,7 +120,7 @@ public class PropertiesLoader {
}
}
/**
/**
* 取出Boolean类型的Propert
y,但以System的Property优先
.如果都為Null則返回Default值,如果内容不为true/false则返回false.
* 取出Boolean类型的Propert.如果都為Null則返回Default值,如果内容不为true/false则返回false.
*/
*/
public
Boolean
getBoolean
(
String
key
,
boolean
defaultValue
)
{
public
Boolean
getBoolean
(
String
key
,
boolean
defaultValue
)
{
String
value
=
getValue
(
key
);
String
value
=
getValue
(
key
);
...
...
modules/
core
/src/main/java/org/springside/modules/log/Log4jManager.java
→
modules/
extension
/src/main/java/org/springside/modules/log/Log4jManager.java
浏览文件 @
dd7d68d1
...
@@ -99,5 +99,4 @@ public class Log4jManager {
...
@@ -99,5 +99,4 @@ public class Log4jManager {
public
void
setProjectLoggerName
(
String
projectLoggerName
)
{
public
void
setProjectLoggerName
(
String
projectLoggerName
)
{
this
.
projectLoggerName
=
projectLoggerName
;
this
.
projectLoggerName
=
projectLoggerName
;
}
}
}
}
\ No newline at end of file
modules/
core/src/main/java/org/springside/modules/uti
ls/FreeMarkers.java
→
modules/
extension/src/main/java/org/springside/modules/too
ls/FreeMarkers.java
浏览文件 @
dd7d68d1
package
org.springside.modules.
uti
ls
;
package
org.springside.modules.
too
ls
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.StringReader
;
import
java.io.StringReader
;
...
@@ -7,12 +7,16 @@ import java.util.Map;
...
@@ -7,12 +7,16 @@ import java.util.Map;
import
org.springframework.core.io.DefaultResourceLoader
;
import
org.springframework.core.io.DefaultResourceLoader
;
import
org.springframework.core.io.Resource
;
import
org.springframework.core.io.Resource
;
import
org.springside.modules.utils.Exceptions
;
import
freemarker.template.Configuration
;
import
freemarker.template.Configuration
;
import
freemarker.template.Template
;
import
freemarker.template.Template
;
public
class
FreeMarkers
{
public
class
FreeMarkers
{
/**
* 渲染模板字符串。
*/
public
static
String
rendereString
(
String
templateString
,
Map
<
String
,
?>
model
)
{
public
static
String
rendereString
(
String
templateString
,
Map
<
String
,
?>
model
)
{
try
{
try
{
StringWriter
result
=
new
StringWriter
();
StringWriter
result
=
new
StringWriter
();
...
@@ -24,6 +28,9 @@ public class FreeMarkers {
...
@@ -24,6 +28,9 @@ public class FreeMarkers {
}
}
}
}
/**
* 渲染Template文件.
*/
public
static
String
renderTemplate
(
Template
template
,
Object
model
)
{
public
static
String
renderTemplate
(
Template
template
,
Object
model
)
{
try
{
try
{
StringWriter
result
=
new
StringWriter
();
StringWriter
result
=
new
StringWriter
();
...
@@ -34,6 +41,9 @@ public class FreeMarkers {
...
@@ -34,6 +41,9 @@ public class FreeMarkers {
}
}
}
}
/**
* 创建默认配置,设定模板目录.
*/
public
static
Configuration
buildConfiguration
(
String
directory
)
throws
IOException
{
public
static
Configuration
buildConfiguration
(
String
directory
)
throws
IOException
{
Configuration
cfg
=
new
Configuration
();
Configuration
cfg
=
new
Configuration
();
Resource
path
=
new
DefaultResourceLoader
().
getResource
(
directory
);
Resource
path
=
new
DefaultResourceLoader
().
getResource
(
directory
);
...
...
modules/
core
/src/main/java/org/springside/modules/web/Servlets.java
→
modules/
extension
/src/main/java/org/springside/modules/web/Servlets.java
浏览文件 @
dd7d68d1
文件已移动
modules/
core
/src/test/java/org/springside/modules/log/Log4jManagerTest.java
→
modules/
extension
/src/test/java/org/springside/modules/log/Log4jManagerTest.java
浏览文件 @
dd7d68d1
文件已移动
modules/
core/src/test/java/org/springside/modules/uti
ls/FreemarkersTest.java
→
modules/
extension/src/test/java/org/springside/modules/too
ls/FreemarkersTest.java
浏览文件 @
dd7d68d1
package
org.springside.modules.
uti
ls
;
package
org.springside.modules.
too
ls
;
import
static
org
.
junit
.
Assert
.*;
import
static
org
.
junit
.
Assert
.*;
...
@@ -6,6 +6,7 @@ import java.io.IOException;
...
@@ -6,6 +6,7 @@ import java.io.IOException;
import
java.util.Map
;
import
java.util.Map
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.springside.modules.tools.FreeMarkers
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
...
...
modules/
core
/src/test/java/org/springside/modules/web/ServletsTest.java
→
modules/
extension
/src/test/java/org/springside/modules/web/ServletsTest.java
浏览文件 @
dd7d68d1
文件已移动
modules/
core
/src/test/resources/testTemplate.ftl
→
modules/
extension
/src/test/resources/testTemplate.ftl
浏览文件 @
dd7d68d1
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录