Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
a8741dd3
S
spring-framework
项目概览
爱吃血肠
/
spring-framework
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-framework
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
a8741dd3
编写于
12月 26, 2016
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
上级
f8054276
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
29 addition
and
26 deletion
+29
-26
spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/DefaultAdvisorAutoProxyCreator.java
...p/framework/autoproxy/DefaultAdvisorAutoProxyCreator.java
+15
-14
spring-context/src/main/java/org/springframework/format/datetime/DateFormatter.java
...va/org/springframework/format/datetime/DateFormatter.java
+3
-2
spring-context/src/main/java/org/springframework/format/datetime/DateFormatterRegistrar.java
...ringframework/format/datetime/DateFormatterRegistrar.java
+10
-7
spring-context/src/main/java/org/springframework/format/datetime/DateTimeFormatAnnotationFormatterFactory.java
...at/datetime/DateTimeFormatAnnotationFormatterFactory.java
+1
-3
未找到文件。
spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/DefaultAdvisorAutoProxyCreator.java
浏览文件 @
a8741dd3
/*
* Copyright 2002-201
2
the original author or authors.
* Copyright 2002-201
6
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -19,15 +19,16 @@ package org.springframework.aop.framework.autoproxy;
import
org.springframework.beans.factory.BeanNameAware
;
/**
* BeanPostProcessor implementation that creates AOP proxies based on all candidate
* Advisors in the current BeanFactory. This class is completely generic; it contains
* no special code to handle any particular aspects, such as pooling aspects.
* {@code BeanPostProcessor} implementation that creates AOP proxies based on all
* candidate {@code Advisor}s in the current {@code BeanFactory}. This class is
* completely generic; it contains no special code to handle any particular aspects,
* such as pooling aspects.
*
* <p>It's possible to filter out advisors - for example, to use multiple post processors
* of this type in the same factory - by setting the {@code usePrefix} property
*
to true, in which case only advisors beginning with the DefaultAdvisorAutoProxyCreator's
*
bean name followed by a dot (like "aapc.") will be used. This default prefix can be
*
changed
from the bean name by setting the {@code advisorBeanNamePrefix} property.
* of this type in the same factory - by setting the {@code usePrefix} property
to true,
*
in which case only advisors beginning with the DefaultAdvisorAutoProxyCreator's bean
*
name followed by a dot (like "aapc.") will be used. This default prefix can be changed
* from the bean name by setting the {@code advisorBeanNamePrefix} property.
* The separator (.) will also be used in this case.
*
* @author Rod Johnson
...
...
@@ -40,22 +41,22 @@ public class DefaultAdvisorAutoProxyCreator extends AbstractAdvisorAutoProxyCrea
public
final
static
String
SEPARATOR
=
"."
;
private
boolean
usePrefix
;
private
boolean
usePrefix
=
false
;
private
String
advisorBeanNamePrefix
;
/**
* Set whether to exclude advisors with a certain prefix
* in the bean name.
* Set whether to only include advisors with a certain prefix in the bean name.
* <p>Default is {@code false}, including all beans of type {@code Advisor}.
* @see #setAdvisorBeanNamePrefix
*/
public
void
setUsePrefix
(
boolean
usePrefix
)
{
this
.
usePrefix
=
usePrefix
;
}
/**
* Return whether to exclude advisors with a certain prefix
* in the bean name.
* Return whether to only include advisors with a certain prefix in the bean name.
*/
public
boolean
isUsePrefix
()
{
return
this
.
usePrefix
;
...
...
@@ -89,7 +90,7 @@ public class DefaultAdvisorAutoProxyCreator extends AbstractAdvisorAutoProxyCrea
/**
* Consider
Advisor
beans with the specified prefix as eligible, if activated.
* Consider
{@code Advisor}
beans with the specified prefix as eligible, if activated.
* @see #setUsePrefix
* @see #setAdvisorBeanNamePrefix
*/
...
...
spring-context/src/main/java/org/springframework/format/datetime/DateFormatter.java
浏览文件 @
a8741dd3
...
...
@@ -27,7 +27,6 @@ import java.util.Map;
import
java.util.TimeZone
;
import
org.springframework.format.Formatter
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
org.springframework.format.annotation.DateTimeFormat.ISO
;
import
org.springframework.util.StringUtils
;
...
...
@@ -43,6 +42,8 @@ import org.springframework.util.StringUtils;
*/
public
class
DateFormatter
implements
Formatter
<
Date
>
{
private
static
final
TimeZone
UTC
=
TimeZone
.
getTimeZone
(
"UTC"
);
private
static
final
Map
<
ISO
,
String
>
ISO_PATTERNS
;
static
{
...
...
@@ -176,7 +177,7 @@ public class DateFormatter implements Formatter<Date> {
throw
new
IllegalStateException
(
"Unsupported ISO format "
+
this
.
iso
);
}
SimpleDateFormat
format
=
new
SimpleDateFormat
(
pattern
);
format
.
setTimeZone
(
TimeZone
.
getTimeZone
(
"UTC"
)
);
format
.
setTimeZone
(
UTC
);
return
format
;
}
if
(
StringUtils
.
hasLength
(
this
.
stylePattern
))
{
...
...
spring-context/src/main/java/org/springframework/format/datetime/DateFormatterRegistrar.java
浏览文件 @
a8741dd3
/*
* Copyright 2002-201
3
the original author or authors.
* Copyright 2002-201
6
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -26,14 +26,17 @@ import org.springframework.format.FormatterRegistry;
import
org.springframework.util.Assert
;
/**
* Configures Date formatting for use with Spring.
* Configures basic date formatting for use with Spring, primarily for
* {@link org.springframework.format.annotation.DateTimeFormat} declarations.
* Applies to fields of type {@link Date}, {@link Calendar} and {@code long}.
*
* <p>Designed for direct instantiation but also exposes the static
* {@link #addDateConverters(ConverterRegistry)} utility method for
ad hoc use
* against any {@code ConverterRegistry} instance.
* {@link #addDateConverters(ConverterRegistry)} utility method for
* a
d-hoc use a
gainst any {@code ConverterRegistry} instance.
*
* @author Phillip Webb
* @since 3.2
* @see org.springframework.format.datetime.standard.DateTimeFormatterRegistrar
* @see org.springframework.format.datetime.joda.JodaTimeFormatterRegistrar
* @see FormatterRegistrar#registerFormatters
*/
...
...
@@ -43,9 +46,9 @@ public class DateFormatterRegistrar implements FormatterRegistrar {
/**
* Set
the date formatter to register. If not specified no formatter is registered
.
*
This method can be used if global formatter configuration is required.
*
@param dateFormatter the date formatter
* Set
a global date formatter to register
.
*
<p>If not specified, no general formatter for non-annotated
*
{@link Date} and {@link Calendar} fields will be registered.
*/
public
void
setFormatter
(
DateFormatter
dateFormatter
)
{
Assert
.
notNull
(
dateFormatter
,
"DateFormatter must not be null"
);
...
...
spring-context/src/main/java/org/springframework/format/datetime/DateTimeFormatAnnotationFormatterFactory.java
浏览文件 @
a8741dd3
...
...
@@ -30,8 +30,7 @@ import org.springframework.format.Printer;
import
org.springframework.format.annotation.DateTimeFormat
;
/**
* Formats fields annotated with the {@link DateTimeFormat} annotation using
* a {@link DateFormatter}.
* Formats fields annotated with the {@link DateTimeFormat} annotation using a {@link DateFormatter}.
*
* @author Phillip Webb
* @since 3.2
...
...
@@ -40,7 +39,6 @@ import org.springframework.format.annotation.DateTimeFormat;
public
class
DateTimeFormatAnnotationFormatterFactory
extends
EmbeddedValueResolutionSupport
implements
AnnotationFormatterFactory
<
DateTimeFormat
>
{
private
static
final
Set
<
Class
<?>>
FIELD_TYPES
;
static
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录