com.togethersoft.sca.ast
Interface AstImport

All Superinterfaces:
AstElement, AstObject, AstReference

public interface AstImport
extends AstElement, AstReference

Represens an import declaration. For example:

     import java.util.ArrayList;
     import java.io.*;
 


Fields inherited from interface com.togethersoft.sca.ast.AstObject
ARRAY_CREATION, ARRAY_INITIALIZER, ARRAY_REFERENCE, ASSERT_STATEMENT, ASSIGNMENT_EXPRESSION, BINARY_EXPRESSION, BREAK_STATEMENT, CASE_LABEL, CAST_EXPRESSION, CATCH_CLAUSE, CLASS_FILE, COMMENT, COMPILATION_UNIT, COMPOUND_STATEMENT, CONDITIONAL_EXPRESSION, CONSTRUCTOR_INVOCATION, CONTINUE_STATEMENT, DBC_RESULT, DECLARATION_STATEMENT, DO_STATEMENT, EMPTY_STATEMENT, EXPRESSION_STATEMENT, FIELD_REFERENCE, FINALLY_CLAUSE, FOR_STATEMENT, IF_STATEMENT, IMPORT, INITIALIZER, JAVADOC_TAG, LITERAL, METHOD, METHOD_CALL_EXPRESSION, N_A, OBJECT_CREATION_EXPRESSION, PACKAGE, PARENTHESIZED_EXPRESSION, RETURN_STATEMENT, SIMPLE_REFERENCE, SUPER_EXPRESSION, SWITCH_GROUP, SWITCH_STATEMENT, SYNCHRONIZED_STATEMENT, THIS_EXPRESSION, THROW_SPECIFIER, THROW_STATEMENT, TRY_STATEMENT, TYPE, TYPE_EXPRESSION, UNARY_EXPRESSION, VARIABLE, VARIABLE_DECLARATION, WHILE_STATEMENT
 
Method Summary
 java.lang.String getElementName()
          Returns the name that has been imported.
 AstDeclaration getReferencedElement()
          Returns the imported package or type.
 boolean isOnDemand()
          Returns true if the import is on-demand, otherwise false.
 
Methods inherited from interface com.togethersoft.sca.ast.AstObject
addComment, getChildren, getComments, getCompilationUnit, getDeclaringMethod, getDeclaringType, getObjectKind, getPackage, getParent, getPosition, isDeleted, remove, replaceWith, replaceWith, setPosition, setPositionAfter, visitExpressions, visitStatements
 

Method Detail

getElementName

public java.lang.String getElementName()
Returns the name that has been imported. This does not include the trailing ".*" for an on-demand import. For example, for the statement "import java.util.*;", this returns "java.util". For the statement "import java.util.Hashtable;", this returns "java.util.Hashtable".
Specified by:
getElementName in interface AstElement
Returns:
the name of the imported type or package.

getReferencedElement

public AstDeclaration getReferencedElement()
Returns the imported package or type. An object of type AstPackage or AstType is returned.
Specified by:
getReferencedElement in interface AstReference
Returns:
the imported package or type.

isOnDemand

public boolean isOnDemand()
Returns true if the import is on-demand, otherwise false. An import is on-demand if it ends with ".*".
Returns:
true if this is an on-demand import.