com.github.antlrjavaparser.api
Class ImportDeclaration

java.lang.Object
  extended by com.github.antlrjavaparser.api.Node
      extended by com.github.antlrjavaparser.api.ImportDeclaration

public final class ImportDeclaration
extends Node

This class represents a import declaration. Imports are optional for the CompilationUnit.

The ImportDeclaration is constructed following the syntax:
ImportDeclaration ::= "import" ( "static" )? NameExpr ( "." "*" )? ";"

Author:
Julio Vilmar Gesser

Constructor Summary
ImportDeclaration()
           
ImportDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, NameExpr name, boolean isStatic, boolean isAsterisk)
           
ImportDeclaration(NameExpr name, boolean isStatic, boolean isAsterisk)
           
 
Method Summary
<R,A> R
accept(GenericVisitor<R,A> v, A arg)
          Accept method for visitor support.
<A> void
accept(VoidVisitor<A> v, A arg)
          Accept method for visitor support.
 NameExpr getName()
          Retrieves the name of the import.
 boolean isAsterisk()
          Return if the import ends with "*".
 boolean isStatic()
          Return if the import is static.
 void setAsterisk(boolean asterisk)
          Sets if this import is asterisk.
 void setName(NameExpr name)
          Sets the name this import.
 void setStatic(boolean static_)
          Sets if this import is static.
 
Methods inherited from class com.github.antlrjavaparser.api.Node
equals, getBeginColumn, getBeginComments, getBeginLine, getData, getEndColumn, getEndComments, getEndLine, getInternalComments, hashCode, setBeginColumn, setBeginComments, setBeginLine, setData, setEndColumn, setEndComments, setEndLine, setInternalComments, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ImportDeclaration

public ImportDeclaration()

ImportDeclaration

public ImportDeclaration(NameExpr name,
                         boolean isStatic,
                         boolean isAsterisk)

ImportDeclaration

public ImportDeclaration(int beginLine,
                         int beginColumn,
                         int endLine,
                         int endColumn,
                         NameExpr name,
                         boolean isStatic,
                         boolean isAsterisk)
Method Detail

accept

public <R,A> R accept(GenericVisitor<R,A> v,
                      A arg)
Description copied from class: Node
Accept method for visitor support.

Specified by:
accept in class Node
Type Parameters:
R - the type the return value of the visitor
A - the type the argument passed for the visitor
Parameters:
v - the visitor implementation
arg - any value relevant for the visitor
Returns:
the result of the visit

accept

public <A> void accept(VoidVisitor<A> v,
                       A arg)
Description copied from class: Node
Accept method for visitor support.

Specified by:
accept in class Node
Type Parameters:
A - the type the argument passed for the visitor
Parameters:
v - the visitor implementation
arg - any value relevant for the visitor

getName

public NameExpr getName()
Retrieves the name of the import.

Returns:
the name of the import

isAsterisk

public boolean isAsterisk()
Return if the import ends with "*".

Returns:
true if the import ends with "*", false otherwise

isStatic

public boolean isStatic()
Return if the import is static.

Returns:
true if the import is static, false otherwise

setAsterisk

public void setAsterisk(boolean asterisk)
Sets if this import is asterisk.

Parameters:
asterisk - true if this import is asterisk

setName

public void setName(NameExpr name)
Sets the name this import.

Parameters:
name - the name to set

setStatic

public void setStatic(boolean static_)
Sets if this import is static.

Parameters:
static_ - true if this import is static


Copyright © 2013. All Rights Reserved.