src/share/classes/com/sun/tools/doclets/internal/toolkit/util/links/LinkInfo.java

Wed, 10 Oct 2012 16:48:21 -0700

author
jjg
date
Wed, 10 Oct 2012 16:48:21 -0700
changeset 1359
25e14ad23cef
parent 554
9d9f26857129
child 1521
71f35e4b93a5
permissions
-rw-r--r--

8000665: fix "internal API" comments on javadoc files
Reviewed-by: darcy

     1 /*
     2  * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     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
     7  * published by the Free Software Foundation.  Oracle designates this
     8  * particular file as subject to the "Classpath" exception as provided
     9  * by Oracle in the LICENSE file that accompanied this code.
    10  *
    11  * This code is distributed in the hope that it will be useful, but WITHOUT
    12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    14  * version 2 for more details (a copy is included in the LICENSE file that
    15  * accompanied this code).
    16  *
    17  * You should have received a copy of the GNU General Public License version
    18  * 2 along with this work; if not, write to the Free Software Foundation,
    19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    20  *
    21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    22  * or visit www.oracle.com if you need additional information or have any
    23  * questions.
    24  */
    26 package com.sun.tools.doclets.internal.toolkit.util.links;
    28 import com.sun.javadoc.*;
    29 import com.sun.tools.doclets.internal.toolkit.Configuration;
    31 /**
    32  * Encapsulates information about a link.
    33  *
    34  *  <p><b>This is NOT part of any supported API.
    35  *  If you write code that depends on this, you do so at your own risk.
    36  *  This code and its internal interfaces are subject to change or
    37  *  deletion without notice.</b>
    38  *
    39  * @author Jamie Ho
    40  * @since 1.5
    41  */
    42 public abstract class LinkInfo {
    44     /**
    45      * The ClassDoc we want to link to.  Null if we are not linking
    46      * to a ClassDoc.
    47      */
    48     public ClassDoc classDoc;
    50     /**
    51      * The executable member doc we want to link to.  Null if we are not linking
    52      * to an executable member.
    53      */
    54     public ExecutableMemberDoc executableMemberDoc;
    56     /**
    57      * The Type we want to link to.  Null if we are not linking to a type.
    58      */
    59     public Type type;
    61     /**
    62      * True if this is a link to a VarArg.
    63      */
    64     public boolean isVarArg = false;
    66     /**
    67      * Set this to true to indicate that you are linking to a type parameter.
    68      */
    69     public boolean isTypeBound = false;
    71     /**
    72      * The label for the link.
    73      */
    74     public String label;
    76     /**
    77      * True if the link should be strong.
    78      */
    79     public boolean isStrong = false;
    81     /**
    82      * True if we should include the type in the link label.  False otherwise.
    83      */
    84     public boolean includeTypeInClassLinkLabel = true;
    86     /**
    87      * True if we should include the type as seperate link.  False otherwise.
    88      */
    89     public boolean includeTypeAsSepLink = false;
    91     /**
    92      * True if we should exclude the type bounds for the type parameter.
    93      */
    94     public boolean excludeTypeBounds = false;
    96     /**
    97      * True if we should print the type parameters, but not link them.
    98      */
    99     public boolean excludeTypeParameterLinks = false;
   101     /**
   102      * True if we should print the type bounds, but not link them.
   103      */
   104     public boolean excludeTypeBoundsLinks = false;
   106     /**
   107      * By default, the link can be to the page it's already on.  However,
   108      * there are cases where we don't want this (e.g. heading of class page).
   109      */
   110     public boolean linkToSelf = true;
   112     /**
   113      * The display length for the link.
   114      */
   115     public int displayLength = 0;
   117     /**
   118      * Return the id indicating where the link appears in the documentation.
   119      * This is used for special processing of different types of links.
   120      *
   121      * @return the id indicating where the link appears in the documentation.
   122      */
   123     public abstract int getContext();
   125     /**
   126      * Set the context.
   127      *
   128      * @param c the context id to set.
   129      */
   130     public abstract void setContext(int c);
   132     /**
   133      * Return true if this link is linkable and false if we can't link to the
   134      * desired place.
   135      *
   136      * @return true if this link is linkable and false if we can't link to the
   137      * desired place.
   138      */
   139     public abstract boolean isLinkable();
   141     /**
   142      * Return the label for this class link.
   143      *
   144      * @param configuration the current configuration of the doclet.
   145      * @return the label for this class link.
   146      */
   147     public String getClassLinkLabel(Configuration configuration) {
   148         if (label != null && label.length() > 0) {
   149             return label;
   150         } else if (isLinkable()) {
   151             return classDoc.name();
   152         } else {
   153             return configuration.getClassName(classDoc);
   154         }
   155     }
   156 }

mercurial