langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java
changeset 23799 daa645653200
parent 22159 682da512ec17
child 25454 376a52c9540c
equal deleted inserted replaced
23798:ca0f80391182 23799:daa645653200
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    27 
    27 
    28 import java.util.*;
    28 import java.util.*;
    29 
    29 
    30 import com.sun.javadoc.*;
    30 import com.sun.javadoc.*;
    31 import com.sun.tools.javac.jvm.Profile;
    31 import com.sun.tools.javac.jvm.Profile;
       
    32 import com.sun.tools.javadoc.RootDocImpl;
    32 import com.sun.tools.doclets.formats.html.markup.*;
    33 import com.sun.tools.doclets.formats.html.markup.*;
    33 import com.sun.tools.doclets.internal.toolkit.*;
    34 import com.sun.tools.doclets.internal.toolkit.*;
    34 import com.sun.tools.doclets.internal.toolkit.builders.*;
    35 import com.sun.tools.doclets.internal.toolkit.builders.*;
    35 import com.sun.tools.doclets.internal.toolkit.taglets.*;
    36 import com.sun.tools.doclets.internal.toolkit.taglets.*;
    36 import com.sun.tools.doclets.internal.toolkit.util.*;
    37 import com.sun.tools.doclets.internal.toolkit.util.*;
   526 
   527 
   527     /**
   528     /**
   528      * {@inheritDoc}
   529      * {@inheritDoc}
   529      */
   530      */
   530     public void addFunctionalInterfaceInfo (Content classInfoTree) {
   531     public void addFunctionalInterfaceInfo (Content classInfoTree) {
   531         if (classDoc.isFunctionalInterface()) {
   532         if (isFunctionalInterface()) {
   532             Content dt = HtmlTree.DT(getResource("doclet.Functional_Interface"));
   533             Content dt = HtmlTree.DT(getResource("doclet.Functional_Interface"));
   533             Content dl = HtmlTree.DL(dt);
   534             Content dl = HtmlTree.DL(dt);
   534             Content dd = new HtmlTree(HtmlTag.DD);
   535             Content dd = new HtmlTree(HtmlTag.DD);
   535             dd.addContent(getResource("doclet.Functional_Interface_Message"));
   536             dd.addContent(getResource("doclet.Functional_Interface_Message"));
   536             dl.addContent(dd);
   537             dl.addContent(dd);
   537             classInfoTree.addContent(dl);
   538             classInfoTree.addContent(dl);
   538         }
   539         }
       
   540     }
       
   541 
       
   542     public boolean isFunctionalInterface() {
       
   543         if (configuration.root instanceof RootDocImpl) {
       
   544             RootDocImpl root = (RootDocImpl) configuration.root;
       
   545             AnnotationDesc[] annotationDescList = classDoc.annotations();
       
   546             for (AnnotationDesc annoDesc : annotationDescList) {
       
   547                 if (root.isFunctionalInterface(annoDesc)) {
       
   548                     return true;
       
   549                 }
       
   550             }
       
   551         }
       
   552         return false;
   539     }
   553     }
   540 
   554 
   541     /**
   555     /**
   542      * {@inheritDoc}
   556      * {@inheritDoc}
   543      */
   557      */