improved PHP parser
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / core / ICompilationUnit.java
index c25a7cc..dd57c8f 100644 (file)
@@ -10,6 +10,8 @@
  *******************************************************************************/
 package net.sourceforge.phpdt.core;
 
+import java.util.HashMap;
+
 import net.sourceforge.phpdt.internal.core.ImportContainer;
 
 import org.eclipse.core.runtime.IProgressMonitor;
@@ -234,7 +236,18 @@ IJavaElement getElementAt(int position) throws JavaModelException;
  *     or <code>"java.awt.*"</code>)
  * @return a handle onto the corresponding import declaration. The import declaration may or may not exist.
  */
-//IImportDeclaration getImport(String name) ;
+IImportDeclaration getImport(String name) ;
+/**
+ * Returns the import declarations in this compilation unit
+ * in the order in which they appear in the source. This is
+ * a convenience method - import declarations can also be
+ * accessed from a compilation unit's import container.
+ *
+ * @return the import declarations in this compilation unit
+ * @throws JavaModelException if this element does not exist or if an
+ *             exception occurs while accessing its corresponding resource
+ */
+IImportDeclaration[] getImports() throws JavaModelException;
 /**
  * Returns the import container for this compilation unit.
  * This is a handle-only method. The import container may or
@@ -243,7 +256,7 @@ IJavaElement getElementAt(int position) throws JavaModelException;
  * @return a handle onto the corresponding import container. The 
  *             import contain may or may not exist.
  */
-ImportContainer getImportContainer();
+IImportContainer getImportContainer();
 /**
  * Returns the import declarations in this compilation unit
  * in the order in which they appear in the source. This is
@@ -272,7 +285,7 @@ IPackageDeclaration getPackageDeclaration(String name);
  * @exception JavaModelException if this element does not exist or if an
  *             exception occurs while accessing its corresponding resource
  */
-//IPackageDeclaration[] getPackageDeclarations() throws JavaModelException;
+IPackageDeclaration[] getPackageDeclarations() throws JavaModelException;
 /**
  * Returns the primary compilation unit (whose owner is the primary owner)
  * this working copy was created from, or this compilation unit if this a primary
@@ -295,7 +308,7 @@ ICompilationUnit getPrimary();
  * @return a handle onto the corresponding type. The type may or may not exist.
  * @see JavaConventions#validateCompilationUnitName(String name)
  */
-IType getType(String name);
+IType getType(String name); 
 /**
  * Returns the top-level types declared in this compilation unit
  * in the order in which they appear in the source.