com.togethersoft.sca.ast
Interface AstPackage

All Superinterfaces:
AstDeclaration, AstElement, AstMember, AstObject

public interface AstPackage
extends AstMember

Represents a package. A package contains a collection of compilation units and binary files.


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
 AstPackage findPackage(java.lang.String name)
          Returns the subpackage with the specified name contained in this package.
 AstType findType(java.lang.String name)
          Returns the binary type with the specified name contained in this package.
 AstClassFile[] getClassFiles()
          Returns all of the binary files containing types in this package.
 AstCompilationUnit[] getCompilationUnits()
          Returns all of the compilation units in this package.
 java.lang.String getElementName()
          Returns the simple name of this package, for example "lang" for the java.lang package.
 java.lang.String getQualifiedName()
          Returns the slash-separated package name of this package, for example "java/lang", or "" (the empty string), for the default package.
 AstPackage[] getSubpackages()
          Returns all of the subpackages this package contains.
 boolean isDefaultPackage()
          Returns whether this package fragment is a default package.
 
Methods inherited from interface com.togethersoft.sca.ast.AstDeclaration
getDeclaredModifiers, getModifiers, getModifiersList, getReferences, isAbstract, isFinal, isNative, isPackage, isPrivate, isProtected, isPublic, isStatic, isStrictfp, isSynchronized, isTransient, isVolatile, setDeclaredModifiers, swapWith
 
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

findPackage

public AstPackage findPackage(java.lang.String name)
Returns the subpackage with the specified name contained in this package. Returns null, if the package with the specified name does not exist.
Parameters:
name - specifies simple name of the package, for example "lang".

findType

public AstType findType(java.lang.String name)
Returns the binary type with the specified name contained in this package. Returns null, if the type with the specified name does not exist.
Parameters:
name - specifies simple name of the type, for example "String".

getClassFiles

public AstClassFile[] getClassFiles()
Returns all of the binary files containing types in this package.

Note: it is possible that a package contains only source files, in which case this method returns an empty collection.

See Also:
AstClassFile

getCompilationUnits

public AstCompilationUnit[] getCompilationUnits()
Returns all of the compilation units in this package.

Note: it is possible that a package contains only class files, in which case this method returns an empty collection.

See Also:
AstCompilationUnit

getElementName

public java.lang.String getElementName()
Returns the simple name of this package, for example "lang" for the java.lang package.
Specified by:
getElementName in interface AstElement
Following copied from interface: com.togethersoft.sca.ast.AstElement
Returns:
the name of this element.

getQualifiedName

public java.lang.String getQualifiedName()
Returns the slash-separated package name of this package, for example "java/lang", or "" (the empty string), for the default package.
Specified by:
getQualifiedName in interface AstMember
Following copied from interface: com.togethersoft.sca.ast.AstMember
Returns:
the qualified name of this member.

getSubpackages

public AstPackage[] getSubpackages()
Returns all of the subpackages this package contains. If this package has no subpackages, this method returns an empty collection.

isDefaultPackage

public boolean isDefaultPackage()
Returns whether this package fragment is a default package.