langtools/test/jdk/javadoc/tool/api/basic/taglets/UnderlineTaglet.java
changeset 44388 4d0903f1f311
parent 44189 dd311cfb920b
equal deleted inserted replaced
44387:8efb26290858 44388:4d0903f1f311
     1 /*
     1 /*
     2  * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
       
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  *
     4  *
     4  * Redistribution and use in source and binary forms, with or
     5  * This code is free software; you can redistribute it and/or modify it
     5  * without modification, are permitted provided that the following
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * conditions are met:
     7  * published by the Free Software Foundation.
     7  *
     8  *
     8  * -Redistributions of source code must retain the above copyright
     9  * This code is distributed in the hope that it will be useful, but WITHOUT
     9  *  notice, this list of conditions and the following disclaimer.
    10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
       
    11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
       
    12  * version 2 for more details (a copy is included in the LICENSE file that
       
    13  * accompanied this code).
    10  *
    14  *
    11  * -Redistribution in binary form must reproduce the above copyright
    15  * You should have received a copy of the GNU General Public License version
    12  *  notice, this list of conditions and the following disclaimer in
    16  * 2 along with this work; if not, write to the Free Software Foundation,
    13  *  the documentation and/or other materials provided with the
    17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    14  *  distribution.
       
    15  *
    18  *
    16  * Neither the name of Oracle nor the names of
    19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    17  * contributors may be used to endorse or promote products derived
    20  * or visit www.oracle.com if you need additional information or have any
    18  * from this software without specific prior written permission.
    21  * questions.
    19  *
       
    20  * This software is provided "AS IS," without a warranty of any
       
    21  * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
       
    22  * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
       
    23  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
       
    24  * EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY
       
    25  * DAMAGES OR LIABILITIES  SUFFERED BY LICENSEE AS A RESULT OF OR
       
    26  * RELATING TO USE, MODIFICATION OR DISTRIBUTION OF THE SOFTWARE OR
       
    27  * ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE
       
    28  * FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT,
       
    29  * SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
       
    30  * CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF
       
    31  * THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN
       
    32  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
       
    33  *
       
    34  * You acknowledge that Software is not designed, licensed or
       
    35  * intended for use in the design, construction, operation or
       
    36  * maintenance of any nuclear facility.
       
    37  */
    22  */
    38 
    23 
    39 import java.util.EnumSet;
    24 import java.util.EnumSet;
    40 import java.util.List;
    25 import java.util.List;
    41 import java.util.Set;
    26 import java.util.Set;
       
    27 import javax.lang.model.element.Element;
    42 
    28 
    43 import com.sun.source.doctree.DocTree;
    29 import com.sun.source.doctree.DocTree;
    44 import com.sun.source.doctree.TextTree;
    30 import com.sun.source.doctree.TextTree;
    45 import com.sun.source.doctree.UnknownBlockTagTree;
    31 import com.sun.source.doctree.UnknownBlockTagTree;
    46 import com.sun.source.doctree.UnknownInlineTagTree;
    32 import com.sun.source.doctree.UnknownInlineTagTree;
    86 
    72 
    87     /**
    73     /**
    88      * Given the <code>DocTree</code> representation of this custom
    74      * Given the <code>DocTree</code> representation of this custom
    89      * tag, return its string representation.
    75      * tag, return its string representation.
    90      * @param tags the list of trees representing of this custom tag.
    76      * @param tags the list of trees representing of this custom tag.
       
    77      * @param element the declaration to which the enclosing comment belongs
    91      */
    78      */
    92     public String toString(List<? extends DocTree> tags) {
    79     public String toString(List<? extends DocTree> tags, Element element) {
    93         return "<u>" + getText(tags.get(0)) + "</u>";
    80         return "<u>" + getText(tags.get(0)) + "</u>";
    94     }
    81     }
    95 
    82 
    96     static String getText(DocTree dt) {
    83     static String getText(DocTree dt) {
    97         return new SimpleDocTreeVisitor<String, Void>() {
    84         return new SimpleDocTreeVisitor<String, Void>() {