/**
  * Construct a new ConstructorWriterImpl.
  *
  * @param writer The writer for the class that the constructors belong to.
  * @param classDoc the class being documented.
  */
 public ConstructorWriterImpl(SubWriterHolderWriter writer, ClassDoc classDoc) {
   super(writer, classDoc);
   VisibleMemberMap visibleMemberMap =
       new VisibleMemberMap(classDoc, VisibleMemberMap.CONSTRUCTORS, configuration);
   List<ProgramElementDoc> constructors =
       new ArrayList<>(visibleMemberMap.getMembersFor(classDoc));
   for (ProgramElementDoc constructor : constructors) {
     if (constructor.isProtected() || constructor.isPrivate()) {
       setFoundNonPubConstructor(true);
     }
   }
 }
Пример #2
0
 /**
  * Construct a new MethodBuilder.
  *
  * @param context the build context.
  * @param classDoc the class whoses members are being documented.
  * @param writer the doclet specific writer.
  */
 private MethodBuilder(Context context, ClassDoc classDoc, MethodWriter writer) {
   super(context);
   this.classDoc = classDoc;
   this.writer = writer;
   visibleMemberMap = new VisibleMemberMap(classDoc, VisibleMemberMap.METHODS, configuration);
   methods = new ArrayList<>(visibleMemberMap.getLeafClassMembers(configuration));
   if (configuration.getMemberComparator() != null) {
     Collections.sort(methods, configuration.getMemberComparator());
   }
 }
 /**
  * Add the navigation summary link.
  *
  * @param members members to be linked
  * @param visibleMemberMap the visible inherited members map
  * @param liNav the content tree to which the navigation summary link will be added
  */
 protected void addNavSummaryLink(
     List<?> members, VisibleMemberMap visibleMemberMap, Content liNav) {
   if (members.size() > 0) {
     liNav.addContent(getNavSummaryLink(null, true));
     return;
   }
   ClassDoc icd = classdoc.superclass();
   while (icd != null) {
     List<?> inhmembers = visibleMemberMap.getMembersFor(icd);
     if (inhmembers.size() > 0) {
       liNav.addContent(getNavSummaryLink(icd, true));
       return;
     }
     icd = icd.superclass();
   }
   liNav.addContent(getNavSummaryLink(null, false));
 }
Пример #4
0
 /**
  * Returns a list of methods that will be documented for the given class. This information can be
  * used for doclet specific documentation generation.
  *
  * @param classDoc the {@link ClassDoc} we want to check.
  * @return a list of methods that will be documented.
  */
 public List<ProgramElementDoc> members(ClassDoc classDoc) {
   return visibleMemberMap.getMembersFor(classDoc);
 }