Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
056f95d7
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看板
提交
056f95d7
编写于
1月 18, 2012
作者:
D
darcy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7130768: Clarify behavior of Element.getEnclosingElements in subtypes
Reviewed-by: mcimadamore, jjg
上级
ffc17fe6
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
33 addition
and
12 deletion
+33
-12
src/share/classes/javax/lang/model/element/Element.java
src/share/classes/javax/lang/model/element/Element.java
+9
-8
src/share/classes/javax/lang/model/element/PackageElement.java
...hare/classes/javax/lang/model/element/PackageElement.java
+16
-2
src/share/classes/javax/lang/model/element/TypeElement.java
src/share/classes/javax/lang/model/element/TypeElement.java
+8
-2
未找到文件。
src/share/classes/javax/lang/model/element/Element.java
浏览文件 @
056f95d7
/*
/*
* Copyright (c) 2005, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 201
2
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -214,14 +214,13 @@ public interface Element {
...
@@ -214,14 +214,13 @@ public interface Element {
* Returns the elements that are, loosely speaking, directly
* Returns the elements that are, loosely speaking, directly
* enclosed by this element.
* enclosed by this element.
*
*
* A class or interface is considered to enclose the fields,
* A {@linkplain TypeElement#getEnclosedElements class or
* methods, constructors, and member types that it directly
* interface} is considered to enclose the fields, methods,
* declares. This includes any (implicit) default constructor and
* constructors, and member types that it directly declares.
* the implicit {@code values} and {@code valueOf} methods of an
* enum type.
*
*
* A package encloses the top-level classes and interfaces within
* A {@linkplain PackageElement#getEnclosedElements package}
* it, but is not considered to enclose subpackages.
* encloses the top-level classes and interfaces within it, but is
* not considered to enclose subpackages.
*
*
* Other kinds of elements are not currently considered to enclose
* Other kinds of elements are not currently considered to enclose
* any elements; however, that may change as this API or the
* any elements; however, that may change as this API or the
...
@@ -231,6 +230,8 @@ public interface Element {
...
@@ -231,6 +230,8 @@ public interface Element {
* methods in {@link ElementFilter}.
* methods in {@link ElementFilter}.
*
*
* @return the enclosed elements, or an empty list if none
* @return the enclosed elements, or an empty list if none
* @see PackageElement#getEnclosedElements
* @see TypeElement#getEnclosedElements
* @see Elements#getAllMembers
* @see Elements#getAllMembers
* @jls 8.8.9 Default Constructor
* @jls 8.8.9 Default Constructor
* @jls 8.9 Enums
* @jls 8.9 Enums
...
...
src/share/classes/javax/lang/model/element/PackageElement.java
浏览文件 @
056f95d7
/*
/*
* Copyright (c) 2005, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 201
2
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -25,6 +25,8 @@
...
@@ -25,6 +25,8 @@
package
javax.lang.model.element
;
package
javax.lang.model.element
;
import
java.util.List
;
/**
/**
* Represents a package program element. Provides access to information
* Represents a package program element. Provides access to information
* about the package and its members.
* about the package and its members.
...
@@ -49,7 +51,7 @@ public interface PackageElement extends Element, QualifiedNameable {
...
@@ -49,7 +51,7 @@ public interface PackageElement extends Element, QualifiedNameable {
/**
/**
* Returns the simple name of this package. For an unnamed
* Returns the simple name of this package. For an unnamed
* package, an empty name is returned
* package, an empty name is returned
.
*
*
* @return the simple name of this package or an empty name if
* @return the simple name of this package or an empty name if
* this is an unnamed package
* this is an unnamed package
...
@@ -57,6 +59,18 @@ public interface PackageElement extends Element, QualifiedNameable {
...
@@ -57,6 +59,18 @@ public interface PackageElement extends Element, QualifiedNameable {
@Override
@Override
Name
getSimpleName
();
Name
getSimpleName
();
/**
* Returns the {@linkplain NestingKind#TOP_LEVEL top-level}
* classes and interfaces within this package. Note that
* subpackages are <em>not</em> considered to be enclosed by a
* package.
*
* @return the top-level classes and interfaces within this
* package
*/
@Override
List
<?
extends
Element
>
getEnclosedElements
();
/**
/**
* Returns {@code true} is this is an unnamed package and {@code
* Returns {@code true} is this is an unnamed package and {@code
* false} otherwise.
* false} otherwise.
...
...
src/share/classes/javax/lang/model/element/TypeElement.java
浏览文件 @
056f95d7
/*
/*
* Copyright (c) 2005, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 201
2
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -61,7 +61,12 @@ import javax.lang.model.util.*;
...
@@ -61,7 +61,12 @@ import javax.lang.model.util.*;
*/
*/
public
interface
TypeElement
extends
Element
,
Parameterizable
,
QualifiedNameable
{
public
interface
TypeElement
extends
Element
,
Parameterizable
,
QualifiedNameable
{
/**
/**
* {@inheritDoc}
* Returns the fields, methods, constructors, and member types
* that are directly declared in this class or interface.
*
* This includes any (implicit) default constructor and
* the implicit {@code values} and {@code valueOf} methods of an
* enum type.
*
*
* <p> Note that as a particular instance of the {@linkplain
* <p> Note that as a particular instance of the {@linkplain
* javax.lang.model.element general accuracy requirements} and the
* javax.lang.model.element general accuracy requirements} and the
...
@@ -75,6 +80,7 @@ public interface TypeElement extends Element, Parameterizable, QualifiedNameable
...
@@ -75,6 +80,7 @@ public interface TypeElement extends Element, Parameterizable, QualifiedNameable
*
*
* @return the enclosed elements in proper order, or an empty list if none
* @return the enclosed elements in proper order, or an empty list if none
*/
*/
@Override
List
<?
extends
Element
>
getEnclosedElements
();
List
<?
extends
Element
>
getEnclosedElements
();
/**
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录