langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java
changeset 40587 1c355ea550ed
parent 40303 96a1226aca18
child 41452 ddaef4bba083
equal deleted inserted replaced
40519:e17429a7e843 40587:1c355ea550ed
    23  * questions.
    23  * questions.
    24  */
    24  */
    25 
    25 
    26 package jdk.javadoc.internal.doclets.formats.html;
    26 package jdk.javadoc.internal.doclets.formats.html;
    27 
    27 
    28 import java.io.IOException;
       
    29 import java.util.List;
    28 import java.util.List;
    30 
    29 
    31 import javax.lang.model.element.PackageElement;
    30 import javax.lang.model.element.PackageElement;
    32 import javax.lang.model.element.TypeElement;
    31 import javax.lang.model.element.TypeElement;
    33 import javax.lang.model.type.TypeMirror;
    32 import javax.lang.model.type.TypeMirror;
    40 import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
    39 import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
    41 import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeWriter;
    40 import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeWriter;
    42 import jdk.javadoc.internal.doclets.toolkit.Content;
    41 import jdk.javadoc.internal.doclets.toolkit.Content;
    43 import jdk.javadoc.internal.doclets.toolkit.builders.MemberSummaryBuilder;
    42 import jdk.javadoc.internal.doclets.toolkit.builders.MemberSummaryBuilder;
    44 import jdk.javadoc.internal.doclets.toolkit.util.CommentHelper;
    43 import jdk.javadoc.internal.doclets.toolkit.util.CommentHelper;
       
    44 import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
    45 import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
    45 import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
    46 import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
    46 import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
    47 import jdk.javadoc.internal.doclets.toolkit.util.DocletAbortException;
       
    48 import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap;
    47 import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap;
    49 
    48 
    50 /**
    49 /**
    51  * Generate the Class Information Page.
    50  * Generate the Class Information Page.
    52  *
    51  *
    76     /**
    75     /**
    77      * @param configuration the configuration
    76      * @param configuration the configuration
    78      * @param annotationType the annotation type being documented.
    77      * @param annotationType the annotation type being documented.
    79      * @param prevType the previous class that was documented.
    78      * @param prevType the previous class that was documented.
    80      * @param nextType the next class being documented.
    79      * @param nextType the next class being documented.
    81      * @throws java.lang.Exception
       
    82      */
    80      */
    83     public AnnotationTypeWriterImpl(ConfigurationImpl configuration,
    81     public AnnotationTypeWriterImpl(ConfigurationImpl configuration,
    84             TypeElement annotationType, TypeMirror prevType, TypeMirror nextType)
    82             TypeElement annotationType, TypeMirror prevType, TypeMirror nextType) {
    85             throws Exception {
       
    86         super(configuration, DocPath.forClass(configuration.utils, annotationType));
    83         super(configuration, DocPath.forClass(configuration.utils, annotationType));
    87         this.annotationType = annotationType;
    84         this.annotationType = annotationType;
    88         configuration.currentTypeElement = annotationType;
    85         configuration.currentTypeElement = annotationType;
    89         this.prev = prevType;
    86         this.prev = prevType;
    90         this.next = nextType;
    87         this.next = nextType;
   241 
   238 
   242     /**
   239     /**
   243      * {@inheritDoc}
   240      * {@inheritDoc}
   244      */
   241      */
   245     @Override
   242     @Override
   246     public void printDocument(Content contentTree) throws IOException {
   243     public void printDocument(Content contentTree) throws DocFileIOException {
   247         printHtmlDocument(configuration.metakeywords.getMetaKeywords(annotationType),
   244         printHtmlDocument(configuration.metakeywords.getMetaKeywords(annotationType),
   248                 true, contentTree);
   245                 true, contentTree);
   249     }
   246     }
   250 
   247 
   251     /**
   248     /**
   350      *
   347      *
   351      * @param subDiv the content tree to which the summary detail links will be added
   348      * @param subDiv the content tree to which the summary detail links will be added
   352      */
   349      */
   353     @Override
   350     @Override
   354     protected void addSummaryDetailLinks(Content subDiv) {
   351     protected void addSummaryDetailLinks(Content subDiv) {
   355         try {
   352         Content div = HtmlTree.DIV(getNavSummaryLinks());
   356             Content div = HtmlTree.DIV(getNavSummaryLinks());
   353         div.addContent(getNavDetailLinks());
   357             div.addContent(getNavDetailLinks());
   354         subDiv.addContent(div);
   358             subDiv.addContent(div);
       
   359         } catch (Exception e) {
       
   360             throw new DocletAbortException(e);
       
   361         }
       
   362     }
   355     }
   363 
   356 
   364     /**
   357     /**
   365      * Get summary links for navigation bar.
   358      * Get summary links for navigation bar.
   366      *
   359      *
   367      * @return the content tree for the navigation summary links
   360      * @return the content tree for the navigation summary links
   368      * @throws java.lang.Exception
   361      */
   369      */
   362     protected Content getNavSummaryLinks() {
   370     protected Content getNavSummaryLinks() throws Exception {
       
   371         Content li = HtmlTree.LI(contents.summaryLabel);
   363         Content li = HtmlTree.LI(contents.summaryLabel);
   372         li.addContent(Contents.SPACE);
   364         li.addContent(Contents.SPACE);
   373         Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
   365         Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
   374         MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder)
   366         MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder)
   375                 configuration.getBuilderFactory().getMemberSummaryBuilder(this);
   367                 configuration.getBuilderFactory().getMemberSummaryBuilder(this);
   415 
   407 
   416     /**
   408     /**
   417      * Get detail links for the navigation bar.
   409      * Get detail links for the navigation bar.
   418      *
   410      *
   419      * @return the content tree for the detail links
   411      * @return the content tree for the detail links
   420      * @throws java.lang.Exception
   412      */
   421      */
   413     protected Content getNavDetailLinks() {
   422     protected Content getNavDetailLinks() throws Exception {
       
   423         Content li = HtmlTree.LI(contents.detailLabel);
   414         Content li = HtmlTree.LI(contents.detailLabel);
   424         li.addContent(Contents.SPACE);
   415         li.addContent(Contents.SPACE);
   425         Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
   416         Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
   426         MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder)
   417         MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder)
   427                 configuration.getBuilderFactory().getMemberSummaryBuilder(this);
   418                 configuration.getBuilderFactory().getMemberSummaryBuilder(this);