src/share/classes/javax/lang/model/element/TypeElement.java

Print this page
rev 409 : 6884227: Clarify ordering requirements of javax.lang.model.TypeElement.getEnclosedElements
Reviewed-by: ahe

@@ -58,10 +58,26 @@
  * @author Peter von der Ahé
  * @see DeclaredType
  * @since 1.6
  */
 public interface TypeElement extends Element, Parameterizable, QualifiedNameable {
+    /**
+     * {@inheritDoc}
+     *
+     * <p> Note that as a particular instance of the {@linkplain
+     * javax.lang.model.element general accuracy requirements} and the
+     * ordering behavior required of this interface, the list of
+     * enclosed elements will be returned in the natural order for the
+     * originating source of information about the type.  For example,
+     * if the information about the type is originating from a source
+     * file, the elements will be returned in source code order.
+     * (However, in that case the the ordering of synthesized
+     * elements, such as a default constructor, is not specified.)
+     *
+     * @return the enclosed elements in proper order, or an empty list if none
+     */
+    List<? extends Element> getEnclosedElements();
 
     /**
      * Returns the <i>nesting kind</i> of this type element.
      *
      * @return the nesting kind of this type element