japa.parser.ast

## Class ImportDeclaration

- java.lang.Object
- - japa.parser.ast.Node
  - - japa.parser.ast.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

### Field Summary

### Fields inherited from class japa.parser.ast.Node

`ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE`

### Constructor Summary

Constructors
Constructor and Description
`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

All Methods Instance Methods Concrete Methods
`<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 japa.parser.ast.Node

`addOrphanComment, contains, equals, getAllContainedComments, getBeginColumn, getBeginLine, getChildrenNodes, getComment, getData, getEndColumn, getEndLine, getOrphanComments, getParentNode, hashCode, isPositionedAfter, isPositionedBefore, setAsParentNodeOf, setAsParentNodeOf, setBeginColumn, setBeginLine, setComment, setData, setEndColumn, setEndLine, setParentNode, 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 to the visitor
Parameters:
  `v` - the visitor implementation
  `arg` - the argument passed to 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