com.sun.tools.doclets.internal.toolkit.util
Class VisibleMemberMap

java.lang.Object
  extended by com.sun.tools.doclets.internal.toolkit.util.VisibleMemberMap

public class VisibleMemberMap
extends java.lang.Object

A data structure that encapsulates the visible members of a particular type for a given class tree. To use this data structor, you must specify the type of member you are interested in (nested class, field, constructor or method) and the leaf of the class tree. The data structure will map all visible members in the leaf and classes above the leaf in the tree. This code is not part of an API. It is implementation that is subject to change. Do not use it as an API


Nested Class Summary
private  class VisibleMemberMap.ClassMember
          Represents a class member.
private  class VisibleMemberMap.ClassMembers
          A data structure that represents the class members for a visible class.
 
Field Summary
static int ANNOTATION_TYPE_MEMBER_OPTIONAL
           
static int ANNOTATION_TYPE_MEMBER_REQUIRED
           
private  ClassDoc classdoc
          Type whose visible members are requested.
private  java.util.Map<ClassDoc,VisibleMemberMap.ClassMembers> classMap
          Map of class and it's ClassMembers object.
static int CONSTRUCTORS
           
static int ENUM_CONSTANTS
           
static int FIELDS
           
static int INNERCLASSES
           
private  int kind
          Member kind: InnerClasses/Fields/Methods?
private  java.util.Map<java.lang.Object,java.util.Map<ProgramElementDoc,java.lang.String>> memberNameMap
          Map for each member name on to a map which contains members with same name-signature.
static int METHODS
           
private  boolean nodepr
          Deprected members should be excluded or not?
private  boolean noVisibleMembers
           
static int NUM_MEMBER_TYPES
          The total number of member types is 7.
static java.lang.String STARTLEVEL
           
private  java.util.List<ClassDoc> visibleClasses
          List of ClassDoc objects for which ClassMembers objects are built.
 
Constructor Summary
VisibleMemberMap(ClassDoc classdoc, int kind, boolean nodepr)
          Construct a VisibleMemberMap of the given type for the given class.
 
Method Summary
private  void fillMemberLevelMap(java.util.List<ProgramElementDoc> list, java.lang.String level)
           
private  VisibleMemberMap.ClassMember getClassMember(MethodDoc member)
           
private  java.util.List<ProgramElementDoc> getInheritedPackagePrivateMethods(Configuration configuration)
          Return the package private members inherited by the class.
 java.util.List<ProgramElementDoc> getLeafClassMembers(Configuration configuration)
          Return the visible members of the class being mapped.
private  java.lang.Object getMemberKey(ProgramElementDoc doc)
          Return the key to the member map for the given member.
 java.util.List<ProgramElementDoc> getMembersFor(ClassDoc cd)
          Retrn the list of members for the given class.
 java.util.List<ClassDoc> getVisibleClassesList()
          Return the list of visible classes in this map.
 boolean noVisibleMembers()
          Return true if this map has no visible members.
private  void purgeMemberLevelMap(java.util.List<ProgramElementDoc> list, java.lang.String level)
           
private  void sort(java.util.List<ClassDoc> list)
          Sort the given mixed list of classes and interfaces to a list of classes followed by interfaces traversed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

noVisibleMembers

private boolean noVisibleMembers

INNERCLASSES

public static final int INNERCLASSES
See Also:
Constant Field Values

ENUM_CONSTANTS

public static final int ENUM_CONSTANTS
See Also:
Constant Field Values

FIELDS

public static final int FIELDS
See Also:
Constant Field Values

CONSTRUCTORS

public static final int CONSTRUCTORS
See Also:
Constant Field Values

METHODS

public static final int METHODS
See Also:
Constant Field Values

ANNOTATION_TYPE_MEMBER_OPTIONAL

public static final int ANNOTATION_TYPE_MEMBER_OPTIONAL
See Also:
Constant Field Values

ANNOTATION_TYPE_MEMBER_REQUIRED

public static final int ANNOTATION_TYPE_MEMBER_REQUIRED
See Also:
Constant Field Values

NUM_MEMBER_TYPES

public static final int NUM_MEMBER_TYPES
The total number of member types is 7.

See Also:
Constant Field Values

STARTLEVEL

public static final java.lang.String STARTLEVEL
See Also:
Constant Field Values

visibleClasses

private final java.util.List<ClassDoc> visibleClasses
List of ClassDoc objects for which ClassMembers objects are built.


memberNameMap

private final java.util.Map<java.lang.Object,java.util.Map<ProgramElementDoc,java.lang.String>> memberNameMap
Map for each member name on to a map which contains members with same name-signature. The mapped map will contain mapping for each MemberDoc onto it's respecive level string.


classMap

private final java.util.Map<ClassDoc,VisibleMemberMap.ClassMembers> classMap
Map of class and it's ClassMembers object.


classdoc

private final ClassDoc classdoc
Type whose visible members are requested. This is the leaf of the class tree being mapped.


kind

private final int kind
Member kind: InnerClasses/Fields/Methods?


nodepr

private final boolean nodepr
Deprected members should be excluded or not?

Constructor Detail

VisibleMemberMap

public VisibleMemberMap(ClassDoc classdoc,
                        int kind,
                        boolean nodepr)
Construct a VisibleMemberMap of the given type for the given class. If nodepr is true, exclude the deprecated members from the map.

Parameters:
classdoc - the class whose members are being mapped.
kind - the kind of member that is being mapped.
nodepr - if true, exclude the deprecated members from the map.
Method Detail

getVisibleClassesList

public java.util.List<ClassDoc> getVisibleClassesList()
Return the list of visible classes in this map.

Returns:
the list of visible classes in this map.

getInheritedPackagePrivateMethods

private java.util.List<ProgramElementDoc> getInheritedPackagePrivateMethods(Configuration configuration)
Return the package private members inherited by the class. Only return if parent is package private and not documented.

Parameters:
configuation - the current configuration of the doclet.
Returns:
the package private members inherited by the class.

getLeafClassMembers

public java.util.List<ProgramElementDoc> getLeafClassMembers(Configuration configuration)
Return the visible members of the class being mapped. Also append at the end of the list members that are inherited by inaccessible parents. We document these members in the child because the parent is not documented.

Parameters:
configuation - the current configuration of the doclet.

getMembersFor

public java.util.List<ProgramElementDoc> getMembersFor(ClassDoc cd)
Retrn the list of members for the given class.

Parameters:
cd - the class to retrieve the list of visible members for.
Returns:
the list of members for the given class.

sort

private void sort(java.util.List<ClassDoc> list)
Sort the given mixed list of classes and interfaces to a list of classes followed by interfaces traversed. Don't sort alphabetically.


fillMemberLevelMap

private void fillMemberLevelMap(java.util.List<ProgramElementDoc> list,
                                java.lang.String level)

purgeMemberLevelMap

private void purgeMemberLevelMap(java.util.List<ProgramElementDoc> list,
                                 java.lang.String level)

noVisibleMembers

public boolean noVisibleMembers()
Return true if this map has no visible members.

Returns:
true if this map has no visible members.

getClassMember

private VisibleMemberMap.ClassMember getClassMember(MethodDoc member)

getMemberKey

private java.lang.Object getMemberKey(ProgramElementDoc doc)
Return the key to the member map for the given member.