|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
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.JotCodeElement |
addPrecedingComment, childrenContainErrors, delete, getContainingJotFile, getLeftWhitespace, getLength, getRightWhitespace, isInError, isSource, setLeftWhitespace, setRightWhitespace |
Methods inherited from interface oracle.jdeveloper.jot.JotElement |
getChildren, getContainedElements, getElementName, getElementType, getEndOffset, getID, getJotWorkArea, getParent, getStartOffset, isExistent, isReadOnly, isStructureKnown, setParent |
Method Detail |
public java.lang.String getName() throws JotInvalidElementException
JotInvalidElementException
getPackage()
, getClassName()
public void setName(java.lang.String name) throws JotInvalidElementException
name
- the package or class being imported.JotInvalidElementException
public java.lang.String getPackage() throws JotInvalidElementException
JotInvalidElementException
getName()
public void setPackage(java.lang.String pkgName) throws JotInvalidElementException
pkgName
- the new package name.JotInvalidElementException
public java.lang.String getClassName() throws JotInvalidElementException
JotInvalidElementException
getName()
public void setClassName(java.lang.String clsName) throws JotInvalidElementException
clsName
- a class name for a narrow import or the "*" wildcard for a wide import.JotInvalidElementException
public boolean refersTo(java.lang.String thatIdent) throws JotInvalidElementException
*
".thatIdent
- the text of an import declaration.JotInvalidElementException
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.