|
Extension SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The JotImport
interface represents an import declaration in
a Java source file. An import declaration must be in one of two forms:
a single-type-import declaration (import java.io.File;
) or
a type-import-on-demand declaration (import java.util.*;
).
A single-type-import declaration imports a single type and makes it
available by its simple name. A type-import-on-demand imports all the
accessible types in a package as needed.
When resolving a simple type name to a fully qualified type name, all
single-type-import declarations are checked, followed by the package
containing the source file, followed by any type-import-on-demand
imports. Note that the package java.lang
is implicitly
imported into source files; this is equivalent to each and every source
file containing the declaration import java.lang.*
.
JotFile
,
"Section 7.5 of the Java Language Specification."Method Summary | |
java.lang.String |
getClassName()
Retrieves the name portion of this import statment. |
java.lang.String |
getName()
Retrieves the name contained in this import declaration. |
java.lang.String |
getPackage()
Retrieves the package name portion of this import statment. |
boolean |
refersTo(java.lang.String thatIdent)
Tests whether this import declaration and the supplied import text refer to the same class. |
void |
setClassName(java.lang.String clsName)
sets the class name portion of this import statement. |
void |
setName(java.lang.String name)
Sets the name contained in this import declaration. |
void |
setPackage(java.lang.String pkgName)
Sets the package name portion of this import statement. |
Methods inherited from interface oracle.jdeveloper.jot.JotElement |
getElementName, getElementType, getEndOffset, getID, getJotWorkArea, getParent, getStartOffset, isExistent, isReadOnly, isStructureKnown, setParent |
Method Detail |
public java.lang.String getName()
getPackage()
,
getClassName()
public void setName(java.lang.String name)
name
- the package or class being imported.public java.lang.String getPackage()
getName()
public void setPackage(java.lang.String pkgName)
pkgName
- the new package name.public java.lang.String getClassName()
getName()
public void setClassName(java.lang.String clsName)
clsName
- a class name for a narrow import or the "*" wildcard
for a wide import.public boolean refersTo(java.lang.String thatIdent)
*
".
thatIdent
- the text of an import declaration.
|
Extension SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright ©1997, 2003, Oracle. All rights reserved.