Skip to content

Commit fefa055

Browse files
committed
格式化代码
格式化
1 parent aac3e3a commit fefa055

File tree

111 files changed

+3646
-2945
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+3646
-2945
lines changed

src/main/java/com/thinkgem/jeesite/common/beanvalidator/BeanValidators.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
* JSR303 Validator(Hibernate Validator)工具类.
2121
*
2222
* ConstraintViolation中包含propertyPath, message 和invalidValue等信息.
23-
* 提供了各种convert方法,适合不同的i18n需求:
24-
* 1. List<String>, String内容为message
25-
* 2. List<String>, String内容为propertyPath + separator + message
26-
* 3. Map<propertyPath, message>
23+
* 提供了各种convert方法,适合不同的i18n需求: 1. List<String>, String内容为message 2.
24+
* List<String>, String内容为propertyPath + separator + message 3.
25+
* Map<propertyPath, message>
2726
*
2827
* 详情见wiki: https://github.com/springside/springside4/wiki/HibernateValidator
28+
*
2929
* @author calvin
3030
* @version 2013-01-15
3131
*/
@@ -35,8 +35,9 @@ public class BeanValidators {
3535
* 调用JSR303的validate方法, 验证失败时抛出ConstraintViolationException.
3636
*/
3737
@SuppressWarnings({ "unchecked", "rawtypes" })
38-
public static void validateWithException(Validator validator, Object object, Class<?>... groups)
38+
public static void validateWithException(Validator validator, Object object, Class<?>... groups)
3939
throws ConstraintViolationException {
40+
4041
Set constraintViolations = validator.validate(object, groups);
4142
if (!constraintViolations.isEmpty()) {
4243
throw new ConstraintViolationException(constraintViolations);
@@ -107,8 +108,9 @@ public static List<String> extractPropertyAndMessageAsList(ConstraintViolationEx
107108
* 辅助方法, 转换Set<ConstraintViolation>为List<propertyPath +separator+ message>.
108109
*/
109110
@SuppressWarnings("rawtypes")
110-
public static List<String> extractPropertyAndMessageAsList(Set<? extends ConstraintViolation> constraintViolations,
111-
String separator) {
111+
public static List<String> extractPropertyAndMessageAsList(
112+
Set<? extends ConstraintViolation> constraintViolations,String separator) {
113+
112114
List<String> errorMessages = Lists.newArrayList();
113115
for (ConstraintViolation violation : constraintViolations) {
114116
errorMessages.add(violation.getPropertyPath() + separator + violation.getMessage());

src/main/java/com/thinkgem/jeesite/common/config/Global.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,56 +14,57 @@
1414

1515
/**
1616
* 全局配置类
17+
*
1718
* @author ThinkGem
1819
* @version 2013-03-23
1920
*/
2021
public class Global {
21-
22+
2223
/**
2324
* 保存全局属性值
2425
*/
2526
private static Map<String, String> map = Maps.newHashMap();
26-
27+
2728
/**
2829
* 属性文件加载对象
2930
*/
3031
private static PropertiesLoader propertiesLoader = new PropertiesLoader("jeesite.properties");
31-
32+
3233
/**
3334
* 获取配置
3435
*/
3536
public static String getConfig(String key) {
3637
String value = map.get(key);
37-
if (value == null){
38+
if (value == null) {
3839
value = propertiesLoader.getProperty(key);
3940
map.put(key, value);
4041
}
4142
return value;
4243
}
4344

4445
/////////////////////////////////////////////////////////
45-
46+
4647
/**
4748
* 获取管理端根路径
4849
*/
4950
public static String getAdminPath() {
5051
return getConfig("adminPath");
5152
}
52-
53+
5354
/**
5455
* 获取前端根路径
5556
*/
5657
public static String getFrontPath() {
5758
return getConfig("frontPath");
5859
}
59-
60+
6061
/**
6162
* 获取URL后缀
6263
*/
6364
public static String getUrlSuffix() {
6465
return getConfig("urlSuffix");
6566
}
66-
67+
6768
/**
6869
* 是否是演示模式,演示模式下不能修改用户、角色、密码、菜单、授权
6970
*/
@@ -74,15 +75,16 @@ public static Boolean isDemoMode() {
7475

7576
/**
7677
* 获取CKFinder上传文件的根目录
78+
*
7779
* @return
7880
*/
7981
public static String getCkBaseDir() {
8082
String dir = getConfig("userfiles.basedir");
8183
Assert.hasText(dir, "配置文件里没有配置userfiles.basedir属性");
82-
if(!dir.endsWith("/")) {
84+
if (!dir.endsWith("/")) {
8385
dir += "/";
8486
}
8587
return dir;
8688
}
87-
89+
8890
}

src/main/java/com/thinkgem/jeesite/common/filter/PageCachingFilter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
/**
99
* 页面高速缓存过滤器
10+
*
1011
* @author ThinkGem
1112
* @version 2013-8-5
1213
*/
@@ -16,5 +17,5 @@ public class PageCachingFilter extends SimplePageCachingFilter {
1617
protected CacheManager getCacheManager() {
1718
return CacheUtils.getCacheManager();
1819
}
19-
20+
2021
}

src/main/java/com/thinkgem/jeesite/common/log/Log4jManager.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ public void setRootLoggerLevel(String newLevel) {
4747
}
4848

4949
/**
50-
* 获得项目默认logger的级别.
51-
* 项目默认logger名称通过#setProjectLoggerName(String)配置.
50+
* 获得项目默认logger的级别. 项目默认logger名称通过#setProjectLoggerName(String)配置.
5251
*/
5352
@ManagedAttribute(description = "Level of the project default package logger")
5453
public String getProjectLoggerLevel() {
@@ -60,8 +59,7 @@ public String getProjectLoggerLevel() {
6059
}
6160

6261
/**
63-
* 设置项目默认logger的级别.
64-
* 项目默认logger名称通过#setProjectLoggerName(String)配置.
62+
* 设置项目默认logger的级别. 项目默认logger名称通过#setProjectLoggerName(String)配置.
6563
*/
6664
@ManagedAttribute
6765
public void setProjectLoggerLevel(String newLevel) {
@@ -81,11 +79,11 @@ public String getLoggerLevel(String loggerName) {
8179
}
8280

8381
/**
84-
* 设置Logger的日志级别.
85-
* 如果日志级别名称错误, 设为DEBUG.
82+
* 设置Logger的日志级别. 如果日志级别名称错误, 设为DEBUG.
8683
*/
8784
@ManagedOperation(description = "Set new logging level to the logger")
88-
@ManagedOperationParameters({ @ManagedOperationParameter(name = "loggerName", description = "Logger name"),
85+
@ManagedOperationParameters({
86+
@ManagedOperationParameter(name = "loggerName", description = "Logger name"),
8987
@ManagedOperationParameter(name = "newlevel", description = "New level") })
9088
public void setLoggerLevel(String loggerName, String newLevel) {
9189
Logger logger = Logger.getLogger(loggerName);

src/main/java/com/thinkgem/jeesite/common/mapper/BeanMapper.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414

1515
/**
1616
* 简单封装Dozer, 实现深度转换Bean<->Bean的Mapper.实现:
17-
*
18-
* 1. 持有Mapper的单例.
19-
* 2. 返回值类型转换.
20-
* 3. 批量转换Collection中的所有对象.
21-
* 4. 区分创建新的B对象与将对象A值复制到已存在的B对象两种函数.
17+
*
18+
* <p>1. 持有Mapper的单例. <p/>
19+
* <p>2. 返回值类型转换. <p/>
20+
* <p>3. 批量转换Collection中的所有对象. <p/>
21+
* <p>4.区分创建新的B对象与将对象A值复制到已存在的B对象两种函数. <p/>
2222
*
2323
* @author calvin
2424
* @version 2013-01-15

src/main/java/com/thinkgem/jeesite/common/mapper/JaxbMapper.java

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929
/**
3030
* 使用Jaxb2.0实现XML<->Java Object的Mapper.
3131
*
32-
* 在创建时需要设定所有需要序列化的Root对象的Class.
33-
* 特别支持Root对象是Collection的情形.
32+
* 在创建时需要设定所有需要序列化的Root对象的Class. 特别支持Root对象是Collection的情形.
3433
*
3534
* @author calvin
3635
* @version 2013-01-15
@@ -84,8 +83,8 @@ public static String toXml(Collection<?> root, String rootName, Class clazz, Str
8483
CollectionWrapper wrapper = new CollectionWrapper();
8584
wrapper.collection = root;
8685

87-
JAXBElement<CollectionWrapper> wrapperElement = new JAXBElement<CollectionWrapper>(new QName(rootName),
88-
CollectionWrapper.class, wrapper);
86+
JAXBElement<CollectionWrapper> wrapperElement = new JAXBElement<CollectionWrapper>(
87+
new QName(rootName), CollectionWrapper.class, wrapper);
8988

9089
StringWriter writer = new StringWriter();
9190
createMarshaller(clazz, encoding).marshal(wrapperElement, writer);
@@ -110,16 +109,16 @@ public static <T> T fromXml(String xml, Class<T> clazz) {
110109
}
111110

112111
/**
113-
* 创建Marshaller并设定encoding(可为null).
114-
* 线程不安全,需要每次创建或pooling。
112+
* 创建Marshaller并设定encoding(可为null). 线程不安全,需要每次创建或pooling。
115113
*/
116114
public static Marshaller createMarshaller(Class clazz, String encoding) {
117115
try {
118116
JAXBContext jaxbContext = getJaxbContext(clazz);
119117

120118
Marshaller marshaller = jaxbContext.createMarshaller();
121119

122-
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
120+
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,
121+
Boolean.TRUE);
123122

124123
if (StringUtils.isNotBlank(encoding)) {
125124
marshaller.setProperty(Marshaller.JAXB_ENCODING, encoding);
@@ -132,8 +131,7 @@ public static Marshaller createMarshaller(Class clazz, String encoding) {
132131
}
133132

134133
/**
135-
* 创建UnMarshaller.
136-
* 线程不安全,需要每次创建或pooling。
134+
* 创建UnMarshaller. 线程不安全,需要每次创建或pooling。
137135
*/
138136
public static Unmarshaller createUnmarshaller(Class clazz) {
139137
try {
@@ -152,8 +150,8 @@ protected static JAXBContext getJaxbContext(Class clazz) {
152150
jaxbContext = JAXBContext.newInstance(clazz, CollectionWrapper.class);
153151
jaxbContexts.putIfAbsent(clazz, jaxbContext);
154152
} catch (JAXBException ex) {
155-
throw new HttpMessageConversionException("Could not instantiate JAXBContext for class [" + clazz
156-
+ "]: " + ex.getMessage(), ex);
153+
throw new HttpMessageConversionException(
154+
"Could not instantiate JAXBContext for class [" + clazz + "]: " + ex.getMessage(), ex);
157155
}
158156
}
159157
return jaxbContext;
@@ -167,5 +165,5 @@ public static class CollectionWrapper {
167165
@XmlAnyElement
168166
protected Collection<?> collection;
169167
}
170-
168+
171169
}

0 commit comments

Comments
 (0)