Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
.-Smile-.
spring-framework
提交
34b596c6
S
spring-framework
项目概览
.-Smile-.
/
spring-framework
与 Fork 源项目一致
从无法访问的项目Fork
通知
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 搜索 >>
提交
34b596c6
编写于
12月 09, 2015
作者:
S
Stephane Nicoll
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polish cache javadoc
Issue: SPR-13746
上级
0d6545f4
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
105 addition
and
4 deletion
+105
-4
spring-context/src/main/java/org/springframework/cache/annotation/CacheEvict.java
...java/org/springframework/cache/annotation/CacheEvict.java
+26
-0
spring-context/src/main/java/org/springframework/cache/annotation/CachePut.java
...n/java/org/springframework/cache/annotation/CachePut.java
+38
-0
spring-context/src/main/java/org/springframework/cache/annotation/Cacheable.java
.../java/org/springframework/cache/annotation/Cacheable.java
+37
-0
src/asciidoc/core-beans.adoc
src/asciidoc/core-beans.adoc
+2
-2
src/asciidoc/integration.adoc
src/asciidoc/integration.adoc
+2
-2
未找到文件。
spring-context/src/main/java/org/springframework/cache/annotation/CacheEvict.java
浏览文件 @
34b596c6
...
...
@@ -62,6 +62,20 @@ public @interface CacheEvict {
* Spring Expression Language (SpEL) expression for computing the key dynamically.
* <p>Default is {@code ""}, meaning all method parameters are considered as a key, unless
* a custom {@link #keyGenerator} has been set.
* <p>The SpEL expression evaluates again a dedicated context that provides the
* following meta-data:
* <ul>
* <li>{@code #result} for a reference to the result of the method invocation, which
* can only be used if {@link #beforeInvocation()} is {@code false}.</li>
* <li>{@code #root.method}, {@code #root.target} and {@code #root.caches} for a
* reference to the {@link java.lang.reflect.Method method}, target object and
* affected cache(s) respectively.</li>
* <li>Shortcuts for the method name ({@code #root.methodName}) and target class
* ({@code #root.targetClass}) are also available.
* <li>Method arguments can be accessed by index. For instance the second argument
* can be access via {@code #root.args[1]}, {@code #p1} or {@code #a1}. Arguments
* can also be accessed by name if that information is available.</li>
* </ul>
*/
String
key
()
default
""
;
...
...
@@ -92,6 +106,18 @@ public @interface CacheEvict {
* Spring Expression Language (SpEL) expression used for making the cache
* eviction operation conditional.
* <p>Default is {@code ""}, meaning the cache eviction is always performed.
* <p>The SpEL expression evaluates again a dedicated context that provides the
* following meta-data:
* <ul>
* <li>{@code #root.method}, {@code #root.target} and {@code #root.caches} for a
* reference to the {@link java.lang.reflect.Method method}, target object and
* affected cache(s) respectively.</li>
* <li>Shortcuts for the method name ({@code #root.methodName}) and target class
* ({@code #root.targetClass}) are also available.
* <li>Method arguments can be accessed by index. For instance the second argument
* can be access via {@code #root.args[1]}, {@code #p1} or {@code #a1}. Arguments
* can also be accessed by name if that information is available.</li>
* </ul>
*/
String
condition
()
default
""
;
...
...
spring-context/src/main/java/org/springframework/cache/annotation/CachePut.java
浏览文件 @
34b596c6
...
...
@@ -68,6 +68,19 @@ public @interface CachePut {
* Spring Expression Language (SpEL) expression for computing the key dynamically.
* <p>Default is {@code ""}, meaning all method parameters are considered as a key, unless
* a custom {@link #keyGenerator} has been set.
* <p>The SpEL expression evaluates again a dedicated context that provides the
* following meta-data:
* <ul>
* <li>{@code #result} for a reference to the result of the method invocation.</li>
* <li>{@code #root.method}, {@code #root.target} and {@code #root.caches} for a
* reference to the {@link java.lang.reflect.Method method}, target object and
* affected cache(s) respectively.</li>
* <li>Shortcuts for the method name ({@code #root.methodName}) and target class
* ({@code #root.targetClass}) are also available.
* <li>Method arguments can be accessed by index. For instance the second argument
* can be access via {@code #root.args[1]}, {@code #p1} or {@code #a1}. Arguments
* can also be accessed by name if that information is available.</li>
* </ul>
*/
String
key
()
default
""
;
...
...
@@ -98,6 +111,18 @@ public @interface CachePut {
* Spring Expression Language (SpEL) expression used for making the cache
* put operation conditional.
* <p>Default is {@code ""}, meaning the method result is always cached.
* <p>The SpEL expression evaluates again a dedicated context that provides the
* following meta-data:
* <ul>
* <li>{@code #root.method}, {@code #root.target} and {@code #root.caches} for a
* reference to the {@link java.lang.reflect.Method method}, target object and
* affected cache(s) respectively.</li>
* <li>Shortcuts for the method name ({@code #root.methodName}) and target class
* ({@code #root.targetClass}) are also available.
* <li>Method arguments can be accessed by index. For instance the second argument
* can be access via {@code #root.args[1]}, {@code #p1} or {@code #a1}. Arguments
* can also be accessed by name if that information is available.</li>
* </ul>
*/
String
condition
()
default
""
;
...
...
@@ -106,6 +131,19 @@ public @interface CachePut {
* <p>Unlike {@link #condition}, this expression is evaluated after the method
* has been called and can therefore refer to the {@code result}.
* <p>Default is {@code ""}, meaning that caching is never vetoed.
* <p>The SpEL expression evaluates again a dedicated context that provides the
* following meta-data:
* <ul>
* <li>{@code #result} for a reference to the result of the method invocation.</li>
* <li>{@code #root.method}, {@code #root.target} and {@code #root.caches} for a
* reference to the {@link java.lang.reflect.Method method}, target object and
* affected cache(s) respectively.</li>
* <li>Shortcuts for the method name ({@code #root.methodName}) and target class
* ({@code #root.targetClass}) are also available.
* <li>Method arguments can be accessed by index. For instance the second argument
* can be access via {@code #root.args[1]}, {@code #p1} or {@code #a1}. Arguments
* can also be accessed by name if that information is available.</li>
* </ul>
* @since 3.2
*/
String
unless
()
default
""
;
...
...
spring-context/src/main/java/org/springframework/cache/annotation/Cacheable.java
浏览文件 @
34b596c6
...
...
@@ -73,6 +73,18 @@ public @interface Cacheable {
* Spring Expression Language (SpEL) expression for computing the key dynamically.
* <p>Default is {@code ""}, meaning all method parameters are considered as a key,
* unless a custom {@link #keyGenerator} has been configured.
* <p>The SpEL expression evaluates again a dedicated context that provides the
* following meta-data:
* <ul>
* <li>{@code #root.method}, {@code #root.target} and {@code #root.caches} for a
* reference to the {@link java.lang.reflect.Method method}, target object and
* affected cache(s) respectively.</li>
* <li>Shortcuts for the method name ({@code #root.methodName}) and target class
* ({@code #root.targetClass}) are also available.
* <li>Method arguments can be accessed by index. For instance the second argument
* can be access via {@code #root.args[1]}, {@code #p1} or {@code #a1}. Arguments
* can also be accessed by name if that information is available.</li>
* </ul>
*/
String
key
()
default
""
;
...
...
@@ -103,6 +115,18 @@ public @interface Cacheable {
* Spring Expression Language (SpEL) expression used for making the method
* caching conditional.
* <p>Default is {@code ""}, meaning the method result is always cached.
* <p>The SpEL expression evaluates again a dedicated context that provides the
* following meta-data:
* <ul>
* <li>{@code #root.method}, {@code #root.target} and {@code #root.caches} for a
* reference to the {@link java.lang.reflect.Method method}, target object and
* affected cache(s) respectively.</li>
* <li>Shortcuts for the method name ({@code #root.methodName}) and target class
* ({@code #root.targetClass}) are also available.
* <li>Method arguments can be accessed by index. For instance the second argument
* can be access via {@code #root.args[1]}, {@code #p1} or {@code #a1}. Arguments
* can also be accessed by name if that information is available.</li>
* </ul>
*/
String
condition
()
default
""
;
...
...
@@ -111,6 +135,19 @@ public @interface Cacheable {
* <p>Unlike {@link #condition}, this expression is evaluated after the method
* has been called and can therefore refer to the {@code result}.
* <p>Default is {@code ""}, meaning that caching is never vetoed.
* <p>The SpEL expression evaluates again a dedicated context that provides the
* following meta-data:
* <ul>
* <li>{@code #result} for a reference to the result of the method invocation.</li>
* <li>{@code #root.method}, {@code #root.target} and {@code #root.caches} for a
* reference to the {@link java.lang.reflect.Method method}, target object and
* affected cache(s) respectively.</li>
* <li>Shortcuts for the method name ({@code #root.methodName}) and target class
* ({@code #root.targetClass}) are also available.
* <li>Method arguments can be accessed by index. For instance the second argument
* can be access via {@code #root.args[1]}, {@code #p1} or {@code #a1}. Arguments
* can also be accessed by name if that information is available.</li>
* </ul>
* @since 3.2
*/
String
unless
()
default
""
;
...
...
src/asciidoc/core-beans.adoc
浏览文件 @
34b596c6
...
...
@@ -8139,9 +8139,9 @@ available to the context so one can use them for conditional event processing:
| __argument name__
| evaluation context
| Name of any of the method argument. If for some reason the names are not available
(ex: no debug information), the argument names are also available under the `a<#arg>`
(ex: no debug information), the argument names are also available under the `
#
a<#arg>`
where __#arg__ stands for the argument index (starting from 0).
| `
iban` or `a0` (one can also use `p0` or `
p<#arg>` notation as an alias).
| `
#iban` or `#a0` (one can also use `#p0` or `#
p<#arg>` notation as an alias).
|===
Note that `#root.event` allows you to access to the underlying event, even if your method
...
...
src/asciidoc/integration.adoc
浏览文件 @
34b596c6
...
...
@@ -8463,9 +8463,9 @@ conditional computations:
| __argument name__
| evaluation context
| Name of any of the method argument. If for some reason the names are not available
(ex: no debug information), the argument names are also available under the `a
<
#arg
>
`
(ex: no debug information), the argument names are also available under the `
#
a
<
#arg
>
`
where __#arg__ stands for the argument index (starting from 0).
| `
iban` or `a0` (one can also use `p0` or `
p
<
#arg
>
` notation as an alias).
| `
#iban` or `#a0` (one can also use `#p0` or `#
p
<
#arg
>
` notation as an alias).
| result
| evaluation context
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录