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

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -23,10 +23,12 @@
  * questions.
  */
 
 package javax.lang.model.element;
 
+import java.util.List;
+
 /**
  * Represents a package program element.  Provides access to information
  * about the package and its members.
  *
  * @author Joseph D. Darcy

@@ -47,19 +49,31 @@
      */
     Name getQualifiedName();
 
     /**
      * 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
      * this is an unnamed package
      */
     @Override
     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
      * false} otherwise.
      *
      * @return {@code true} is this is an unnamed package and {@code
      * false} otherwise