com.jeffpalm.javaparser
Class ASTImportDeclaration

java.lang.Object
  extended by com.jeffpalm.javaparser.SimpleNode
      extended by com.jeffpalm.javaparser.ASTImportDeclaration
All Implemented Interfaces:
Node

public class ASTImportDeclaration
extends SimpleNode

Stores an import declaration that appears at the beginning of a java file.

Since:
jRefactory 2.9.0, created October 16, 2003
Author:
Mike Atkinson

Field Summary
 
Fields inherited from class com.jeffpalm.javaparser.SimpleNode
children, id, parent, parser, specials
 
Constructor Summary
ASTImportDeclaration(int identifier)
          Constructor for the ASTImportDeclaration node.
ASTImportDeclaration(JavaParser parser, int identifier)
          Constructor for the ASTImportDeclaration node.
 
Method Summary
 ASTName getImportedNameNode()
          Gets the importedNameNode attribute of the ASTImportDeclaration node.
 boolean isImportingPackage()
          Return whether we are importing a package
 boolean isImportOnDemand()
          Gets the importOnDemand attribute of the ASTImportDeclaration node.
 boolean isStaticImport()
          Return whether we are importing a the static from this package.
 java.lang.Object jjtAccept(JavaParserVisitor visitor, java.lang.Object data)
          Accept the visitor.
 void setImportPackage(boolean way)
          Set when including everything in a package
 void setStaticImport(boolean isStatic)
          Set when including everything in a package.
 
Methods inherited from class com.jeffpalm.javaparser.SimpleNode
addSpecial, childrenAccept, dump, dumpString, findChildrenOfType, findChildrenOfType, findChildrenOfType, getBeginColumn, getBeginLine, getEndColumn, getEndLine, getImage, getName, getScope, getSpecial, hasAnyChildren, init, isRequired, jjtAddChild, jjtAddFirstChild, jjtClose, jjtDeleteChild, jjtGetChild, jjtGetFirstChild, jjtGetID, jjtGetNumChildren, jjtGetParent, jjtInsertChild, jjtOpen, jjtSetParent, printModifiers, removeSpecial, setLineAndColumnInfo, setScope, testingOnly__setBeginColumn, testingOnly__setBeginLine, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ASTImportDeclaration

public ASTImportDeclaration(int identifier)
Constructor for the ASTImportDeclaration node.

Parameters:
identifier - The id of this node (JJTIMPORTDECLARATION).

ASTImportDeclaration

public ASTImportDeclaration(JavaParser parser,
                            int identifier)
Constructor for the ASTImportDeclaration node.

Parameters:
parser - The JavaParser that created this ASTImportDeclaration node.
identifier - The id of this node (JJTIMPORTDECLARATION).
Method Detail

setImportPackage

public void setImportPackage(boolean way)
Set when including everything in a package

Parameters:
way - true if we are importing the package.

setStaticImport

public void setStaticImport(boolean isStatic)
Set when including everything in a package. JDK 1.5 indicate that this is a static import.

Parameters:
isStatic - true if we are importing statics from the package
Since:
JRefactory 2.7.00

isImportingPackage

public boolean isImportingPackage()
Return whether we are importing a package

Returns:
true if the whole package is being imported (with ".*;").

isStaticImport

public boolean isStaticImport()
Return whether we are importing a the static from this package. JDK 1.5

Returns:
true if we are importing statics from the package
Since:
JRefactory 2.7.00

isImportOnDemand

public boolean isImportOnDemand()
Gets the importOnDemand attribute of the ASTImportDeclaration node.

Returns:
true if the whole package was imported (with ".*;").

getImportedNameNode

public ASTName getImportedNameNode()
Gets the importedNameNode attribute of the ASTImportDeclaration node.

Returns:
The name of the class or package being imported.

jjtAccept

public java.lang.Object jjtAccept(JavaParserVisitor visitor,
                                  java.lang.Object data)
Accept the visitor.

Specified by:
jjtAccept in interface Node
Overrides:
jjtAccept in class SimpleNode
Parameters:
visitor - An implementation of JavaParserVisitor that processes the ASTImportDeclaration node.
data - Some data being passed between the visitor methods.
Returns:
Usually the data parameter (possibly modified).