0N/A/*
553N/A * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
553N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
553N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
553N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
553N/A * or visit www.oracle.com if you need additional information or have any
553N/A * questions.
0N/A */
0N/A
0N/Apackage com.sun.tools.doclets.internal.toolkit.util.links;
0N/A
0N/Aimport com.sun.javadoc.*;
0N/Aimport com.sun.tools.doclets.internal.toolkit.Configuration;
0N/A
0N/A/**
0N/A * Encapsulates information about a link.
0N/A *
0N/A * @author Jamie Ho
0N/A * @since 1.5
0N/A */
0N/Apublic abstract class LinkInfo {
0N/A
0N/A /**
0N/A * The ClassDoc we want to link to. Null if we are not linking
0N/A * to a ClassDoc.
0N/A */
0N/A public ClassDoc classDoc;
0N/A
0N/A /**
0N/A * The executable member doc we want to link to. Null if we are not linking
0N/A * to an executable member.
0N/A */
0N/A public ExecutableMemberDoc executableMemberDoc;
0N/A
0N/A /**
0N/A * The Type we want to link to. Null if we are not linking to a type.
0N/A */
0N/A public Type type;
0N/A
0N/A /**
0N/A * True if this is a link to a VarArg.
0N/A */
0N/A public boolean isVarArg = false;
0N/A
0N/A /**
0N/A * Set this to true to indicate that you are linking to a type parameter.
0N/A */
0N/A public boolean isTypeBound = false;
0N/A
0N/A /**
0N/A * The label for the link.
0N/A */
0N/A public String label;
0N/A
0N/A /**
181N/A * True if the link should be strong.
0N/A */
181N/A public boolean isStrong = false;
0N/A
0N/A /**
0N/A * True if we should include the type in the link label. False otherwise.
0N/A */
0N/A public boolean includeTypeInClassLinkLabel = true;
0N/A
0N/A /**
0N/A * True if we should include the type as seperate link. False otherwise.
0N/A */
0N/A public boolean includeTypeAsSepLink = false;
0N/A
0N/A /**
0N/A * True if we should exclude the type bounds for the type parameter.
0N/A */
0N/A public boolean excludeTypeBounds = false;
0N/A
0N/A /**
0N/A * True if we should print the type parameters, but not link them.
0N/A */
0N/A public boolean excludeTypeParameterLinks = false;
0N/A
0N/A /**
0N/A * True if we should print the type bounds, but not link them.
0N/A */
0N/A public boolean excludeTypeBoundsLinks = false;
0N/A
0N/A /**
0N/A * By default, the link can be to the page it's already on. However,
0N/A * there are cases where we don't want this (e.g. heading of class page).
0N/A */
0N/A public boolean linkToSelf = true;
0N/A
0N/A /**
0N/A * The display length for the link.
0N/A */
0N/A public int displayLength = 0;
0N/A
0N/A /**
0N/A * Return the id indicating where the link appears in the documentation.
0N/A * This is used for special processing of different types of links.
0N/A *
0N/A * @return the id indicating where the link appears in the documentation.
0N/A */
0N/A public abstract int getContext();
0N/A
0N/A /**
0N/A * Set the context.
0N/A *
0N/A * @param c the context id to set.
0N/A */
0N/A public abstract void setContext(int c);
0N/A
0N/A /**
0N/A * Return true if this link is linkable and false if we can't link to the
0N/A * desired place.
0N/A *
0N/A * @return true if this link is linkable and false if we can't link to the
0N/A * desired place.
0N/A */
0N/A public abstract boolean isLinkable();
0N/A
0N/A /**
0N/A * Return the label for this class link.
0N/A *
0N/A * @param configuration the current configuration of the doclet.
0N/A * @return the label for this class link.
0N/A */
0N/A public String getClassLinkLabel(Configuration configuration) {
0N/A if (label != null && label.length() > 0) {
0N/A return label;
0N/A } else if (isLinkable()) {
0N/A return classDoc.name();
0N/A } else {
0N/A return configuration.getClassName(classDoc);
0N/A }
0N/A }
0N/A}