Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
a583d84c
D
dragonwell8_langtools
项目概览
openanolis
/
dragonwell8_langtools
通知
0
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_langtools
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a583d84c
编写于
3月 20, 2013
作者:
D
darcy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8010364: Clarify javax.lang.model API for Type Annotations
Reviewed-by: jjg, abuckley
上级
c979f97e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
53 addition
and
16 deletion
+53
-16
src/share/classes/javax/lang/model/AnnotatedConstruct.java
src/share/classes/javax/lang/model/AnnotatedConstruct.java
+53
-15
src/share/classes/javax/lang/model/type/ExecutableType.java
src/share/classes/javax/lang/model/type/ExecutableType.java
+0
-1
未找到文件。
src/share/classes/javax/lang/model/AnnotatedConstruct.java
浏览文件 @
a583d84c
...
...
@@ -31,29 +31,64 @@ import javax.lang.model.element.*;
import
javax.lang.model.type.*
;
/**
* Represent
a construct that can have annotations
.
* Represent
s a construct that can be annotated
.
*
* When annotations are on an {@linkplain Element element},
* they are on a <em>declaration</em>. When annotations are on a {@linkplain
* TypeMirror type}, they are on a <em>use</em> of a type.
* A construct is either an {@linkplain
* javax.lang.model.element.Element element} or a {@linkplain
* javax.lang.model.type.TypeMirror type}. Annotations on an element
* are on a <em>declaration</em>, whereas annotations on a type are on
* a specific <em>use</em> of a type name.
*
* The terms <em>directly present</em> and <em>present</em> are used
* throughout this interface to describe precisely which annotations
* are returned by methods:
*
* <p>An annotation <i>A</i> is <em>directly present</em> on a
* construct <i>E</i> if <i>E</i> is annotated, and:
*
* <ul>
*
* <li> for an invocation of {@code getAnnotation(Class<T>)} or
* {@code getAnnotationMirrors()}, <i>E</i>'s annotations contain <i>A</i>.
*
* <li> for an invocation of getAnnotationsByType(Class<T>),
* <i>E</i>'s annotations either contain <i>A</i> or, if the type of
* <i>A</i> is repeatable, contain exactly one annotation whose value
* element contains <i>A</i> and whose type is the containing
* annotation type of <i>A</i>'s type.
*
* </ul>
*
* <p>An annotation A is <em>present</em> on a construct E if either:
*
* <ul>
* <li> <i>A</i> is <em>directly present</em> on <i>E</i>; or
*
* <li> <i>A</i> is not <em>directly present</em> on <i>E</i>, and
* <i>E</i> is an element representing a class, and <i>A</i>'s type
* is inheritable, and <i>A</i> is <em>present</em> on the element
* representing the superclass of <i>E</i>.
*
* </ul>
*
* @since 1.8
* @jls 9.6 Annotation Types
* @jls 9.6.3.3 @Inherited
*/
public
interface
AnnotatedConstruct
{
/**
* Returns the annotations that are
directly present on this
*
element or type use
.
* Returns the annotations that are
<em>directly present</em> on
*
this construct
.
*
* @return the annotations
directly present on this element or type use;
*
an empty list if there are none
* @return the annotations
<em>directly present</em> on this
*
construct;
an empty list if there are none
*/
List
<?
extends
AnnotationMirror
>
getAnnotationMirrors
();
/**
* Returns this element's or type use's annotation for the
* specified type if such an annotation is present, else {@code
* null}. The annotation may be either inherited or directly
* present on this element.
* Returns this construct's annotation of the
* specified type if such an annotation is <em>present</em>, else {@code
* null}.
*
* <p> The annotation returned by this method could contain an element
* whose value is of type {@code Class}.
...
...
@@ -94,18 +129,19 @@ public interface AnnotatedConstruct {
* @see IncompleteAnnotationException
* @see MirroredTypeException
* @see MirroredTypesException
* @jls 9.6.1 Annotation Type Elements
*/
<
A
extends
Annotation
>
A
getAnnotation
(
Class
<
A
>
annotationType
);
/**
* Returns annotations that are <em>present</em> on this
element or type use
.
* Returns annotations that are <em>present</em> on this
construct
.
*
* If there are no annotations <em>present</em> on this
element or type use
,
* If there are no annotations <em>present</em> on this
construct
,
* the return value is an array of length 0.
*
* The difference between this method and {@link #getAnnotation(Class)}
* is that this method detects if its argument is a <em>repeatable
* annotation type</em>
(JLS 9.6)
, and if so, attempts to find one or more
* annotation type</em>, and if so, attempts to find one or more
* annotations of that type by "looking through" a container annotation.
*
* <p> The annotations returned by this method could contain an element
...
...
@@ -147,6 +183,8 @@ public interface AnnotatedConstruct {
* @see IncompleteAnnotationException
* @see MirroredTypeException
* @see MirroredTypesException
* @jls 9.6 Annotation Types
* @jls 9.6.1 Annotation Type Elements
*/
<
A
extends
Annotation
>
A
[]
getAnnotationsByType
(
Class
<
A
>
annotationType
);
}
src/share/classes/javax/lang/model/type/ExecutableType.java
浏览文件 @
a583d84c
...
...
@@ -30,7 +30,6 @@ import java.util.List;
import
javax.lang.model.element.ExecutableElement
;
/**
* Represents the type of an executable. An <i>executable</i>
* is a method, constructor, or initializer.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录