1 /*******************************************************************************
2 * Copyright (c) 2000, 2004 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 * IBM Corporation - added J2SE 1.5 support
11 *******************************************************************************/
12 package net.sourceforge.phpdt.core;
15 * Represents an import declaration in Java compilation unit.
17 * This interface is not intended to be implemented by clients.
20 public interface IImportDeclaration extends IJavaElement, ISourceReference, ISourceManipulation {
22 * Returns the name that has been imported.
23 * For an on-demand import, this includes the trailing <code>".*"</code>.
24 * For example, for the statement <code>"import java.util.*"</code>,
25 * this returns <code>"java.util.*"</code>.
26 * For the statement <code>"import java.util.Hashtable"</code>,
27 * this returns <code>"java.util.Hashtable"</code>.
29 * @return the name that has been imported
31 String getElementName();
33 * Returns the modifier flags for this import. The flags can be examined using class
34 * <code>Flags</code>. Only the static flag is meaningful for import declarations.
36 * @return the modifier flags for this import
37 * @exception JavaModelException if this element does not exist or if an
38 * exception occurs while accessing its corresponding resource.
42 int getFlags() throws JavaModelException;
45 * Returns whether the import is on-demand. An import is on-demand if it ends
46 * with <code>".*"</code>.
47 * @return true if the import is on-demand, false otherwise