com.sun.tools.apt.mirror.declaration
Class PackageDeclarationImpl

java.lang.Object
  extended by com.sun.tools.apt.mirror.declaration.DeclarationImpl
      extended by com.sun.tools.apt.mirror.declaration.PackageDeclarationImpl
All Implemented Interfaces:
Declaration, PackageDeclaration

public class PackageDeclarationImpl
extends DeclarationImpl
implements PackageDeclaration

Implementation of PackageDeclaration.


Field Summary
private  java.util.Collection<TypeDeclaration> allTypes
           
private  Symbol.PackageSymbol sym
           
 
Fields inherited from class com.sun.tools.apt.mirror.declaration.DeclarationImpl
env, identityFilter
 
Constructor Summary
PackageDeclarationImpl(AptEnv env, Symbol.PackageSymbol sym)
           
 
Method Summary
 void accept(DeclarationVisitor v)
          Applies a visitor to this declaration.
private  java.util.Collection<TypeDeclaration> getAllTypes()
          Caches and returns all top-level type declarations in this package.
 java.util.Collection<AnnotationTypeDeclaration> getAnnotationTypes()
          Returns the declarations of the top-level annotation types in this package.
 java.util.Collection<ClassDeclaration> getClasses()
          Returns the declarations of the top-level classes in this package.
 java.util.Collection<EnumDeclaration> getEnums()
          Returns the declarations of the top-level enum types in this package.
 java.util.Collection<InterfaceDeclaration> getInterfaces()
          Returns the declarations of the top-level interfaces in this package.
 java.lang.String getQualifiedName()
          Returns the fully qualified name of this package.
 java.lang.String toString()
          Returns the qualified name.
 
Methods inherited from class com.sun.tools.apt.mirror.declaration.DeclarationImpl
equals, getAnnotation, getAnnotation, getAnnotationMirrors, getDocComment, getMembers, getModifiers, getPosition, getSimpleName, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.sun.mirror.declaration.Declaration
equals, getAnnotation, getAnnotationMirrors, getDocComment, getModifiers, getPosition, getSimpleName
 

Field Detail

sym

private Symbol.PackageSymbol sym

allTypes

private java.util.Collection<TypeDeclaration> allTypes
Constructor Detail

PackageDeclarationImpl

public PackageDeclarationImpl(AptEnv env,
                              Symbol.PackageSymbol sym)
Method Detail

toString

public java.lang.String toString()
Returns the qualified name.

Overrides:
toString in class java.lang.Object

getQualifiedName

public java.lang.String getQualifiedName()
Returns the fully qualified name of this package. This is also known as the package's canonical name.

Specified by:
getQualifiedName in interface PackageDeclaration
Returns:
the fully qualified name of this package, or the empty string if this is the unnamed package

getClasses

public java.util.Collection<ClassDeclaration> getClasses()
Returns the declarations of the top-level classes in this package. Interfaces are not included, but enum types are.

Specified by:
getClasses in interface PackageDeclaration
Returns:
the declarations of the top-level classes in this package
See Also:
DeclarationFilter

getEnums

public java.util.Collection<EnumDeclaration> getEnums()
Returns the declarations of the top-level enum types in this package.

Specified by:
getEnums in interface PackageDeclaration
Returns:
the declarations of the top-level enum types in this package
See Also:
DeclarationFilter

getInterfaces

public java.util.Collection<InterfaceDeclaration> getInterfaces()
Returns the declarations of the top-level interfaces in this package. Annotation types are included.

Specified by:
getInterfaces in interface PackageDeclaration
Returns:
the declarations of the top-level interfaces in this package
See Also:
DeclarationFilter

getAnnotationTypes

public java.util.Collection<AnnotationTypeDeclaration> getAnnotationTypes()
Returns the declarations of the top-level annotation types in this package.

Specified by:
getAnnotationTypes in interface PackageDeclaration
Returns:
the declarations of the top-level annotation types in this package
See Also:
DeclarationFilter

accept

public void accept(DeclarationVisitor v)
Applies a visitor to this declaration.

Specified by:
accept in interface Declaration
Overrides:
accept in class DeclarationImpl
Parameters:
v - the visitor operating on this declaration

getAllTypes

private java.util.Collection<TypeDeclaration> getAllTypes()
Caches and returns all top-level type declarations in this package. Omits synthetic types.