JDK 11 jdk.javadoc.jmod - Java Document Tool

JDK 11 jdk.javadoc.jmod is the JMOD file for JDK 11 Java Document tool, which can be invoked by the "javadoc" command.

JDK 11 Java Document tool compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\jdk.javadoc.jmod.

JDK 11 Java Document tool compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.

JDK 11 Java Document tool source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\jdk.javadoc.

You can click and view the content of each source code file in the list below.

✍: FYIcenter

com/sun/tools/javadoc/main/AnnotationDescImpl.java

/*
 * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 */

package com.sun.tools.javadoc.main;

import com.sun.javadoc.*;

import com.sun.tools.javac.code.Attribute;
import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.util.List;
import com.sun.tools.javac.util.Pair;


/**
 * Represents an annotation.
 * An annotation associates a value with each element of an annotation type.
 * Sure it ought to be called "Annotation", but that clashes with
 * java.lang.annotation.Annotation.
 *
 *  <p><b>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.</b>
 *
 * @author Scott Seligman
 * @since 1.5
 */

@Deprecated(since="9", forRemoval=true)
@SuppressWarnings("removal")
public class AnnotationDescImpl implements AnnotationDesc {

    private final DocEnv env;
    private final Attribute.Compound annotation;


    AnnotationDescImpl(DocEnv env, Attribute.Compound annotation) {
        this.env = env;
        this.annotation = annotation;
    }

    /**
     * Returns the annotation type of this annotation.
     */
    public AnnotationTypeDoc annotationType() {
        ClassSymbol atsym = (ClassSymbol)annotation.type.tsym;
        if (annotation.type.isErroneous()) {
            env.warning(null, "javadoc.class_not_found", annotation.type.toString());
            return new AnnotationTypeDocImpl(env, atsym);
        } else {
            return (AnnotationTypeDoc)env.getClassDoc(atsym);
        }
    }

    /**
     * Returns this annotation's elements and their values.
     * Only those explicitly present in the annotation are
     * included, not those assuming their default values.
     * Returns an empty array if there are none.
     */
    public ElementValuePair[] elementValues() {
        List<Pair<MethodSymbol,Attribute>> vals = annotation.values;
        ElementValuePair res[] = new ElementValuePair[vals.length()];
        int i = 0;
        for (Pair<MethodSymbol,Attribute> val : vals) {
            res[i++] = new ElementValuePairImpl(env, val.fst, val.snd);
        }
        return res;
    }

    /**
     * Check for the synthesized bit on the annotation.
     *
     * @return true if the annotation is synthesized.
     */
    public boolean isSynthesized() {
        return annotation.isSynthesized();
    }

    /**
     * Returns a string representation of this annotation.
     * String is of one of the forms:
     * <pre>
     *     {@code @com.example.foo(name1=val1, name2=val2)}
     *     {@code @com.example.foo(val)}
     *     {@code @com.example.foo}
     * </pre>
     * Omit parens for marker annotations, and omit "value=" when allowed.
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder("@");
        sb.append(annotation.type.tsym);

        ElementValuePair vals[] = elementValues();
        if (vals.length > 0) {          // omit parens for marker annotation
            sb.append('(');
            boolean first = true;
            for (ElementValuePair val : vals) {
                if (!first) {
                    sb.append(", ");
                }
                first = false;

                String name = val.element().name();
                if (vals.length == 1 && name.equals("value")) {
                    sb.append(val.value());
                } else {
                    sb.append(val);
                }
            }
            sb.append(')');
        }
        return sb.toString();
    }


    /**
     * Represents an association between an annotation type element
     * and one of its values.
     */
    public static class ElementValuePairImpl implements ElementValuePair {

        private final DocEnv env;
        private final MethodSymbol meth;
        private final Attribute value;

        ElementValuePairImpl(DocEnv env, MethodSymbol meth, Attribute value) {
            this.env = env;
            this.meth = meth;
            this.value = value;
        }

        /**
         * Returns the annotation type element.
         */
        public AnnotationTypeElementDoc element() {
            return env.getAnnotationTypeElementDoc(meth);
        }

        /**
         * Returns the value associated with the annotation type element.
         */
        public AnnotationValue value() {
            return new AnnotationValueImpl(env, value);
        }

        /**
         * Returns a string representation of this pair
         * of the form "name=value".
         */
        @Override
        public String toString() {
            return meth.name + "=" + value();
        }
    }
}

com/sun/tools/javadoc/main/AnnotationDescImpl.java

 

Or download all of them as a single archive file:

File name: jdk.javadoc-11.0.1-src.zip
File size: 680806 bytes
Release date: 2018-11-04
Download 

 

JDK 11 jdk.jcmd.jmod - JCmd Tool

JDK 11 jdk.jartool.jmod - JAR Tool

Download and Use JDK 11

⇑⇑ FAQ for JDK (Java Development Kit)

2020-07-22, 68157👍, 0💬