/* * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package jdk.javadoc.internal.doclets.formats.html; import java.io.*; import java.util.ArrayList; import java.util.EnumMap; import java.util.List; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; import jdk.javadoc.internal.doclets.toolkit.Content; import jdk.javadoc.internal.doclets.toolkit.util.DeprecatedAPIListBuilder; import jdk.javadoc.internal.doclets.toolkit.util.DocPath; import jdk.javadoc.internal.doclets.toolkit.util.DocPaths; import jdk.javadoc.internal.doclets.toolkit.util.DocletAbortException; import static jdk.javadoc.internal.doclets.toolkit.util.DeprecatedAPIListBuilder.*; /** * Generate File to list all the deprecated classes and class members with the * appropriate links. * *
This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*
* @see java.util.List
* @author Atul M Dambalkar
* @author Bhavesh Patel (Modified)
*/
public class DeprecatedListWriter extends SubWriterHolderWriter {
private String getAnchorName(DeprElementKind kind) {
switch (kind) {
case PACKAGE:
return "package";
case INTERFACE:
return "interface";
case CLASS:
return "class";
case ENUM:
return "enum";
case EXCEPTION:
return "exception";
case ERROR:
return "error";
case ANNOTATION_TYPE:
return "annotation.type";
case FIELD:
return "field";
case METHOD:
return "method";
case CONSTRUCTOR:
return "constructor";
case ENUM_CONSTANT:
return "enum.constant";
case ANNOTATION_TYPE_MEMBER:
return "annotation.type.member";
default:
throw new AssertionError("unknown kind: " + kind);
}
}
private String getHeadingKey(DeprElementKind kind) {
switch (kind) {
case PACKAGE:
return "doclet.Deprecated_Packages";
case INTERFACE:
return "doclet.Deprecated_Interfaces";
case CLASS:
return "doclet.Deprecated_Classes";
case ENUM:
return "doclet.Deprecated_Enums";
case EXCEPTION:
return "doclet.Deprecated_Exceptions";
case ERROR:
return "doclet.Deprecated_Errors";
case ANNOTATION_TYPE:
return "doclet.Deprecated_Annotation_Types";
case FIELD:
return "doclet.Deprecated_Fields";
case METHOD:
return "doclet.Deprecated_Methods";
case CONSTRUCTOR:
return "doclet.Deprecated_Constructors";
case ENUM_CONSTANT:
return "doclet.Deprecated_Enum_Constants";
case ANNOTATION_TYPE_MEMBER:
return "doclet.Deprecated_Annotation_Type_Members";
default:
throw new AssertionError("unknown kind: " + kind);
}
}
private String getSummaryKey(DeprElementKind kind) {
switch (kind) {
case PACKAGE:
return "doclet.deprecated_packages";
case INTERFACE:
return "doclet.deprecated_interfaces";
case CLASS:
return "doclet.deprecated_classes";
case ENUM:
return "doclet.deprecated_enums";
case EXCEPTION:
return "doclet.deprecated_exceptions";
case ERROR:
return "doclet.deprecated_errors";
case ANNOTATION_TYPE:
return "doclet.deprecated_annotation_types";
case FIELD:
return "doclet.deprecated_fields";
case METHOD:
return "doclet.deprecated_methods";
case CONSTRUCTOR:
return "doclet.deprecated_constructors";
case ENUM_CONSTANT:
return "doclet.deprecated_enum_constants";
case ANNOTATION_TYPE_MEMBER:
return "doclet.deprecated_annotation_type_members";
default:
throw new AssertionError("unknown kind: " + kind);
}
}
private String getHeaderKey(DeprElementKind kind) {
switch (kind) {
case PACKAGE:
return "doclet.Package";
case INTERFACE:
return "doclet.Interface";
case CLASS:
return "doclet.Class";
case ENUM:
return "doclet.Enum";
case EXCEPTION:
return "doclet.Exceptions";
case ERROR:
return "doclet.Errors";
case ANNOTATION_TYPE:
return "doclet.AnnotationType";
case FIELD:
return "doclet.Field";
case METHOD:
return "doclet.Method";
case CONSTRUCTOR:
return "doclet.Constructor";
case ENUM_CONSTANT:
return "doclet.Enum_Constant";
case ANNOTATION_TYPE_MEMBER:
return "doclet.Annotation_Type_Member";
default:
throw new AssertionError("unknown kind: " + kind);
}
}
private EnumMap