langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java
changeset 14542 7062120649c2
parent 14357 faf9cde2817b
child 15385 ee1eebe7e210
equal deleted inserted replaced
14541:36f9d11fc9aa 14542:7062120649c2
    58      */
    58      */
    59     public ConstructorWriterImpl(SubWriterHolderWriter writer,
    59     public ConstructorWriterImpl(SubWriterHolderWriter writer,
    60             ClassDoc classDoc) {
    60             ClassDoc classDoc) {
    61         super(writer, classDoc);
    61         super(writer, classDoc);
    62         VisibleMemberMap visibleMemberMap = new VisibleMemberMap(classDoc,
    62         VisibleMemberMap visibleMemberMap = new VisibleMemberMap(classDoc,
    63             VisibleMemberMap.CONSTRUCTORS, configuration().nodeprecated);
    63             VisibleMemberMap.CONSTRUCTORS, configuration.nodeprecated);
    64         List<ProgramElementDoc> constructors = new ArrayList<ProgramElementDoc>(visibleMemberMap.getMembersFor(classDoc));
    64         List<ProgramElementDoc> constructors = new ArrayList<ProgramElementDoc>(visibleMemberMap.getMembersFor(classDoc));
    65         for (int i = 0; i < constructors.size(); i++) {
    65         for (int i = 0; i < constructors.size(); i++) {
    66             if ((constructors.get(i)).isProtected() ||
    66             if ((constructors.get(i)).isProtected() ||
    67                 (constructors.get(i)).isPrivate()) {
    67                 (constructors.get(i)).isPrivate()) {
    68                 setFoundNonPubConstructor(true);
    68                 setFoundNonPubConstructor(true);
   128     public Content getSignature(ConstructorDoc constructor) {
   128     public Content getSignature(ConstructorDoc constructor) {
   129         writer.displayLength = 0;
   129         writer.displayLength = 0;
   130         Content pre = new HtmlTree(HtmlTag.PRE);
   130         Content pre = new HtmlTree(HtmlTag.PRE);
   131         writer.addAnnotationInfo(constructor, pre);
   131         writer.addAnnotationInfo(constructor, pre);
   132         addModifiers(constructor, pre);
   132         addModifiers(constructor, pre);
   133         if (configuration().linksource) {
   133         if (configuration.linksource) {
   134             Content constructorName = new StringContent(constructor.name());
   134             Content constructorName = new StringContent(constructor.name());
   135             writer.addSrcLink(constructor, constructorName, pre);
   135             writer.addSrcLink(constructor, constructorName, pre);
   136         } else {
   136         } else {
   137             addName(constructor.name(), pre);
   137             addName(constructor.name(), pre);
   138         }
   138         }
   215 
   215 
   216     /**
   216     /**
   217      * {@inheritDoc}
   217      * {@inheritDoc}
   218      */
   218      */
   219     public String getTableSummary() {
   219     public String getTableSummary() {
   220         return configuration().getText("doclet.Member_Table_Summary",
   220         return configuration.getText("doclet.Member_Table_Summary",
   221                 configuration().getText("doclet.Constructor_Summary"),
   221                 configuration.getText("doclet.Constructor_Summary"),
   222                 configuration().getText("doclet.constructors"));
   222                 configuration.getText("doclet.constructors"));
   223     }
   223     }
   224 
   224 
   225     /**
   225     /**
   226      * {@inheritDoc}
   226      * {@inheritDoc}
   227      */
   227      */
   228     public String getCaption() {
   228     public String getCaption() {
   229         return configuration().getText("doclet.Constructors");
   229         return configuration.getText("doclet.Constructors");
   230     }
   230     }
   231 
   231 
   232     /**
   232     /**
   233      * {@inheritDoc}
   233      * {@inheritDoc}
   234      */
   234      */
   235     public String[] getSummaryTableHeader(ProgramElementDoc member) {
   235     public String[] getSummaryTableHeader(ProgramElementDoc member) {
   236         String[] header;
   236         String[] header;
   237         if (foundNonPubConstructor) {
   237         if (foundNonPubConstructor) {
   238             header = new String[] {
   238             header = new String[] {
   239                 configuration().getText("doclet.Modifier"),
   239                 configuration.getText("doclet.Modifier"),
   240                 configuration().getText("doclet.0_and_1",
   240                 configuration.getText("doclet.0_and_1",
   241                         configuration().getText("doclet.Constructor"),
   241                         configuration.getText("doclet.Constructor"),
   242                         configuration().getText("doclet.Description"))
   242                         configuration.getText("doclet.Description"))
   243             };
   243             };
   244         }
   244         }
   245         else {
   245         else {
   246             header = new String[] {
   246             header = new String[] {
   247                 configuration().getText("doclet.0_and_1",
   247                 configuration.getText("doclet.0_and_1",
   248                         configuration().getText("doclet.Constructor"),
   248                         configuration.getText("doclet.Constructor"),
   249                         configuration().getText("doclet.Description"))
   249                         configuration.getText("doclet.Description"))
   250             };
   250             };
   251         }
   251         }
   252         return header;
   252         return header;
   253     }
   253     }
   254 
   254 
   311                 code.addContent("private ");
   311                 code.addContent("private ");
   312             } else if (member.isPublic()) {
   312             } else if (member.isPublic()) {
   313                 code.addContent(writer.getSpace());
   313                 code.addContent(writer.getSpace());
   314             } else {
   314             } else {
   315                 code.addContent(
   315                 code.addContent(
   316                         configuration().getText("doclet.Package_private"));
   316                         configuration.getText("doclet.Package_private"));
   317             }
   317             }
   318             tdSummaryType.addContent(code);
   318             tdSummaryType.addContent(code);
   319         }
   319         }
   320     }
   320     }
   321 }
   321 }