1.1 --- a/src/share/classes/javax/lang/model/element/Element.java Fri Jan 28 12:36:34 2011 +0000 1.2 +++ b/src/share/classes/javax/lang/model/element/Element.java Fri Jan 28 16:54:18 2011 -0800 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -159,18 +159,26 @@ 1.11 Set<Modifier> getModifiers(); 1.12 1.13 /** 1.14 - * Returns the simple (unqualified) name of this element. 1.15 - * The name of a generic type does not include any reference 1.16 - * to its formal type parameters. 1.17 - * For example, the simple name of the type element 1.18 - * {@code java.util.Set<E>} is {@code "Set"}. 1.19 - * If this element represents an unnamed package, an empty name is 1.20 - * returned. If it represents a constructor, the name "{@code 1.21 - * <init>}" is returned. If it represents a static initializer, 1.22 - * the name "{@code <clinit>}" is returned. If it represents an 1.23 - * anonymous class or instance initializer, an empty name is 1.24 + * Returns the simple (unqualified) name of this element. The 1.25 + * name of a generic type does not include any reference to its 1.26 + * formal type parameters. 1.27 + * 1.28 + * For example, the simple name of the type element {@code 1.29 + * java.util.Set<E>} is {@code "Set"}. 1.30 + * 1.31 + * If this element represents an unnamed {@linkplain 1.32 + * PackageElement#getSimpleName package}, an empty name is 1.33 * returned. 1.34 * 1.35 + * If it represents a {@linkplain ExecutableElement#getSimpleName 1.36 + * constructor}, the name "{@code <init>}" is returned. If it 1.37 + * represents a {@linkplain ExecutableElement#getSimpleName static 1.38 + * initializer}, the name "{@code <clinit>}" is returned. 1.39 + * 1.40 + * If it represents an {@linkplain TypeElement#getSimpleName 1.41 + * anonymous class} or {@linkplain ExecutableElement#getSimpleName 1.42 + * instance initializer}, an empty name is returned. 1.43 + * 1.44 * @return the simple name of this element 1.45 */ 1.46 Name getSimpleName(); 1.47 @@ -182,9 +190,18 @@ 1.48 * <li> If this element is one whose declaration is lexically enclosed 1.49 * immediately within the declaration of another element, that other 1.50 * element is returned. 1.51 - * <li> If this is a top-level type, its package is returned. 1.52 - * <li> If this is a package, {@code null} is returned. 1.53 - * <li> If this is a type parameter, {@code null} is returned. 1.54 + * 1.55 + * <li> If this is a {@linkplain TypeElement#getEnclosingElement 1.56 + * top-level type}, its package is returned. 1.57 + * 1.58 + * <li> If this is a {@linkplain 1.59 + * PackageElement#getEnclosingElement package}, {@code null} is 1.60 + * returned. 1.61 + 1.62 + * <li> If this is a {@linkplain 1.63 + * TypeParameterElement#getEnclosingElement type parameter}, 1.64 + * {@code null} is returned. 1.65 + 1.66 * </ul> 1.67 * 1.68 * @return the enclosing element, or {@code null} if there is none