src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java

changeset 1521
71f35e4b93a5
parent 1477
8c0c63a6e3b7
child 1570
f91144b7da75
     1.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Wed Jan 23 20:57:40 2013 +0000
     1.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Wed Jan 23 13:27:24 2013 -0800
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -1730,6 +1730,17 @@
    1.11      }
    1.12  
    1.13      /**
    1.14 +     * Add the annotation types of the executable receiver.
    1.15 +     *
    1.16 +     * @param method the executable to write the receiver annotations for.
    1.17 +     * @param htmltree the documentation tree to which the annotation info will be
    1.18 +     *        added
    1.19 +     */
    1.20 +    public void addReceiverAnnotationInfo(ExecutableMemberDoc method, Content htmltree) {
    1.21 +        addAnnotationInfo(method, method.receiverAnnotations(), htmltree);
    1.22 +    }
    1.23 +
    1.24 +    /**
    1.25       * Adds the annotatation types for the given doc.
    1.26       *
    1.27       * @param doc the package to write annotations for
    1.28 @@ -1799,6 +1810,26 @@
    1.29       *         documented.
    1.30       */
    1.31      private List<String> getAnnotations(int indent, AnnotationDesc[] descList, boolean linkBreak) {
    1.32 +        return getAnnotations(indent, descList, linkBreak, true);
    1.33 +    }
    1.34 +
    1.35 +    /**
    1.36 +     * Return the string representations of the annotation types for
    1.37 +     * the given doc.
    1.38 +     *
    1.39 +     * A {@code null} {@code elementType} indicates that all the
    1.40 +     * annotations should be returned without any filtering.
    1.41 +     *
    1.42 +     * @param indent the number of extra spaces to indent the annotations.
    1.43 +     * @param descList the array of {@link AnnotationDesc}.
    1.44 +     * @param linkBreak if true, add new line between each member value.
    1.45 +     * @param elementType the type of targeted element (used for filtering
    1.46 +     *        type annotations from declaration annotations)
    1.47 +     * @return an array of strings representing the annotations being
    1.48 +     *         documented.
    1.49 +     */
    1.50 +    public List<String> getAnnotations(int indent, AnnotationDesc[] descList, boolean linkBreak,
    1.51 +            boolean isJava5DeclarationLocation) {
    1.52          List<String> results = new ArrayList<String>();
    1.53          StringBuilder annotation;
    1.54          for (int i = 0; i < descList.length; i++) {
    1.55 @@ -1812,6 +1843,11 @@
    1.56                      (!isAnnotationDocumented && !isContainerDocumented)) {
    1.57                  continue;
    1.58              }
    1.59 +            /* TODO: check logic here to correctly handle declaration
    1.60 +             * and type annotations.
    1.61 +            if  (Util.isDeclarationAnnotation(annotationDoc, isJava5DeclarationLocation)) {
    1.62 +                continue;
    1.63 +            }*/
    1.64              annotation = new StringBuilder();
    1.65              isAnnotationDocumented = false;
    1.66              LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,

mercurial