mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-12 19:35:24 +00:00
8160196: Module summary page should display information based on "api" or "detail" mode
Reviewed-by: jjg, ksrini
This commit is contained in:
parent
8c5b717ec4
commit
4a4e893915
@ -149,6 +149,12 @@ public interface DocTree {
|
||||
*/
|
||||
PARAM("param"),
|
||||
|
||||
/**
|
||||
* Used for instances of {@link ProvidesTree}
|
||||
* representing an @provides tag.
|
||||
*/
|
||||
PROVIDES("provides"),
|
||||
|
||||
/**
|
||||
* Used for instances of {@link ReferenceTree}
|
||||
* representing a reference to a element in the
|
||||
@ -222,6 +228,12 @@ public interface DocTree {
|
||||
*/
|
||||
UNKNOWN_INLINE_TAG,
|
||||
|
||||
/**
|
||||
* Used for instances of {@link UsesTree}
|
||||
* representing an @uses tag.
|
||||
*/
|
||||
USES("uses"),
|
||||
|
||||
/**
|
||||
* Used for instances of {@link ValueTree}
|
||||
* representing an @value tag.
|
||||
|
||||
@ -184,6 +184,14 @@ public interface DocTreeVisitor<R,P> {
|
||||
*/
|
||||
R visitParam(ParamTree node, P p);
|
||||
|
||||
/**
|
||||
* Visits a ProvidesTree node.
|
||||
* @param node the node being visited
|
||||
* @param p a parameter value
|
||||
* @return a result value
|
||||
*/
|
||||
R visitProvides(ProvidesTree node, P p);
|
||||
|
||||
/**
|
||||
* Visits a ReferenceTree node.
|
||||
* @param node the node being visited
|
||||
@ -280,6 +288,14 @@ public interface DocTreeVisitor<R,P> {
|
||||
*/
|
||||
R visitUnknownInlineTag(UnknownInlineTagTree node, P p);
|
||||
|
||||
/**
|
||||
* Visits a UsesTree node.
|
||||
* @param node the node being visited
|
||||
* @param p a parameter value
|
||||
* @return a result value
|
||||
*/
|
||||
R visitUses(UsesTree node, P p);
|
||||
|
||||
/**
|
||||
* Visits a ValueTree node.
|
||||
* @param node the node being visited
|
||||
|
||||
@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (c) 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 com.sun.source.doctree;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* A tree node for a @provides block tag.
|
||||
*
|
||||
* <p>
|
||||
* @provides service-type description
|
||||
*
|
||||
* @since 9
|
||||
*/
|
||||
public interface ProvidesTree extends BlockTagTree {
|
||||
/**
|
||||
* Returns the name of the service type being documented.
|
||||
* @return the name of the service type
|
||||
*/
|
||||
ReferenceTree getServiceType();
|
||||
|
||||
/**
|
||||
* Returns a description of the service type being provided by the module.
|
||||
* @return the description
|
||||
*/
|
||||
List<? extends DocTree> getDescription();
|
||||
}
|
||||
@ -40,13 +40,13 @@ import java.util.List;
|
||||
*/
|
||||
public interface ThrowsTree extends BlockTagTree {
|
||||
/**
|
||||
* Returns a name of the exception being documented.
|
||||
* Returns the name of the exception being documented.
|
||||
* @return the name of the exception
|
||||
*/
|
||||
ReferenceTree getExceptionName();
|
||||
|
||||
/**
|
||||
* Returns the description of the reasons why the
|
||||
* Returns a description of the reasons why the
|
||||
* exception may be thrown.
|
||||
* @return the description
|
||||
*/
|
||||
|
||||
@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (c) 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 com.sun.source.doctree;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* A tree node for an @uses block tag.
|
||||
*
|
||||
* <p>
|
||||
* @uses service-type description
|
||||
*
|
||||
* @since 9
|
||||
*/
|
||||
public interface UsesTree extends BlockTagTree {
|
||||
/**
|
||||
* Returns the name of the service type being documented.
|
||||
* @return the name of the service type
|
||||
*/
|
||||
ReferenceTree getServiceType();
|
||||
|
||||
/**
|
||||
* Returns a description of the use of service type within the module.
|
||||
* @return the description
|
||||
*/
|
||||
List<? extends DocTree> getDescription();
|
||||
}
|
||||
@ -49,6 +49,7 @@ import com.sun.source.doctree.InheritDocTree;
|
||||
import com.sun.source.doctree.LinkTree;
|
||||
import com.sun.source.doctree.LiteralTree;
|
||||
import com.sun.source.doctree.ParamTree;
|
||||
import com.sun.source.doctree.ProvidesTree;
|
||||
import com.sun.source.doctree.ReferenceTree;
|
||||
import com.sun.source.doctree.ReturnTree;
|
||||
import com.sun.source.doctree.SeeTree;
|
||||
@ -61,6 +62,7 @@ import com.sun.source.doctree.TextTree;
|
||||
import com.sun.source.doctree.ThrowsTree;
|
||||
import com.sun.source.doctree.UnknownBlockTagTree;
|
||||
import com.sun.source.doctree.UnknownInlineTagTree;
|
||||
import com.sun.source.doctree.UsesTree;
|
||||
import com.sun.source.doctree.ValueTree;
|
||||
import com.sun.source.doctree.VersionTree;
|
||||
|
||||
@ -216,6 +218,14 @@ public interface DocTreeFactory {
|
||||
*/
|
||||
ParamTree newParamTree(boolean isTypeParameter, IdentifierTree name, List<? extends DocTree> description);
|
||||
|
||||
/**
|
||||
* Create a new {@code ProvidesTree} object, to represent a {@code @provides } tag.
|
||||
* @param name the name of the service type
|
||||
* @param description a description of the service being provided
|
||||
* @return a {@code ProvidesTree} object
|
||||
*/
|
||||
ProvidesTree newProvidesTree(ReferenceTree name, List<? extends DocTree> description);
|
||||
|
||||
/**
|
||||
* Create a new {@code ReferenceTree} object, to represent a reference to an API element.
|
||||
*
|
||||
@ -308,6 +318,14 @@ public interface DocTreeFactory {
|
||||
*/
|
||||
UnknownInlineTagTree newUnknownInlineTagTree(Name name, List<? extends DocTree> content);
|
||||
|
||||
/**
|
||||
* Create a new {@code UsesTree} object, to represent a {@code @uses } tag.
|
||||
* @param name the name of the service type
|
||||
* @param description a description of how the service will be used
|
||||
* @return a {@code UsesTree} object
|
||||
*/
|
||||
UsesTree newUsesTree(ReferenceTree name, List<? extends DocTree> description);
|
||||
|
||||
/**
|
||||
* Create a new {@code ValueTree} object, to represent a {@code {@value } } tag.
|
||||
* @param ref a reference to the value
|
||||
|
||||
@ -26,7 +26,6 @@
|
||||
package com.sun.source.util;
|
||||
|
||||
import com.sun.source.doctree.*;
|
||||
import com.sun.tools.javac.tree.DCTree.DCIndex;
|
||||
|
||||
|
||||
/**
|
||||
@ -325,6 +324,20 @@ public class DocTreeScanner<R,P> implements DocTreeVisitor<R,P> {
|
||||
return r;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc} This implementation scans the children in left to right order.
|
||||
*
|
||||
* @param node {@inheritDoc}
|
||||
* @param p {@inheritDoc}
|
||||
* @return the result of scanning
|
||||
*/
|
||||
@Override
|
||||
public R visitProvides(ProvidesTree node, P p) {
|
||||
R r = scan(node.getServiceType(), p);
|
||||
r = scanAndReduce(node.getDescription(), p, r);
|
||||
return r;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc} This implementation returns {@code null}.
|
||||
*
|
||||
@ -474,6 +487,20 @@ public class DocTreeScanner<R,P> implements DocTreeVisitor<R,P> {
|
||||
return scan(node.getContent(), p);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc} This implementation scans the children in left to right order.
|
||||
*
|
||||
* @param node {@inheritDoc}
|
||||
* @param p {@inheritDoc}
|
||||
* @return the result of scanning
|
||||
*/
|
||||
@Override
|
||||
public R visitUses(UsesTree node, P p) {
|
||||
R r = scan(node.getServiceType(), p);
|
||||
r = scanAndReduce(node.getDescription(), p, r);
|
||||
return r;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc} This implementation scans the children in left to right order.
|
||||
*
|
||||
|
||||
@ -210,6 +210,7 @@ public class SimpleDocTreeVisitor<R,P> implements DocTreeVisitor<R, P> {
|
||||
* @param p {@inheritDoc}
|
||||
* @return the result of {@code defaultAction}
|
||||
*/
|
||||
@Override
|
||||
public R visitHidden(HiddenTree node, P p) {
|
||||
return defaultAction(node, p);
|
||||
}
|
||||
@ -286,6 +287,18 @@ public class SimpleDocTreeVisitor<R,P> implements DocTreeVisitor<R, P> {
|
||||
return defaultAction(node, p);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc} This implementation calls {@code defaultAction}.
|
||||
*
|
||||
* @param node {@inheritDoc}
|
||||
* @param p {@inheritDoc}
|
||||
* @return the result of {@code defaultAction}
|
||||
*/
|
||||
@Override
|
||||
public R visitProvides(ProvidesTree node, P p) {
|
||||
return defaultAction(node, p);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc} This implementation calls {@code defaultAction}.
|
||||
*
|
||||
@ -430,6 +443,18 @@ public class SimpleDocTreeVisitor<R,P> implements DocTreeVisitor<R, P> {
|
||||
return defaultAction(node, p);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc} This implementation calls {@code defaultAction}.
|
||||
*
|
||||
* @param node {@inheritDoc}
|
||||
* @param p {@inheritDoc}
|
||||
* @return the result of {@code defaultAction}
|
||||
*/
|
||||
@Override
|
||||
public R visitUses(UsesTree node, P p) {
|
||||
return defaultAction(node, p);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc} This implementation calls {@code defaultAction}.
|
||||
*
|
||||
|
||||
@ -63,6 +63,7 @@ import com.sun.source.doctree.InheritDocTree;
|
||||
import com.sun.source.doctree.LinkTree;
|
||||
import com.sun.source.doctree.LiteralTree;
|
||||
import com.sun.source.doctree.ParamTree;
|
||||
import com.sun.source.doctree.ProvidesTree;
|
||||
import com.sun.source.doctree.ReferenceTree;
|
||||
import com.sun.source.doctree.ReturnTree;
|
||||
import com.sun.source.doctree.SerialDataTree;
|
||||
@ -73,6 +74,7 @@ import com.sun.source.doctree.TextTree;
|
||||
import com.sun.source.doctree.ThrowsTree;
|
||||
import com.sun.source.doctree.UnknownBlockTagTree;
|
||||
import com.sun.source.doctree.UnknownInlineTagTree;
|
||||
import com.sun.source.doctree.UsesTree;
|
||||
import com.sun.source.doctree.ValueTree;
|
||||
import com.sun.source.doctree.VersionTree;
|
||||
import com.sun.source.tree.Tree;
|
||||
@ -85,6 +87,7 @@ import com.sun.tools.javac.util.Assert;
|
||||
import com.sun.tools.javac.util.DefinedBy;
|
||||
import com.sun.tools.javac.util.DefinedBy.Api;
|
||||
import com.sun.tools.javac.util.StringUtils;
|
||||
|
||||
import static com.sun.tools.doclint.Messages.Group.*;
|
||||
|
||||
|
||||
@ -131,7 +134,7 @@ public class Checker extends DocTreePathScanner<Void, Void> {
|
||||
}
|
||||
}
|
||||
|
||||
private Deque<TagStackItem> tagStack; // TODO: maybe want to record starting tree as well
|
||||
private final Deque<TagStackItem> tagStack; // TODO: maybe want to record starting tree as well
|
||||
private HtmlTag currHeaderTag;
|
||||
|
||||
private final int implicitHeaderLevel;
|
||||
@ -823,6 +826,20 @@ public class Checker extends DocTreePathScanner<Void, Void> {
|
||||
}
|
||||
}
|
||||
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitProvides(ProvidesTree tree, Void ignore) {
|
||||
Element e = env.trees.getElement(env.currPath);
|
||||
if (e.getKind() != ElementKind.MODULE) {
|
||||
env.messages.error(REFERENCE, tree, "dc.invalid.provides");
|
||||
}
|
||||
ReferenceTree serviceType = tree.getServiceType();
|
||||
Element se = env.trees.getElement(new DocTreePath(getCurrentPath(), serviceType));
|
||||
if (se == null) {
|
||||
env.messages.error(REFERENCE, tree, "dc.service.not.found");
|
||||
}
|
||||
return super.visitProvides(tree, ignore);
|
||||
}
|
||||
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitReference(ReferenceTree tree, Void ignore) {
|
||||
String sig = tree.getSignature();
|
||||
@ -937,6 +954,20 @@ public class Checker extends DocTreePathScanner<Void, Void> {
|
||||
env.messages.error(SYNTAX, tree, "dc.tag.unknown", tagName);
|
||||
}
|
||||
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitUses(UsesTree tree, Void ignore) {
|
||||
Element e = env.trees.getElement(env.currPath);
|
||||
if (e.getKind() != ElementKind.MODULE) {
|
||||
env.messages.error(REFERENCE, tree, "dc.invalid.uses");
|
||||
}
|
||||
ReferenceTree serviceType = tree.getServiceType();
|
||||
Element se = env.trees.getElement(new DocTreePath(getCurrentPath(), serviceType));
|
||||
if (se == null) {
|
||||
env.messages.error(REFERENCE, tree, "dc.service.not.found");
|
||||
}
|
||||
return super.visitUses(tree, ignore);
|
||||
}
|
||||
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitValue(ValueTree tree, Void ignore) {
|
||||
ReferenceTree ref = tree.getReference();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2012, 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
|
||||
@ -41,8 +41,10 @@ dc.entity.invalid = invalid entity &{0};
|
||||
dc.exception.not.thrown = exception not thrown: {0}
|
||||
dc.invalid.anchor = invalid name for anchor: "{0}"
|
||||
dc.invalid.param = invalid use of @param
|
||||
dc.invalid.provides = invalid use of @provides
|
||||
dc.invalid.return = invalid use of @return
|
||||
dc.invalid.throws = invalid use of @throws
|
||||
dc.invalid.uses = invalid use of @uses
|
||||
dc.invalid.uri = invalid uri: "{0}"
|
||||
dc.missing.comment = no comment
|
||||
dc.missing.param = no @param for {0}
|
||||
@ -52,6 +54,7 @@ dc.no.alt.attr.for.image = no "alt" attribute for image
|
||||
dc.no.summary.or.caption.for.table=no summary or caption for table
|
||||
dc.param.name.not.found = @param name not found
|
||||
dc.ref.not.found = reference not found
|
||||
dc.service.not.found = service-type not found
|
||||
dc.tag.code.within.code = '{@code'} within <code>
|
||||
dc.tag.empty = empty <{0}> tag
|
||||
dc.tag.end.not.permitted = invalid end tag: </{0}>
|
||||
|
||||
@ -1160,6 +1160,16 @@ public class DocCommentParser {
|
||||
}
|
||||
},
|
||||
|
||||
// @provides service-name description
|
||||
new TagParser(Kind.BLOCK, DCTree.Kind.PROVIDES) {
|
||||
public DCTree parse(int pos) throws ParseException {
|
||||
skipWhitespace();
|
||||
DCReference ref = reference(true);
|
||||
List<DCTree> description = blockContent();
|
||||
return m.at(pos).newProvidesTree(ref, description);
|
||||
}
|
||||
},
|
||||
|
||||
// @return description
|
||||
new TagParser(Kind.BLOCK, DCTree.Kind.RETURN) {
|
||||
public DCTree parse(int pos) {
|
||||
@ -1261,6 +1271,16 @@ public class DocCommentParser {
|
||||
}
|
||||
},
|
||||
|
||||
// @uses service-name description
|
||||
new TagParser(Kind.BLOCK, DCTree.Kind.USES) {
|
||||
public DCTree parse(int pos) throws ParseException {
|
||||
skipWhitespace();
|
||||
DCReference ref = reference(true);
|
||||
List<DCTree> description = blockContent();
|
||||
return m.at(pos).newUsesTree(ref, description);
|
||||
}
|
||||
},
|
||||
|
||||
// {@value package.class#field}
|
||||
new TagParser(Kind.INLINE, DCTree.Kind.VALUE) {
|
||||
public DCTree parse(int pos) throws ParseException {
|
||||
|
||||
@ -574,6 +574,36 @@ public abstract class DCTree implements DocTree {
|
||||
}
|
||||
}
|
||||
|
||||
public static class DCProvides extends DCBlockTag implements ProvidesTree {
|
||||
public final DCReference serviceType;
|
||||
public final List<DCTree> description;
|
||||
|
||||
DCProvides(DCReference serviceType, List<DCTree> description) {
|
||||
this.serviceType = serviceType;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Kind getKind() {
|
||||
return Kind.PROVIDES;
|
||||
}
|
||||
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public <R, D> R accept(DocTreeVisitor<R, D> v, D d) {
|
||||
return v.visitProvides(this, d);
|
||||
}
|
||||
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public ReferenceTree getServiceType() {
|
||||
return serviceType;
|
||||
}
|
||||
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public List<? extends DocTree> getDescription() {
|
||||
return description;
|
||||
}
|
||||
}
|
||||
|
||||
public static class DCReference extends DCEndPosTree<DCReference> implements ReferenceTree {
|
||||
public final String signature;
|
||||
|
||||
@ -912,6 +942,36 @@ public abstract class DCTree implements DocTree {
|
||||
}
|
||||
}
|
||||
|
||||
public static class DCUses extends DCBlockTag implements UsesTree {
|
||||
public final DCReference serviceType;
|
||||
public final List<DCTree> description;
|
||||
|
||||
DCUses(DCReference serviceType, List<DCTree> description) {
|
||||
this.serviceType = serviceType;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Kind getKind() {
|
||||
return Kind.USES;
|
||||
}
|
||||
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public <R, D> R accept(DocTreeVisitor<R, D> v, D d) {
|
||||
return v.visitUses(this, d);
|
||||
}
|
||||
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public ReferenceTree getServiceType() {
|
||||
return serviceType;
|
||||
}
|
||||
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public List<? extends DocTree> getDescription() {
|
||||
return description;
|
||||
}
|
||||
}
|
||||
|
||||
public static class DCValue extends DCInlineTag implements ValueTree {
|
||||
public final DCReference ref;
|
||||
|
||||
|
||||
@ -129,8 +129,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitAttribute(AttributeTree node, Void p) {
|
||||
try {
|
||||
print(node.getName());
|
||||
@ -162,7 +161,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitAuthor(AuthorTree node, Void p) {
|
||||
try {
|
||||
printTagName(node);
|
||||
@ -174,7 +173,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitComment(CommentTree node, Void p) {
|
||||
try {
|
||||
print(node.getBody());
|
||||
@ -184,7 +183,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitDeprecated(DeprecatedTree node, Void p) {
|
||||
try {
|
||||
printTagName(node);
|
||||
@ -198,7 +197,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitDocComment(DocCommentTree node, Void p) {
|
||||
try {
|
||||
List<? extends DocTree> b = node.getFullBody();
|
||||
@ -213,7 +212,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitDocRoot(DocRootTree node, Void p) {
|
||||
try {
|
||||
print("{");
|
||||
@ -225,7 +224,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitEndElement(EndElementTree node, Void p) {
|
||||
try {
|
||||
print("</");
|
||||
@ -237,7 +236,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitEntity(EntityTree node, Void p) {
|
||||
try {
|
||||
print("&");
|
||||
@ -249,7 +248,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitErroneous(ErroneousTree node, Void p) {
|
||||
try {
|
||||
print(node.getBody());
|
||||
@ -259,7 +258,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitHidden(HiddenTree node, Void p) {
|
||||
try {
|
||||
printTagName(node);
|
||||
@ -273,7 +272,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitIdentifier(IdentifierTree node, Void p) {
|
||||
try {
|
||||
print(node.getName());
|
||||
@ -283,7 +282,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitIndex(IndexTree node, Void p) {
|
||||
try {
|
||||
print("{");
|
||||
@ -301,7 +300,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitInheritDoc(InheritDocTree node, Void p) {
|
||||
try {
|
||||
print("{");
|
||||
@ -313,7 +312,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitLink(LinkTree node, Void p) {
|
||||
try {
|
||||
print("{");
|
||||
@ -331,7 +330,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitLiteral(LiteralTree node, Void p) {
|
||||
try {
|
||||
print("{");
|
||||
@ -348,7 +347,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitParam(ParamTree node, Void p) {
|
||||
try {
|
||||
printTagName(node);
|
||||
@ -366,7 +365,23 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitProvides(ProvidesTree node, Void p) {
|
||||
try {
|
||||
printTagName(node);
|
||||
print(" ");
|
||||
print(node.getServiceType());
|
||||
if (!node.getDescription().isEmpty()) {
|
||||
print(" ");
|
||||
print(node.getDescription());
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new UncheckedIOException(e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitReference(ReferenceTree node, Void p) {
|
||||
try {
|
||||
print(node.getSignature());
|
||||
@ -376,7 +391,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitReturn(ReturnTree node, Void p) {
|
||||
try {
|
||||
printTagName(node);
|
||||
@ -388,7 +403,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitSee(SeeTree node, Void p) {
|
||||
try {
|
||||
printTagName(node);
|
||||
@ -406,7 +421,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitSerial(SerialTree node, Void p) {
|
||||
try {
|
||||
printTagName(node);
|
||||
@ -420,7 +435,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitSerialData(SerialDataTree node, Void p) {
|
||||
try {
|
||||
printTagName(node);
|
||||
@ -434,7 +449,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitSerialField(SerialFieldTree node, Void p) {
|
||||
try {
|
||||
printTagName(node);
|
||||
@ -452,7 +467,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitSince(SinceTree node, Void p) {
|
||||
try {
|
||||
printTagName(node);
|
||||
@ -464,7 +479,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitStartElement(StartElementTree node, Void p) {
|
||||
try {
|
||||
print("<");
|
||||
@ -487,7 +502,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitText(TextTree node, Void p) {
|
||||
try {
|
||||
print(node.getBody());
|
||||
@ -497,7 +512,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitThrows(ThrowsTree node, Void p) {
|
||||
try {
|
||||
printTagName(node);
|
||||
@ -513,7 +528,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitUnknownBlockTag(UnknownBlockTagTree node, Void p) {
|
||||
try {
|
||||
print("@");
|
||||
@ -526,7 +541,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitUnknownInlineTag(UnknownInlineTagTree node, Void p) {
|
||||
try {
|
||||
print("{");
|
||||
@ -541,7 +556,23 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitUses(UsesTree node, Void p) {
|
||||
try {
|
||||
printTagName(node);
|
||||
print(" ");
|
||||
print(node.getServiceType());
|
||||
if (!node.getDescription().isEmpty()) {
|
||||
print(" ");
|
||||
print(node.getDescription());
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new UncheckedIOException(e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitValue(ValueTree node, Void p) {
|
||||
try {
|
||||
print("{");
|
||||
@ -557,7 +588,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitVersion(VersionTree node, Void p) {
|
||||
try {
|
||||
printTagName(node);
|
||||
@ -569,7 +600,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DefinedBy(Api.COMPILER_TREE)
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public Void visitOther(DocTree node, Void p) {
|
||||
try {
|
||||
print("(UNKNOWN: " + node + ")");
|
||||
|
||||
@ -44,6 +44,8 @@ import com.sun.source.doctree.IdentifierTree;
|
||||
import com.sun.source.doctree.ReferenceTree;
|
||||
import com.sun.source.doctree.StartElementTree;
|
||||
import com.sun.source.doctree.TextTree;
|
||||
import com.sun.source.doctree.ProvidesTree;
|
||||
import com.sun.source.doctree.UsesTree;
|
||||
import com.sun.source.util.DocTreeFactory;
|
||||
import com.sun.tools.doclint.HtmlTag;
|
||||
import com.sun.tools.javac.api.JavacTrees;
|
||||
@ -67,6 +69,7 @@ import com.sun.tools.javac.tree.DCTree.DCInheritDoc;
|
||||
import com.sun.tools.javac.tree.DCTree.DCLink;
|
||||
import com.sun.tools.javac.tree.DCTree.DCLiteral;
|
||||
import com.sun.tools.javac.tree.DCTree.DCParam;
|
||||
import com.sun.tools.javac.tree.DCTree.DCProvides;
|
||||
import com.sun.tools.javac.tree.DCTree.DCReference;
|
||||
import com.sun.tools.javac.tree.DCTree.DCReturn;
|
||||
import com.sun.tools.javac.tree.DCTree.DCSee;
|
||||
@ -79,6 +82,7 @@ import com.sun.tools.javac.tree.DCTree.DCText;
|
||||
import com.sun.tools.javac.tree.DCTree.DCThrows;
|
||||
import com.sun.tools.javac.tree.DCTree.DCUnknownBlockTag;
|
||||
import com.sun.tools.javac.tree.DCTree.DCUnknownInlineTag;
|
||||
import com.sun.tools.javac.tree.DCTree.DCUses;
|
||||
import com.sun.tools.javac.tree.DCTree.DCValue;
|
||||
import com.sun.tools.javac.tree.DCTree.DCVersion;
|
||||
import com.sun.tools.javac.util.Context;
|
||||
@ -333,6 +337,13 @@ public class DocTreeMaker implements DocTreeFactory {
|
||||
return tree;
|
||||
}
|
||||
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public DCProvides newProvidesTree(ReferenceTree name, List<? extends DocTree> description) {
|
||||
DCProvides tree = new DCProvides((DCReference) name, cast(description));
|
||||
tree.pos = pos;
|
||||
return tree;
|
||||
}
|
||||
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public DCReference newReferenceTree(String signature) {
|
||||
try {
|
||||
@ -429,6 +440,13 @@ public class DocTreeMaker implements DocTreeFactory {
|
||||
return tree;
|
||||
}
|
||||
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public DCUses newUsesTree(ReferenceTree name, List<? extends DocTree> description) {
|
||||
DCUses tree = new DCUses((DCReference) name, cast(description));
|
||||
tree.pos = pos;
|
||||
return tree;
|
||||
}
|
||||
|
||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||
public DCValue newValueTree(ReferenceTree ref) {
|
||||
// TODO: verify the reference is to a constant value
|
||||
|
||||
@ -36,7 +36,6 @@ import javax.lang.model.element.TypeParameterElement;
|
||||
import javax.lang.model.type.TypeMirror;
|
||||
|
||||
import com.sun.source.doctree.DocTree;
|
||||
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlAttr;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
||||
@ -534,19 +533,19 @@ public abstract class AbstractMemberWriter {
|
||||
writer.addSummaryLinkComment(this, member, firstSentenceTags, tdDesc);
|
||||
tr.addContent(tdDesc);
|
||||
if (utils.isMethod(member) && !utils.isAnnotationType(member)) {
|
||||
int methodType = utils.isStatic(member) ? MethodTypes.STATIC.value() :
|
||||
MethodTypes.INSTANCE.value();
|
||||
int methodType = utils.isStatic(member) ? MethodTypes.STATIC.tableTabs().value() :
|
||||
MethodTypes.INSTANCE.tableTabs().value();
|
||||
if (utils.isInterface(member.getEnclosingElement())) {
|
||||
methodType = utils.isAbstract(member)
|
||||
? methodType | MethodTypes.ABSTRACT.value()
|
||||
: methodType | MethodTypes.DEFAULT.value();
|
||||
? methodType | MethodTypes.ABSTRACT.tableTabs().value()
|
||||
: methodType | MethodTypes.DEFAULT.tableTabs().value();
|
||||
} else {
|
||||
methodType = utils.isAbstract(member)
|
||||
? methodType | MethodTypes.ABSTRACT.value()
|
||||
: methodType | MethodTypes.CONCRETE.value();
|
||||
? methodType | MethodTypes.ABSTRACT.tableTabs().value()
|
||||
: methodType | MethodTypes.CONCRETE.tableTabs().value();
|
||||
}
|
||||
if (utils.isDeprecated(member) || utils.isDeprecated(typeElement)) {
|
||||
methodType = methodType | MethodTypes.DEPRECATED.value();
|
||||
methodType = methodType | MethodTypes.DEPRECATED.tableTabs().value();
|
||||
}
|
||||
methodTypesOr = methodTypesOr | methodType;
|
||||
String tableId = "i" + counter;
|
||||
@ -569,7 +568,7 @@ public abstract class AbstractMemberWriter {
|
||||
public boolean showTabs() {
|
||||
int value;
|
||||
for (MethodTypes type : EnumSet.allOf(MethodTypes.class)) {
|
||||
value = type.value();
|
||||
value = type.tableTabs().value();
|
||||
if ((value & methodTypesOr) == value) {
|
||||
methodTypes.add(type);
|
||||
}
|
||||
|
||||
@ -1135,8 +1135,10 @@ public class HtmlDocletWriter extends HtmlDocWriter {
|
||||
* @return a content for the module link
|
||||
*/
|
||||
public Content getModuleLink(ModuleElement mdle, Content label) {
|
||||
return getHyperLink(pathToRoot.resolve(
|
||||
DocPaths.moduleSummary(mdle)), label, "", "");
|
||||
boolean included = utils.isIncluded(mdle);
|
||||
return (included)
|
||||
? getHyperLink(pathToRoot.resolve(DocPaths.moduleSummary(mdle)), label, "", "")
|
||||
: label;
|
||||
}
|
||||
|
||||
public Content interfaceName(TypeElement typeElement, boolean qual) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -97,7 +97,7 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
|
||||
Content caption;
|
||||
if (showTabs) {
|
||||
caption = getTableCaption(mw.methodTypes);
|
||||
generateMethodTypesScript(mw.typeMap, mw.methodTypes);
|
||||
generateTableTabTypesScript(mw.typeMap, mw.methodTypes, "methods");
|
||||
}
|
||||
else {
|
||||
caption = getTableCaption(mw.getCaption());
|
||||
@ -123,13 +123,13 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
|
||||
for (MethodTypes type : methodTypes) {
|
||||
Content captionSpan;
|
||||
Content span;
|
||||
if (type.isDefaultTab()) {
|
||||
captionSpan = HtmlTree.SPAN(configuration.getContent(type.resourceKey()));
|
||||
span = HtmlTree.SPAN(type.tabId(),
|
||||
if (type.tableTabs().isDefaultTab()) {
|
||||
captionSpan = HtmlTree.SPAN(configuration.getContent(type.tableTabs().resourceKey()));
|
||||
span = HtmlTree.SPAN(type.tableTabs().tabId(),
|
||||
HtmlStyle.activeTableTab, captionSpan);
|
||||
} else {
|
||||
captionSpan = HtmlTree.SPAN(getMethodTypeLinks(type));
|
||||
span = HtmlTree.SPAN(type.tabId(),
|
||||
span = HtmlTree.SPAN(type.tableTabs().tabId(),
|
||||
HtmlStyle.tableTab, captionSpan);
|
||||
}
|
||||
Content tabSpan = HtmlTree.SPAN(HtmlStyle.tabEnd, Contents.SPACE);
|
||||
@ -146,8 +146,8 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
|
||||
* @return the content tree for the method type link
|
||||
*/
|
||||
public Content getMethodTypeLinks(MethodTypes methodType) {
|
||||
String jsShow = "javascript:show(" + methodType.value() +");";
|
||||
HtmlTree link = HtmlTree.A(jsShow, configuration.getContent(methodType.resourceKey()));
|
||||
String jsShow = "javascript:show(" + methodType.tableTabs().value() +");";
|
||||
HtmlTree link = HtmlTree.A(jsShow, configuration.getContent(methodType.tableTabs().resourceKey()));
|
||||
return link;
|
||||
}
|
||||
|
||||
|
||||
@ -28,6 +28,7 @@ package jdk.javadoc.internal.doclets.formats.html.markup;
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
import jdk.javadoc.doclet.DocletEnvironment.ModuleMode;
|
||||
import jdk.javadoc.internal.doclets.toolkit.Configuration;
|
||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||
import jdk.javadoc.internal.doclets.toolkit.Resources;
|
||||
@ -35,7 +36,8 @@ import jdk.javadoc.internal.doclets.toolkit.util.DocFile;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.DocletConstants;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.MethodTypes;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.ModulePackageTypes;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.TableTabTypes;
|
||||
|
||||
|
||||
/**
|
||||
@ -64,32 +66,37 @@ public class HtmlWriter {
|
||||
protected Configuration configuration;
|
||||
|
||||
/**
|
||||
* Header for table displaying modules and description..
|
||||
* Header for table displaying modules and description.
|
||||
*/
|
||||
protected final List<String> moduleTableHeader;
|
||||
|
||||
/**
|
||||
* Header for tables displaying packages and description..
|
||||
* Header for tables displaying packages and description.
|
||||
*/
|
||||
protected final List<String> packageTableHeader;
|
||||
|
||||
/**
|
||||
* Header for tables displaying modules and description..
|
||||
* Header for tables displaying modules and description.
|
||||
*/
|
||||
protected final List<String> requiresTableHeader;
|
||||
|
||||
/**
|
||||
* Header for tables displaying packages and description..
|
||||
* Header for tables displaying packages and description.
|
||||
*/
|
||||
protected final List<String> exportedPackagesTableHeader;
|
||||
|
||||
/**
|
||||
* Header for tables displaying types and description..
|
||||
* Header for tables displaying modules and exported packages.
|
||||
*/
|
||||
protected final List<String> additionalPackagesTableHeader;
|
||||
|
||||
/**
|
||||
* Header for tables displaying types and description.
|
||||
*/
|
||||
protected final List<String> usesTableHeader;
|
||||
|
||||
/**
|
||||
* Header for tables displaying types and description..
|
||||
* Header for tables displaying types and description.
|
||||
*/
|
||||
protected final List<String> providesTableHeader;
|
||||
|
||||
@ -129,12 +136,18 @@ public class HtmlWriter {
|
||||
packageTableHeader.add(resources.getText("doclet.Package"));
|
||||
packageTableHeader.add(resources.getText("doclet.Description"));
|
||||
requiresTableHeader = new ArrayList<>();
|
||||
requiresTableHeader.add(resources.getText("doclet.Modifier"));
|
||||
requiresTableHeader.add(resources.getText("doclet.Module"));
|
||||
requiresTableHeader.add(resources.getText("doclet.Description"));
|
||||
exportedPackagesTableHeader = new ArrayList<>();
|
||||
exportedPackagesTableHeader.add(resources.getText("doclet.Package"));
|
||||
if (configuration.docEnv.getModuleMode() == ModuleMode.ALL) {
|
||||
exportedPackagesTableHeader.add(resources.getText("doclet.Module"));
|
||||
}
|
||||
exportedPackagesTableHeader.add(resources.getText("doclet.Description"));
|
||||
additionalPackagesTableHeader = new ArrayList<>();
|
||||
additionalPackagesTableHeader.add(resources.getText("doclet.Module"));
|
||||
additionalPackagesTableHeader.add(resources.getText("doclet.Packages"));
|
||||
usesTableHeader = new ArrayList<>();
|
||||
usesTableHeader.add(resources.getText("doclet.Type"));
|
||||
usesTableHeader.add(resources.getText("doclet.Description"));
|
||||
@ -317,12 +330,15 @@ public class HtmlWriter {
|
||||
* Generated javascript variables for the document.
|
||||
*
|
||||
* @param typeMap map comprising of method and type relationship
|
||||
* @param methodTypes set comprising of all methods types for this class
|
||||
* @param tabTypes set comprising of all table tab types for this class
|
||||
* @param elementName packages or methods table for which tabs need to be displayed
|
||||
*/
|
||||
public void generateMethodTypesScript(Map<String,Integer> typeMap,
|
||||
Set<MethodTypes> methodTypes) {
|
||||
public void generateTableTabTypesScript(Map<String,Integer> typeMap,
|
||||
Set<? extends TableTabTypes> tabTypes, String elementName) {
|
||||
String sep = "";
|
||||
StringBuilder vars = new StringBuilder("var methods = {");
|
||||
StringBuilder vars = new StringBuilder("var ");
|
||||
vars.append(elementName)
|
||||
.append(" = {");
|
||||
for (Map.Entry<String,Integer> entry : typeMap.entrySet()) {
|
||||
vars.append(sep);
|
||||
sep = ",";
|
||||
@ -334,18 +350,18 @@ public class HtmlWriter {
|
||||
vars.append("};").append(DocletConstants.NL);
|
||||
sep = "";
|
||||
vars.append("var tabs = {");
|
||||
for (MethodTypes entry : methodTypes) {
|
||||
for (TableTabTypes entry : tabTypes) {
|
||||
vars.append(sep);
|
||||
sep = ",";
|
||||
vars.append(entry.value())
|
||||
vars.append(entry.tableTabs().value())
|
||||
.append(":")
|
||||
.append("[")
|
||||
.append("\"")
|
||||
.append(entry.tabId())
|
||||
.append(entry.tableTabs().tabId())
|
||||
.append("\"")
|
||||
.append(sep)
|
||||
.append("\"")
|
||||
.append(configuration.getText(entry.resourceKey()))
|
||||
.append(configuration.getText(entry.tableTabs().resourceKey()))
|
||||
.append("\"]");
|
||||
}
|
||||
vars.append("};")
|
||||
|
||||
@ -8,6 +8,7 @@ doclet.Package=Package
|
||||
doclet.Module=Module
|
||||
doclet.All_Packages=All Packages
|
||||
doclet.All_Modules=All Modules
|
||||
doclet.None=None
|
||||
doclet.Tree=Tree
|
||||
doclet.Class_Hierarchy=Class Hierarchy
|
||||
doclet.Window_Class_Hierarchy=Class Hierarchy
|
||||
|
||||
@ -82,7 +82,13 @@ doclet.tag_misuse=Tag {0} cannot be used in {1} documentation. It can only be u
|
||||
doclet.javafx_tag_misuse=Tags @propertyGetter, @propertySetter and @propertyDescription can only be used in JavaFX properties getters and setters.
|
||||
doclet.Package_Summary=Package Summary
|
||||
doclet.Requires_Summary=Requires
|
||||
doclet.Additional_Modules_Required_Summary=Additional Modules Required
|
||||
doclet.Additional_Exported_Packages_Summary=Additional Exported Packages
|
||||
doclet.Additional_Opened_Packages_Summary=Additional Opened Packages
|
||||
doclet.Exported_Packages_Summary=Exported Packages
|
||||
doclet.Opened_Packages_Summary=Opened Packages
|
||||
doclet.Concealed_Packages_Summary=Concealed Packages
|
||||
doclet.Packages_Summary=Packages
|
||||
doclet.Uses_Summary=Uses
|
||||
doclet.Provides_Summary=Provides
|
||||
doclet.Module_Summary=Module Summary
|
||||
@ -161,6 +167,7 @@ doclet.in={0} in {1}
|
||||
doclet.Use_Table_Summary=Use table, listing {0}, and an explanation
|
||||
doclet.Constants_Table_Summary={0} table, listing constant fields, and values
|
||||
doclet.Member_Table_Summary={0} table, listing {1}, and an explanation
|
||||
doclet.Additional_Packages_Table_Summary={0} table, listing {1}, and {2}
|
||||
doclet.fields=fields
|
||||
doclet.Fields=Fields
|
||||
doclet.properties=properties
|
||||
@ -188,7 +195,7 @@ doclet.subclasses=subclasses
|
||||
doclet.subinterfaces=subinterfaces
|
||||
doclet.Modifier=Modifier
|
||||
doclet.Type=Type
|
||||
doclet.Implementation=Implementation:
|
||||
doclet.Implementation=Implementation(s):
|
||||
doclet.Types=Types
|
||||
doclet.Members=Members
|
||||
doclet.SearchTags=SearchTags
|
||||
|
||||
@ -91,7 +91,7 @@ function show(type)
|
||||
count = 0;
|
||||
for (var key in methods) {
|
||||
var row = document.getElementById(key);
|
||||
if ((methods[key] & type) != 0) {
|
||||
if ((methods[key] & type) !== 0) {
|
||||
row.style.display = '';
|
||||
row.className = (count++ % 2) ? rowColor : altColor;
|
||||
}
|
||||
@ -101,6 +101,21 @@ function show(type)
|
||||
updateTabs(type);
|
||||
}
|
||||
|
||||
function showPkgs(type)
|
||||
{
|
||||
count = 0;
|
||||
for (var key in packages) {
|
||||
var row = document.getElementById(key);
|
||||
if ((packages[key] & type) !== 0) {
|
||||
row.style.display = '';
|
||||
row.className = (count++ % 2) ? rowColor : altColor;
|
||||
}
|
||||
else
|
||||
row.style.display = 'none';
|
||||
}
|
||||
updatePkgsTabs(type);
|
||||
}
|
||||
|
||||
function updateTabs(type)
|
||||
{
|
||||
for (var value in tabs) {
|
||||
@ -122,3 +137,19 @@ function updateModuleFrame(pFrame, cFrame)
|
||||
top.packageFrame.location = pFrame;
|
||||
top.classFrame.location = cFrame;
|
||||
}
|
||||
|
||||
function updatePkgsTabs(type)
|
||||
{
|
||||
for (var value in tabs) {
|
||||
var sNode = document.getElementById(tabs[value][0]);
|
||||
var spanNode = sNode.firstChild;
|
||||
if (value == type) {
|
||||
sNode.className = activeTableTab;
|
||||
spanNode.innerHTML = tabs[value][1];
|
||||
}
|
||||
else {
|
||||
sNode.className = tableTab;
|
||||
spanNode.innerHTML = "<a href=\"javascript:showPkgs(" + value + ");\">" + tabs[value][1] + "</a>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -472,7 +472,7 @@ Table styles
|
||||
border: none;
|
||||
height:16px;
|
||||
}
|
||||
.memberSummary caption span.activeTableTab span {
|
||||
.memberSummary caption span.activeTableTab span, .packagesSummary caption span.activeTableTab span {
|
||||
white-space:nowrap;
|
||||
padding-top:5px;
|
||||
padding-left:12px;
|
||||
@ -483,7 +483,7 @@ Table styles
|
||||
background-color:#F8981D;
|
||||
height:16px;
|
||||
}
|
||||
.memberSummary caption span.tableTab span {
|
||||
.memberSummary caption span.tableTab span, .packagesSummary caption span.tableTab span {
|
||||
white-space:nowrap;
|
||||
padding-top:5px;
|
||||
padding-left:12px;
|
||||
@ -494,7 +494,8 @@ Table styles
|
||||
background-color:#4D7A97;
|
||||
height:16px;
|
||||
}
|
||||
.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab {
|
||||
.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab,
|
||||
.packagesSummary caption span.tableTab, .packagesSummary caption span.activeTableTab {
|
||||
padding-top:0px;
|
||||
padding-left:0px;
|
||||
padding-right:0px;
|
||||
@ -511,7 +512,7 @@ Table styles
|
||||
float:left;
|
||||
background-color:#F8981D;
|
||||
}
|
||||
.memberSummary .activeTableTab .tabEnd {
|
||||
.memberSummary .activeTableTab .tabEnd, .packagesSummary .activeTableTab .tabEnd {
|
||||
display:none;
|
||||
width:5px;
|
||||
margin-right:3px;
|
||||
@ -519,7 +520,7 @@ Table styles
|
||||
float:left;
|
||||
background-color:#F8981D;
|
||||
}
|
||||
.memberSummary .tableTab .tabEnd {
|
||||
.memberSummary .tableTab .tabEnd, .packagesSummary .tableTab .tabEnd {
|
||||
display:none;
|
||||
width:5px;
|
||||
margin-right:3px;
|
||||
@ -562,21 +563,28 @@ td.colSecond, th.colSecond, td.colLast, th.colLast {
|
||||
.providesSummary th.colFirst, .providesSummary th.colLast, .providesSummary td.colFirst,
|
||||
.providesSummary td.colLast {
|
||||
white-space:normal;
|
||||
width:50%;
|
||||
font-size:13px;
|
||||
}
|
||||
.overviewSummary td.colFirst, .overviewSummary th.colFirst,
|
||||
.requiresSummary td.colFirst, .requiresSummary th.colFirst,
|
||||
.packagesSummary td.colFirst, .packagesSummary td.colSecond, .packagesSummary th.colFirst, .packagesSummary th,
|
||||
.usesSummary td.colFirst, .usesSummary th.colFirst,
|
||||
.useSummary td.colFirst, .useSummary th.colFirst,
|
||||
.providesSummary td.colFirst, .providesSummary th.colFirst,
|
||||
.memberSummary td.colFirst, .memberSummary th.colFirst,
|
||||
.memberSummary td.colSecond, .memberSummary th.colSecond,
|
||||
.typeSummary td.colFirst{
|
||||
width:25%;
|
||||
vertical-align:top;
|
||||
}
|
||||
td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colSecond a:link, td.colSecond a:active, td.colSecond a:visited, td.colSecond a:hover, th.colFirst a:link, th.colFirst a:active, th.colFirst a:visited, th.colFirst a:hover, th.colSecond a:link, th.colSecond a:active, th.colSecond a:visited, th.colSecond a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover {
|
||||
.packagesSummary th.colLast, .packagesSummary td.colLast {
|
||||
white-space:normal;
|
||||
}
|
||||
td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover,
|
||||
td.colSecond a:link, td.colSecond a:active, td.colSecond a:visited, td.colSecond a:hover,
|
||||
th.colFirst a:link, th.colFirst a:active, th.colFirst a:visited, th.colFirst a:hover,
|
||||
th.colSecond a:link, th.colSecond a:active, th.colSecond a:visited, th.colSecond a:hover,
|
||||
td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover,
|
||||
.constantValuesContainer td a:link, .constantValuesContainer td a:active,
|
||||
.constantValuesContainer td a:visited, .constantValuesContainer td a:hover {
|
||||
font-weight:bold;
|
||||
}
|
||||
.tableSubHeadingColor {
|
||||
@ -776,4 +784,4 @@ ul.ui-autocomplete li {
|
||||
.searchTagHolderResult {
|
||||
font-style:italic;
|
||||
font-size:12px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,6 +50,7 @@ import com.sun.source.doctree.InlineTagTree;
|
||||
import com.sun.source.doctree.LinkTree;
|
||||
import com.sun.source.doctree.LiteralTree;
|
||||
import com.sun.source.doctree.ParamTree;
|
||||
import com.sun.source.doctree.ProvidesTree;
|
||||
import com.sun.source.doctree.ReferenceTree;
|
||||
import com.sun.source.doctree.ReturnTree;
|
||||
import com.sun.source.doctree.SeeTree;
|
||||
@ -61,6 +62,7 @@ import com.sun.source.doctree.StartElementTree;
|
||||
import com.sun.source.doctree.TextTree;
|
||||
import com.sun.source.doctree.ThrowsTree;
|
||||
import com.sun.source.doctree.UnknownBlockTagTree;
|
||||
import com.sun.source.doctree.UsesTree;
|
||||
import com.sun.source.doctree.ValueTree;
|
||||
import com.sun.source.doctree.VersionTree;
|
||||
import com.sun.source.util.DocTreePath;
|
||||
@ -107,12 +109,14 @@ public class CommentHelper {
|
||||
case AUTHOR:
|
||||
case DEPRECATED:
|
||||
case PARAM:
|
||||
case PROVIDES:
|
||||
case RETURN:
|
||||
case SEE:
|
||||
case SERIAL_DATA:
|
||||
case SERIAL_FIELD:
|
||||
case THROWS:
|
||||
case UNKNOWN_BLOCK_TAG:
|
||||
case USES:
|
||||
case VERSION:
|
||||
return ((BlockTagTree)dtree).getTagName();
|
||||
case UNKNOWN_INLINE_TAG:
|
||||
@ -440,6 +444,11 @@ public class CommentHelper {
|
||||
return visit(node.getReference(), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Element visitProvides(ProvidesTree node, Void p) {
|
||||
return visit(node.getServiceType(), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Element visitValue(ValueTree node, Void p) {
|
||||
return visit(node.getReference(), null);
|
||||
@ -455,6 +464,11 @@ public class CommentHelper {
|
||||
return visit(node.getType(), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Element visitUses(UsesTree node, Void p) {
|
||||
return visit(node.getServiceType(), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Element defaultAction(DocTree node, Void p) {
|
||||
return null;
|
||||
@ -462,6 +476,14 @@ public class CommentHelper {
|
||||
}.visit(dtree, null);
|
||||
}
|
||||
|
||||
public TypeElement getServiceType(Configuration c, DocTree dtree) {
|
||||
Element e = getReferencedElement(c, dtree);
|
||||
if (e != null) {
|
||||
return c.utils.isTypeElement(e) ? (TypeElement) e : null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getReferencedSignature(DocTree dtree) {
|
||||
return new SimpleDocTreeVisitor<String, Void>() {
|
||||
@Override
|
||||
@ -553,6 +575,11 @@ public class CommentHelper {
|
||||
return asList(node.getBody().getBody());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends DocTree> visitProvides(ProvidesTree node, Void p) {
|
||||
return node.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends DocTree> visitSince(SinceTree node, Void p) {
|
||||
return node.getBody();
|
||||
@ -608,6 +635,11 @@ public class CommentHelper {
|
||||
return node.getContent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends DocTree> visitUses(UsesTree node, Void p) {
|
||||
return node.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<? extends DocTree> defaultAction(DocTree node, Void p) {
|
||||
return Collections.emptyList();
|
||||
|
||||
@ -30,40 +30,23 @@ package jdk.javadoc.internal.doclets.toolkit.util;
|
||||
*
|
||||
* @author Bhavesh Patel
|
||||
*/
|
||||
public enum MethodTypes {
|
||||
ALL(0xffff, "doclet.All_Methods", "t0", true),
|
||||
STATIC(0x1, "doclet.Static_Methods", "t1", false),
|
||||
INSTANCE(0x2, "doclet.Instance_Methods", "t2", false),
|
||||
ABSTRACT(0x4, "doclet.Abstract_Methods", "t3", false),
|
||||
CONCRETE(0x8, "doclet.Concrete_Methods", "t4", false),
|
||||
DEFAULT(0x10, "doclet.Default_Methods", "t5", false),
|
||||
DEPRECATED(0x20, "doclet.Deprecated_Methods", "t6", false);
|
||||
public enum MethodTypes implements TableTabTypes {
|
||||
|
||||
private final int value;
|
||||
private final String resourceKey;
|
||||
private final String tabId;
|
||||
private final boolean isDefaultTab;
|
||||
ALL(TableTabs.tab(0xffff, "doclet.All_Methods", "t0", true)),
|
||||
STATIC(TableTabs.tab(0x1, "doclet.Static_Methods", "t1", false)),
|
||||
INSTANCE(TableTabs.tab(0x2, "doclet.Instance_Methods", "t2", false)),
|
||||
ABSTRACT(TableTabs.tab(0x4, "doclet.Abstract_Methods", "t3", false)),
|
||||
CONCRETE(TableTabs.tab(0x8, "doclet.Concrete_Methods", "t4", false)),
|
||||
DEFAULT(TableTabs.tab(0x10, "doclet.Default_Methods", "t5", false)),
|
||||
DEPRECATED(TableTabs.tab(0x20, "doclet.Deprecated_Methods", "t6", false));
|
||||
|
||||
MethodTypes(int v, String k, String id, boolean dt) {
|
||||
this.value = v;
|
||||
this.resourceKey = k;
|
||||
this.tabId = id;
|
||||
this.isDefaultTab = dt;
|
||||
private final TableTabs tabs;
|
||||
|
||||
private MethodTypes(TableTabs t) {
|
||||
this.tabs = t;
|
||||
}
|
||||
|
||||
public int value() {
|
||||
return value;
|
||||
public TableTabs tableTabs() {
|
||||
return this.tabs;
|
||||
}
|
||||
|
||||
public String resourceKey() {
|
||||
return resourceKey;
|
||||
}
|
||||
|
||||
public String tabId() {
|
||||
return tabId;
|
||||
}
|
||||
|
||||
public boolean isDefaultTab() {
|
||||
return isDefaultTab;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright (c) 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.toolkit.util;
|
||||
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.TableTabTypes.TableTabs;
|
||||
|
||||
/**
|
||||
* Enum representing module package types.
|
||||
*
|
||||
* <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 Bhavesh Patel
|
||||
*/
|
||||
public enum ModulePackageTypes implements TableTabTypes {
|
||||
ALL(TableTabs.tab(0xffff, "doclet.All_Packages", "t0", true)),
|
||||
EXPORTED(TableTabs.tab(0x1, "doclet.Exported_Packages_Summary", "t1", false)),
|
||||
OPENED(TableTabs.tab(0x2, "doclet.Opened_Packages_Summary", "t2", false)),
|
||||
CONCEALED(TableTabs.tab(0x4, "doclet.Concealed_Packages_Summary", "t3", false));
|
||||
|
||||
private final TableTabs tabs;
|
||||
|
||||
private ModulePackageTypes(TableTabs t) {
|
||||
this.tabs = t;
|
||||
}
|
||||
|
||||
public TableTabs tableTabs() {
|
||||
return this.tabs;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Copyright (c) 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.toolkit.util;
|
||||
|
||||
/**
|
||||
* Interface representing table tab types.
|
||||
*
|
||||
* <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 Bhavesh Patel
|
||||
*/
|
||||
public interface TableTabTypes {
|
||||
|
||||
TableTabs tableTabs();
|
||||
|
||||
public static final class TableTabs {
|
||||
|
||||
private final int value;
|
||||
private final String resourceKey;
|
||||
private final String tabId;
|
||||
private final boolean isDefaultTab;
|
||||
|
||||
private TableTabs(int v, String k, String id, boolean dt) {
|
||||
this.value = v;
|
||||
this.resourceKey = k;
|
||||
this.tabId = id;
|
||||
this.isDefaultTab = dt;
|
||||
}
|
||||
|
||||
public static TableTabs tab(int value, String resourceKey, String tabId, boolean isDefaultTab) {
|
||||
return new TableTabs(value, resourceKey, tabId, isDefaultTab);
|
||||
}
|
||||
|
||||
public int value() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public String resourceKey() {
|
||||
return this.resourceKey;
|
||||
}
|
||||
|
||||
public String tabId() {
|
||||
return this.tabId;
|
||||
}
|
||||
|
||||
public boolean isDefaultTab() {
|
||||
return this.isDefaultTab;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -42,6 +42,7 @@ import javax.lang.model.element.ElementKind;
|
||||
import javax.lang.model.element.ExecutableElement;
|
||||
import javax.lang.model.element.Modifier;
|
||||
import javax.lang.model.element.ModuleElement;
|
||||
import javax.lang.model.element.ModuleElement.RequiresDirective;
|
||||
import javax.lang.model.element.PackageElement;
|
||||
import javax.lang.model.element.TypeElement;
|
||||
import javax.lang.model.element.TypeParameterElement;
|
||||
@ -1678,7 +1679,7 @@ public class Utils {
|
||||
return new Utils.ElementComparator<Element>() {
|
||||
@Override
|
||||
public int compare(Element mod1, Element mod2) {
|
||||
return compareFullyQualifiedNames(mod1, mod2);
|
||||
return compareNames(mod1, mod2);
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -2193,6 +2194,64 @@ public class Utils {
|
||||
return member.getEnclosingElement().getEnclosedElements().indexOf(member);
|
||||
}
|
||||
|
||||
private Map<ModuleElement, Set<PackageElement>> modulePackageMap = null;
|
||||
public Map<ModuleElement, Set<PackageElement>> getModulePackageMap() {
|
||||
if (modulePackageMap == null) {
|
||||
modulePackageMap = new HashMap<>();
|
||||
Set<PackageElement> pkgs = configuration.getIncludedPackageElements();
|
||||
pkgs.forEach((pkg) -> {
|
||||
ModuleElement mod = elementUtils.getModuleOf(pkg);
|
||||
modulePackageMap.computeIfAbsent(mod, m -> new HashSet<>()).add(pkg);
|
||||
});
|
||||
}
|
||||
return modulePackageMap;
|
||||
}
|
||||
|
||||
public Map<ModuleElement, String> getDependentModules(ModuleElement mdle) {
|
||||
Map<ModuleElement, String> result = new TreeMap<>(makeModuleComparator());
|
||||
Deque<ModuleElement> queue = new ArrayDeque<>();
|
||||
// get all the requires for the element in question
|
||||
for (RequiresDirective rd : ElementFilter.requiresIn(mdle.getDirectives())) {
|
||||
ModuleElement dep = rd.getDependency();
|
||||
// add the dependency to work queue
|
||||
if (!result.containsKey(dep)) {
|
||||
if (rd.isTransitive()) {
|
||||
queue.addLast(dep);
|
||||
}
|
||||
}
|
||||
// add all exports for the primary module
|
||||
result.put(rd.getDependency(), getModifiers(rd));
|
||||
}
|
||||
|
||||
// add only requires public for subsequent module dependencies
|
||||
for (ModuleElement m = queue.poll(); m != null; m = queue.poll()) {
|
||||
for (RequiresDirective rd : ElementFilter.requiresIn(m.getDirectives())) {
|
||||
ModuleElement dep = rd.getDependency();
|
||||
if (!result.containsKey(dep)) {
|
||||
if (rd.isTransitive()) {
|
||||
result.put(dep, getModifiers(rd));
|
||||
queue.addLast(dep);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public String getModifiers(RequiresDirective rd) {
|
||||
StringBuilder modifiers = new StringBuilder();
|
||||
String sep="";
|
||||
if (rd.isTransitive()) {
|
||||
modifiers.append("transitive");
|
||||
sep = " ";
|
||||
}
|
||||
if (rd.isStatic()) {
|
||||
modifiers.append(sep);
|
||||
modifiers.append("static");
|
||||
}
|
||||
return (modifiers.length() == 0) ? " " : modifiers.toString();
|
||||
}
|
||||
|
||||
public long getLineNumber(Element e) {
|
||||
TreePath path = getTreePath(e);
|
||||
if (path == null) { // maybe null if synthesized
|
||||
@ -3019,6 +3078,10 @@ public class Utils {
|
||||
return getBlockTags(element, DEPRECATED);
|
||||
}
|
||||
|
||||
public List<? extends DocTree> getProvidesTrees(Element element) {
|
||||
return getBlockTags(element, PROVIDES);
|
||||
}
|
||||
|
||||
public List<? extends DocTree> getSeeTrees(Element element) {
|
||||
return getBlockTags(element, SEE);
|
||||
}
|
||||
@ -3062,6 +3125,10 @@ public class Utils {
|
||||
return out;
|
||||
}
|
||||
|
||||
public List<? extends DocTree> getUsesTrees(Element element) {
|
||||
return getBlockTags(element, USES);
|
||||
}
|
||||
|
||||
public List<? extends DocTree> getFirstSentenceTrees(Element element) {
|
||||
DocCommentTree dcTree = getDocCommentTree(element);
|
||||
if (dcTree == null) {
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8154119 8154262 8156077 8157987 8154261 8154817 8135291 8155995 8162363 8168766 8168688 8162674
|
||||
* @bug 8154119 8154262 8156077 8157987 8154261 8154817 8135291 8155995 8162363 8168766 8168688 8162674 8160196
|
||||
* @summary Test modules support in javadoc.
|
||||
* @author bpatel
|
||||
* @library ../lib
|
||||
@ -45,7 +45,7 @@ public class TestModules extends JavadocTester {
|
||||
void testHtml4() {
|
||||
javadoc("-d", "out", "-use",
|
||||
"--module-source-path", testSrc,
|
||||
"--add-modules", "moduleA,moduleB",
|
||||
"--module", "moduleA,moduleB",
|
||||
"testpkgmdlA", "testpkgmdlB");
|
||||
checkExit(Exit.OK);
|
||||
checkDescription(true);
|
||||
@ -66,7 +66,7 @@ public class TestModules extends JavadocTester {
|
||||
void testHtml5() {
|
||||
javadoc("-d", "out-html5", "-html5", "-use",
|
||||
"--module-source-path", testSrc,
|
||||
"--add-modules", "moduleA,moduleB",
|
||||
"--module", "moduleA,moduleB",
|
||||
"testpkgmdlA", "testpkgmdlB");
|
||||
checkExit(Exit.OK);
|
||||
checkHtml5Description(true);
|
||||
@ -87,7 +87,7 @@ public class TestModules extends JavadocTester {
|
||||
void testHtml4NoComment() {
|
||||
javadoc("-d", "out-nocomment", "-nocomment", "-use",
|
||||
"--module-source-path", testSrc,
|
||||
"--add-modules", "moduleA,moduleB",
|
||||
"--module", "moduleA,moduleB",
|
||||
"testpkgmdlA", "testpkgmdlB");
|
||||
checkExit(Exit.OK);
|
||||
checkDescription(false);
|
||||
@ -104,7 +104,7 @@ public class TestModules extends JavadocTester {
|
||||
void testHtml5NoComment() {
|
||||
javadoc("-d", "out-html5-nocomment", "-nocomment", "-html5", "-use",
|
||||
"--module-source-path", testSrc,
|
||||
"--add-modules", "moduleA,moduleB",
|
||||
"--module", "moduleA,moduleB",
|
||||
"testpkgmdlA", "testpkgmdlB");
|
||||
checkExit(Exit.OK);
|
||||
checkHtml5Description(false);
|
||||
@ -154,7 +154,7 @@ public class TestModules extends JavadocTester {
|
||||
"-tag", "regular:a:Regular Tag:",
|
||||
"-tag", "moduletag:s:Module Tag:",
|
||||
"--module-source-path", testSrc,
|
||||
"--add-modules", "moduletags,moduleB",
|
||||
"--module", "moduletags,moduleB",
|
||||
"testpkgmdltags", "testpkgmdlB");
|
||||
checkExit(Exit.OK);
|
||||
checkModuleTags();
|
||||
@ -167,7 +167,7 @@ public class TestModules extends JavadocTester {
|
||||
void testModuleSummary() {
|
||||
javadoc("-d", "out-moduleSummary", "-use",
|
||||
"--module-source-path", testSrc,
|
||||
"--add-modules", "moduleA,moduleB",
|
||||
"--module", "moduleA,moduleB",
|
||||
"testpkgmdlA", "testpkgmdlB", "moduleB/testpkg2mdlB");
|
||||
checkExit(Exit.OK);
|
||||
checkModuleSummary();
|
||||
@ -181,7 +181,7 @@ public class TestModules extends JavadocTester {
|
||||
void testModuleFilesAndLinks() {
|
||||
javadoc("-d", "out-modulelinks",
|
||||
"--module-source-path", testSrc,
|
||||
"--add-modules", "moduleA",
|
||||
"--module", "moduleA",
|
||||
"testpkgmdlA");
|
||||
checkExit(Exit.OK);
|
||||
checkModuleFilesAndLinks(true);
|
||||
@ -216,6 +216,40 @@ public class TestModules extends JavadocTester {
|
||||
checkModuleAnnotation();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test module summary pages in "api" mode.
|
||||
*/
|
||||
@Test
|
||||
void testApiMode() {
|
||||
javadoc("-d", "out-api", "-use", "--show-module-contents=api", "-author", "-version",
|
||||
"-tag", "regular:a:Regular Tag:",
|
||||
"-tag", "moduletag:s:Module Tag:",
|
||||
"--module-source-path", testSrc,
|
||||
"--module", "moduleA,moduleB,moduleC,moduletags",
|
||||
"testpkgmdlA", "moduleA/concealedpkgmdlA", "testpkgmdlB", "testpkg2mdlB", "testpkgmdlC", "testpkgmdltags");
|
||||
checkExit(Exit.OK);
|
||||
checkModuleModeCommon();
|
||||
checkModuleModeApi(true);
|
||||
checkModuleModeAll(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test module summary pages in "all" mode.
|
||||
*/
|
||||
@Test
|
||||
void testAllMode() {
|
||||
javadoc("-d", "out-all", "-use", "--show-module-contents=all", "-author", "-version",
|
||||
"-tag", "regular:a:Regular Tag:",
|
||||
"-tag", "moduletag:s:Module Tag:",
|
||||
"--module-source-path", testSrc,
|
||||
"--module", "moduleA,moduleB,moduleC,moduletags",
|
||||
"testpkgmdlA", "moduleA/concealedpkgmdlA", "testpkgmdlB", "testpkg2mdlB", "testpkgmdlC", "testpkgmdltags");
|
||||
checkExit(Exit.OK);
|
||||
checkModuleModeCommon();
|
||||
checkModuleModeApi(false);
|
||||
checkModuleModeAll(true);
|
||||
}
|
||||
|
||||
void checkDescription(boolean found) {
|
||||
checkOutput("moduleA-summary.html", found,
|
||||
"<!-- ============ MODULE DESCRIPTION =========== -->\n"
|
||||
@ -247,7 +281,7 @@ public class TestModules extends JavadocTester {
|
||||
+ "<li class=\"blockList\">\n"
|
||||
+ "<ul class=\"blockList\">\n"
|
||||
+ "<li class=\"blockList\">\n"
|
||||
+ "<!-- ============ MODULES SUMMARY =========== -->");
|
||||
+ "<!-- ============ PACKAGES SUMMARY =========== -->");
|
||||
}
|
||||
|
||||
void checkHtml5Description(boolean found) {
|
||||
@ -287,7 +321,7 @@ public class TestModules extends JavadocTester {
|
||||
+ "<li class=\"blockList\">\n"
|
||||
+ "<ul class=\"blockList\">\n"
|
||||
+ "<li class=\"blockList\">\n"
|
||||
+ "<!-- ============ MODULES SUMMARY =========== -->");
|
||||
+ "<!-- ============ PACKAGES SUMMARY =========== -->");
|
||||
}
|
||||
|
||||
void checkModuleLink() {
|
||||
@ -322,30 +356,22 @@ public class TestModules extends JavadocTester {
|
||||
void checkModuleTags() {
|
||||
checkOutput("moduletags-summary.html", true,
|
||||
"Type Link: <a href=\"testpkgmdltags/TestClassInModuleTags.html\" title=\"class in "
|
||||
+ "testpkgmdltags\"><code>TestClassInModuleTags</code></a>.");
|
||||
checkOutput("moduletags-summary.html", true,
|
||||
+ "testpkgmdltags\"><code>TestClassInModuleTags</code></a>.",
|
||||
"Member Link: <a href=\"testpkgmdltags/TestClassInModuleTags.html#"
|
||||
+ "testMethod-java.lang.String-\"><code>testMethod(String)</code></a>.");
|
||||
checkOutput("moduletags-summary.html", true,
|
||||
"Package Link: <a href=\"testpkgmdltags/package-summary.html\"><code>testpkgmdltags</code></a>.");
|
||||
checkOutput("moduletags-summary.html", true,
|
||||
+ "testMethod-java.lang.String-\"><code>testMethod(String)</code></a>.",
|
||||
"Package Link: <a href=\"testpkgmdltags/package-summary.html\"><code>testpkgmdltags</code></a>.",
|
||||
"<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n"
|
||||
+ "<dd>JDK 9</dd>");
|
||||
checkOutput("moduletags-summary.html", true,
|
||||
+ "<dd>JDK 9</dd>",
|
||||
"<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
|
||||
+ "<dd>\"Test see tag\", \n"
|
||||
+ "<a href=\"testpkgmdltags/TestClassInModuleTags.html\" title=\"class in testpkgmdltags\"><code>"
|
||||
+ "TestClassInModuleTags</code></a></dd>");
|
||||
checkOutput("moduletags-summary.html", true,
|
||||
+ "TestClassInModuleTags</code></a></dd>",
|
||||
"<dt><span class=\"simpleTagLabel\">Regular Tag:</span></dt>\n"
|
||||
+ "<dd>Just a regular simple tag.</dd>");
|
||||
checkOutput("moduletags-summary.html", true,
|
||||
+ "<dd>Just a regular simple tag.</dd>",
|
||||
"<dt><span class=\"simpleTagLabel\">Module Tag:</span></dt>\n"
|
||||
+ "<dd>Just a simple module tag.</dd>");
|
||||
checkOutput("moduletags-summary.html", true,
|
||||
+ "<dd>Just a simple module tag.</dd>",
|
||||
"<dt><span class=\"simpleTagLabel\">Version:</span></dt>\n"
|
||||
+ "<dd>1.0</dd>");
|
||||
checkOutput("moduletags-summary.html", true,
|
||||
+ "<dd>1.0</dd>",
|
||||
"<dt><span class=\"simpleTagLabel\">Author:</span></dt>\n"
|
||||
+ "<dd>Bhavesh Patel</dd>");
|
||||
checkOutput("testpkgmdltags/TestClassInModuleTags.html", false,
|
||||
@ -428,96 +454,64 @@ public class TestModules extends JavadocTester {
|
||||
+ "<li><a href=\"#module.description\">Description</a> | <a "
|
||||
+ "href=\"#modules.summary\">Modules</a> | <a href=\"#packages.summary\">"
|
||||
+ "Packages</a> | Services</li>\n"
|
||||
+ "</ul>");
|
||||
checkOutput("moduleA-summary.html", true,
|
||||
+ "</ul>",
|
||||
"<!-- ============ MODULES SUMMARY =========== -->\n"
|
||||
+ "<a name=\"modules.summary\">\n"
|
||||
+ "<!-- -->\n"
|
||||
+ "</a>");
|
||||
checkOutput("moduleA-summary.html", true,
|
||||
"<tr class=\"altColor\">\n"
|
||||
+ "</a>",
|
||||
"<tr class=\"altColor\" id=\"i0\">\n"
|
||||
+ "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlA/package-summary.html\">testpkgmdlA</a></th>\n"
|
||||
+ "<td class=\"colSecond\">All Modules</td>\n"
|
||||
+ "<td class=\"colLast\"> </td>\n"
|
||||
+ "</tr>");
|
||||
checkOutput("moduleA-summary.html", true,
|
||||
+ "</tr>",
|
||||
"<!-- ============ PACKAGES SUMMARY =========== -->\n"
|
||||
+ "<a name=\"packages.summary\">\n"
|
||||
+ "<!-- -->\n"
|
||||
+ "</a>");
|
||||
checkOutput("moduleA-summary.html", true,
|
||||
"<tr class=\"rowColor\">\n"
|
||||
+ "<th class=\"colFirst\" scope=\"row\"><a href=\"moduleB-summary.html\">moduleB</a></th>\n"
|
||||
+ "</a>",
|
||||
"<tr class=\"altColor\">\n"
|
||||
+ "<td class=\"colFirst\">transitive</td>\n"
|
||||
+ "<th class=\"colSecond\" scope=\"row\"><a href=\"moduleB-summary.html\">moduleB</a></th>\n"
|
||||
+ "<td class=\"colLast\">\n"
|
||||
+ "<div class=\"block\">This is a test description for the moduleB module.</div>\n"
|
||||
+ "</td>\n"
|
||||
+ "</tr>");
|
||||
checkOutput("moduleB-summary.html", true,
|
||||
"<li><a href=\"#module.description\">Description</a> | <a "
|
||||
+ "href=\"#modules.summary\">Modules</a> | <a href=\"#packages.summary\">"
|
||||
+ "Packages</a> | <a href=\"#services.summary\">Services</a></li>");
|
||||
checkOutput("moduleB-summary.html", true,
|
||||
"<!-- ============ MODULES SUMMARY =========== -->\n"
|
||||
+ "<a name=\"modules.summary\">\n"
|
||||
+ "<!-- -->\n"
|
||||
+ "</a>");
|
||||
checkOutput("moduleB-summary.html", true,
|
||||
"<tr class=\"rowColor\">\n"
|
||||
+ "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkg2mdlB/package-summary.html\">"
|
||||
+ "testpkg2mdlB</a></th>\n"
|
||||
+ "<td class=\"colSecond\">moduleA</td>\n"
|
||||
+ "<td class=\"colLast\"> </td>\n"
|
||||
+ "</tr>");
|
||||
checkOutput("moduleB-summary.html", true,
|
||||
"<li><a href=\"#module.description\">Description</a> | Modules | "
|
||||
+ "<a href=\"#packages.summary\">Packages</a> | <a href=\"#services.summary\">"
|
||||
+ "Services</a></li>",
|
||||
"<!-- ============ PACKAGES SUMMARY =========== -->\n"
|
||||
+ "<a name=\"packages.summary\">\n"
|
||||
+ "<!-- -->\n"
|
||||
+ "</a>");
|
||||
checkOutput("moduleB-summary.html", true,
|
||||
"<tr class=\"altColor\">\n"
|
||||
+ "<th class=\"colFirst\" scope=\"row\"><a href=\"java.base-summary.html\">java.base</a></th>\n"
|
||||
+ "</a>",
|
||||
"<tr class=\"altColor\" id=\"i0\">\n"
|
||||
+ "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlB/package-summary.html\">testpkgmdlB</a></th>\n"
|
||||
+ "<td class=\"colLast\"> </td>\n"
|
||||
+ "</tr>");
|
||||
checkOutput("moduleB-summary.html", true,
|
||||
+ "</tr>",
|
||||
"<!-- ============ PACKAGES SUMMARY =========== -->\n"
|
||||
+ "<a name=\"packages.summary\">\n"
|
||||
+ "<!-- -->\n"
|
||||
+ "</a>",
|
||||
"<!-- ============ SERVICES SUMMARY =========== -->\n"
|
||||
+ "<a name=\"services.summary\">\n"
|
||||
+ "<!-- -->\n"
|
||||
+ "</a>");
|
||||
checkOutput("moduleB-summary.html", true,
|
||||
+ "</a>",
|
||||
"<tr class=\"altColor\">\n"
|
||||
+ "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlB/TestClassInModuleB.html\" "
|
||||
+ "title=\"class in testpkgmdlB\">TestClassInModuleB</a></th>\n"
|
||||
+ "<td class=\"colLast\"> </td>\n"
|
||||
+ "</tr>");
|
||||
checkOutput("moduleB-summary.html", true,
|
||||
+ "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlB/TestClassInModuleB.html\" title=\"class in testpkgmdlB\">TestClassInModuleB</a></th>\n"
|
||||
+ "<td class=\"colLast\">With a test description for uses. </td>\n"
|
||||
+ "</tr>",
|
||||
"<tr class=\"altColor\">\n"
|
||||
+ "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkg2mdlB/TestInterfaceInModuleB.html\" "
|
||||
+ "title=\"interface in testpkg2mdlB\">TestInterfaceInModuleB</a><br>"
|
||||
+ "(<span class=\"implementationLabel\">Implementation:</span> "
|
||||
+ "<a href=\"testpkgmdlB/TestClassInModuleB.html\" title=\"class in testpkgmdlB\">"
|
||||
+ "TestClassInModuleB</a>)</th>\n"
|
||||
+ "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkg2mdlB/TestInterface2InModuleB.html\" title=\"interface in testpkg2mdlB\">TestInterface2InModuleB</a></th>\n"
|
||||
+ "<td class=\"colLast\"> </td>\n"
|
||||
+ "</tr");
|
||||
checkOutput("moduleB-summary.html", true,
|
||||
"<caption><span>Exported Packages</span><span class=\"tabEnd\"> </span></caption>\n"
|
||||
+ "</tr>",
|
||||
"<caption><span>Opened Packages</span><span class=\"tabEnd\"> </span></caption>\n"
|
||||
+ "<tr>\n"
|
||||
+ "<th class=\"colFirst\" scope=\"col\">Package</th>\n"
|
||||
+ "<th class=\"colSecond\" scope=\"col\">Module</th>\n"
|
||||
+ "<th class=\"colLast\" scope=\"col\">Description</th>\n"
|
||||
+ "</tr>");
|
||||
checkOutput("moduleB-summary.html", true,
|
||||
"<caption><span>Requires</span><span class=\"tabEnd\"> </span></caption>\n"
|
||||
+ "<tr>\n"
|
||||
+ "<th class=\"colFirst\" scope=\"col\">Module</th>\n"
|
||||
+ "<th class=\"colLast\" scope=\"col\">Description</th>\n"
|
||||
+ "</tr>");
|
||||
checkOutput("moduleB-summary.html", true,
|
||||
+ "</tr>",
|
||||
"<caption><span>Uses</span><span class=\"tabEnd\"> </span></caption>\n"
|
||||
+ "<tr>\n"
|
||||
+ "<th class=\"colFirst\" scope=\"col\">Type</th>\n"
|
||||
+ "<th class=\"colLast\" scope=\"col\">Description</th>\n"
|
||||
+ "</tr>");
|
||||
checkOutput("moduleB-summary.html", true,
|
||||
+ "</tr>",
|
||||
"<caption><span>Provides</span><span class=\"tabEnd\"> </span></caption>\n"
|
||||
+ "<tr>\n"
|
||||
+ "<th class=\"colFirst\" scope=\"col\">Type</th>\n"
|
||||
@ -537,8 +531,7 @@ public class TestModules extends JavadocTester {
|
||||
checkOutput("module-overview-frame.html", true,
|
||||
"<li><a href=\"moduleA-frame.html\" target=\"packageListFrame\" "
|
||||
+ "onclick=\"updateModuleFrame('moduleA-type-frame.html','moduleA-summary.html');"
|
||||
+ "\">moduleA</a></li>");
|
||||
checkOutput("module-overview-frame.html", true,
|
||||
+ "\">moduleA</a></li>",
|
||||
"<li><a href=\"moduleB-frame.html\" target=\"packageListFrame\" "
|
||||
+ "onclick=\"updateModuleFrame('moduleB-type-frame.html','moduleB-summary.html');"
|
||||
+ "\">moduleB</a></li>");
|
||||
@ -558,13 +551,11 @@ public class TestModules extends JavadocTester {
|
||||
|
||||
void checkModuleFilesAndLinks(boolean found) {
|
||||
checkOutput("testpkgmdlA/package-summary.html", found,
|
||||
"<li><a href=\"../moduleA-summary.html\">Module</a></li>");
|
||||
checkOutput("testpkgmdlA/package-summary.html", found,
|
||||
"<li><a href=\"../moduleA-summary.html\">Module</a></li>",
|
||||
"<div class=\"subTitle\"><span class=\"moduleLabelInClass\">Module</span> "
|
||||
+ "<a href=\"../moduleA-summary.html\">moduleA</a></div>");
|
||||
checkOutput("testpkgmdlA/TestClassInModuleA.html", found,
|
||||
"<li><a href=\"../moduleA-summary.html\">Module</a></li>");
|
||||
checkOutput("testpkgmdlA/TestClassInModuleA.html", found,
|
||||
"<li><a href=\"../moduleA-summary.html\">Module</a></li>",
|
||||
"<div class=\"subTitle\"><span class=\"moduleLabelInClass\">Module</span> "
|
||||
+ "<a href=\"../moduleA-summary.html\">moduleA</a></div>");
|
||||
checkFiles(found,
|
||||
@ -584,8 +575,7 @@ public class TestModules extends JavadocTester {
|
||||
+ "<dd>\n"
|
||||
+ "<div class=\"block\">This is a test description for the moduleB module.</div>\n"
|
||||
+ "</dd>\n"
|
||||
+ "</dl>");
|
||||
checkOutput("index-all.html", found,
|
||||
+ "</dl>",
|
||||
"<dl>\n"
|
||||
+ "<dt><span class=\"searchTagLink\"><a href=\"moduleA-summary.html#searchphrase\">"
|
||||
+ "search phrase</a></span> - Search tag in moduleA</dt>\n"
|
||||
@ -596,6 +586,175 @@ public class TestModules extends JavadocTester {
|
||||
+ "</dl>");
|
||||
}
|
||||
|
||||
void checkModuleModeCommon() {
|
||||
checkOutput("overview-summary.html", true,
|
||||
"<th class=\"colFirst\" scope=\"row\"><a href=\"moduleA-summary.html\">moduleA</a></th>\n"
|
||||
+ "<td class=\"colLast\">\n"
|
||||
+ "<div class=\"block\">This is a test description for the moduleA module.</div>\n"
|
||||
+ "</td>",
|
||||
"<th class=\"colFirst\" scope=\"row\"><a href=\"moduleB-summary.html\">moduleB</a></th>\n"
|
||||
+ "<td class=\"colLast\">\n"
|
||||
+ "<div class=\"block\">This is a test description for the moduleB module.</div>\n"
|
||||
+ "</td>",
|
||||
"<th class=\"colFirst\" scope=\"row\"><a href=\"moduletags-summary.html\">moduletags</a></th>\n"
|
||||
+ "<td class=\"colLast\">\n"
|
||||
+ "<div class=\"block\">This is a test description for the moduleA module.<br>\n"
|
||||
+ " Type Link: <a href=\"testpkgmdltags/TestClassInModuleTags.html\" title=\"class in testpkgmdltags\"><code>TestClassInModuleTags</code></a>.<br>\n"
|
||||
+ " Member Link: <a href=\"testpkgmdltags/TestClassInModuleTags.html#testMethod-java.lang.String-\"><code>testMethod(String)</code></a>.<br>\n"
|
||||
+ " Package Link: <a href=\"testpkgmdltags/package-summary.html\"><code>testpkgmdltags</code></a>.<br></div>\n"
|
||||
+ "</td>");
|
||||
checkOutput("moduleA-summary.html", true,
|
||||
"<li><a href=\"#module.description\">Description</a> | <a href=\"#modules.summary\">"
|
||||
+ "Modules</a> | <a href=\"#packages.summary\">Packages</a> | Services</li>",
|
||||
"<td class=\"colFirst\">transitive</td>\n"
|
||||
+ "<th class=\"colSecond\" scope=\"row\"><a href=\"moduleB-summary.html\">moduleB</a></th>\n"
|
||||
+ "<td class=\"colLast\">\n"
|
||||
+ "<div class=\"block\">This is a test description for the moduleB module.</div>\n"
|
||||
+ "</td>",
|
||||
"<table class=\"packagesSummary\" summary=\"Additional Exported Packages table, listing modules, and packages\">\n"
|
||||
+ "<caption><span>Additional Exported Packages</span><span class=\"tabEnd\"> </span></caption>",
|
||||
"<table class=\"packagesSummary\" summary=\"Additional Opened Packages table, listing modules, and packages\">\n"
|
||||
+ "<caption><span>Additional Opened Packages</span><span class=\"tabEnd\"> </span></caption>\n"
|
||||
+ "<tr>\n"
|
||||
+ "<th class=\"colFirst\" scope=\"col\">Module</th>\n"
|
||||
+ "<th class=\"colLast\" scope=\"col\">Packages</th>\n"
|
||||
+ "</tr>\n"
|
||||
+ "<tbody>\n"
|
||||
+ "<tr class=\"altColor\">\n"
|
||||
+ "<th class=\"colFirst\" scope=\"row\"><a href=\"moduleB-summary.html\">moduleB</a></th>\n"
|
||||
+ "<td class=\"colLast\"><a href=\"testpkgmdlB/package-summary.html\">testpkgmdlB</a></td>\n"
|
||||
+ "</tr>\n"
|
||||
+ "</tbody>\n"
|
||||
+ "</table>");
|
||||
checkOutput("moduleB-summary.html", true,
|
||||
"<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlB/TestClassInModuleB.html\" title=\"class in testpkgmdlB\">TestClassInModuleB</a></th>\n"
|
||||
+ "<td class=\"colLast\">With a test description for uses. </td>");
|
||||
checkOutput("moduletags-summary.html", true,
|
||||
"<li><a href=\"#module.description\">Description</a> | <a href=\"#modules.summary\">Modules"
|
||||
+ "</a> | <a href=\"#packages.summary\">Packages</a> | Services</li>",
|
||||
"<table class=\"requiresSummary\" summary=\"Additional Modules Required table, listing modules, and an explanation\">\n"
|
||||
+ "<caption><span>Additional Modules Required</span><span class=\"tabEnd\"> </span></caption>",
|
||||
"<td class=\"colFirst\">transitive</td>\n"
|
||||
+ "<th class=\"colSecond\" scope=\"row\"><a href=\"moduleB-summary.html\">moduleB</a></th>\n"
|
||||
+ "<td class=\"colLast\">\n"
|
||||
+ "<div class=\"block\">This is a test description for the moduleB module.</div>\n"
|
||||
+ "</td>",
|
||||
"<table class=\"packagesSummary\" summary=\"Additional Exported Packages table, listing modules, and packages\">\n"
|
||||
+ "<caption><span>Additional Exported Packages</span><span class=\"tabEnd\"> </span></caption>",
|
||||
"<td class=\"colFirst\">transitive static</td>\n"
|
||||
+ "<th class=\"colSecond\" scope=\"row\"><a href=\"moduleA-summary.html\">moduleA</a></th>\n"
|
||||
+ "<td class=\"colLast\">\n"
|
||||
+ "<div class=\"block\">This is a test description for the moduleA module.</div>\n"
|
||||
+ "</td>",
|
||||
"<table class=\"requiresSummary\" summary=\"Requires table, listing modules, and an explanation\">\n"
|
||||
+ "<caption><span>Requires</span><span class=\"tabEnd\"> </span></caption>\n"
|
||||
+ "<tr>\n"
|
||||
+ "<th class=\"colFirst\" scope=\"col\">Modifier</th>\n"
|
||||
+ "<th class=\"colSecond\" scope=\"col\">Module</th>\n"
|
||||
+ "<th class=\"colLast\" scope=\"col\">Description</th>",
|
||||
"<table class=\"requiresSummary\" summary=\"Additional Modules Required table, listing modules, and an explanation\">\n"
|
||||
+ "<caption><span>Additional Modules Required</span><span class=\"tabEnd\"> </span></caption>\n"
|
||||
+ "<tr>\n"
|
||||
+ "<th class=\"colFirst\" scope=\"col\">Modifier</th>\n"
|
||||
+ "<th class=\"colSecond\" scope=\"col\">Module</th>\n"
|
||||
+ "<th class=\"colLast\" scope=\"col\">Description</th>",
|
||||
"<table class=\"packagesSummary\" summary=\"Additional Opened Packages table, listing modules, and packages\">\n"
|
||||
+ "<caption><span>Additional Opened Packages</span><span class=\"tabEnd\"> </span></caption>\n"
|
||||
+ "<tr>\n"
|
||||
+ "<th class=\"colFirst\" scope=\"col\">Module</th>\n"
|
||||
+ "<th class=\"colLast\" scope=\"col\">Packages</th>\n"
|
||||
+ "</tr>\n"
|
||||
+ "<tbody>\n"
|
||||
+ "<tr class=\"altColor\">\n"
|
||||
+ "<th class=\"colFirst\" scope=\"row\"><a href=\"moduleB-summary.html\">moduleB</a></th>\n"
|
||||
+ "<td class=\"colLast\"><a href=\"testpkgmdlB/package-summary.html\">testpkgmdlB</a></td>\n"
|
||||
+ "</tr>\n"
|
||||
+ "</tbody>\n"
|
||||
+ "</table>");
|
||||
}
|
||||
|
||||
void checkModuleModeApi(boolean found) {
|
||||
checkOutput("moduleA-summary.html", found,
|
||||
"<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlA/package-summary.html\">testpkgmdlA</a></th>\n"
|
||||
+ "<td class=\"colLast\"> </td>");
|
||||
checkOutput("moduleB-summary.html", found,
|
||||
"<li><a href=\"#module.description\">Description</a> | Modules | "
|
||||
+ "<a href=\"#packages.summary\">Packages</a> | <a href=\"#services.summary\">Services</a></li>",
|
||||
"<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlB/package-summary.html\">testpkgmdlB</a></th>\n"
|
||||
+ "<td class=\"colLast\"> </td>",
|
||||
"<table class=\"packagesSummary\" summary=\"Packages table, listing packages, and an explanation\">\n"
|
||||
+ "<caption><span>Opened Packages</span><span class=\"tabEnd\"> </span></caption>\n"
|
||||
+ "<tr>\n"
|
||||
+ "<th class=\"colFirst\" scope=\"col\">Package</th>\n"
|
||||
+ "<th class=\"colLast\" scope=\"col\">Description</th>\n"
|
||||
+ "</tr>\n"
|
||||
+ "<tbody>\n"
|
||||
+ "<tr class=\"altColor\" id=\"i0\">\n"
|
||||
+ "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlB/package-summary.html\">testpkgmdlB</a></th>\n"
|
||||
+ "<td class=\"colLast\"> </td>\n"
|
||||
+ "</tr>\n"
|
||||
+ "</tbody>\n"
|
||||
+ "</table>");
|
||||
checkOutput("moduletags-summary.html", found,
|
||||
"<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdltags/package-summary.html\">testpkgmdltags</a></th>\n"
|
||||
+ "<td class=\"colLast\"> </td>");
|
||||
}
|
||||
|
||||
void checkModuleModeAll(boolean found) {
|
||||
checkOutput("moduleA-summary.html", found,
|
||||
"<td class=\"colFirst\"> </td>\n"
|
||||
+ "<th class=\"colSecond\" scope=\"row\">java.base</th>\n"
|
||||
+ "<td class=\"colLast\"> </td>",
|
||||
"<td class=\"colFirst\"> </td>\n"
|
||||
+ "<th class=\"colSecond\" scope=\"row\"><a href=\"moduleC-summary.html\">moduleC</a></th>\n"
|
||||
+ "<td class=\"colLast\">\n"
|
||||
+ "<div class=\"block\">This is a test description for the moduleC module.</div>\n"
|
||||
+ "</td>",
|
||||
"<th class=\"colFirst\" scope=\"row\"><a href=\"moduleC-summary.html\">moduleC</a></th>\n"
|
||||
+ "<td class=\"colLast\"><a href=\"testpkgmdlC/package-summary.html\">testpkgmdlC</a></td>",
|
||||
"<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlA/package-summary.html\">testpkgmdlA</a></th>\n"
|
||||
+ "<td class=\"colSecond\">All Modules</td>\n"
|
||||
+ "<td class=\"colLast\"> </td>",
|
||||
"<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Packages</span><span class=\"tabEnd\"> </span></span>"
|
||||
+ "<span id=\"t1\" class=\"tableTab\"><span><a href=\"javascript:showPkgs(1);\">Exported Packages</a></span>"
|
||||
+ "<span class=\"tabEnd\"> </span></span><span id=\"t3\" class=\"tableTab\"><span><a href=\"javascript:showPkgs(4);\">"
|
||||
+ "Concealed Packages</a></span><span class=\"tabEnd\"> </span></span></caption>",
|
||||
"<th class=\"colFirst\" scope=\"row\"><a href=\"concealedpkgmdlA/package-summary.html\">concealedpkgmdlA</a></th>\n"
|
||||
+ "<td class=\"colSecond\">None</td>\n"
|
||||
+ "<td class=\"colLast\"> </td>");
|
||||
checkOutput("moduleB-summary.html", found,
|
||||
"<li><a href=\"#module.description\">Description</a> | <a href=\"#modules.summary\">"
|
||||
+ "Modules</a> | <a href=\"#packages.summary\">Packages</a> | <a href=\"#services.summary\">Services</a></li>",
|
||||
"<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlB/package-summary.html\">testpkgmdlB</a></th>\n"
|
||||
+ "<td class=\"colSecond\">All Modules</td>\n"
|
||||
+ "<td class=\"colLast\"> </td>",
|
||||
"<td class=\"colFirst\"> </td>\n"
|
||||
+ "<th class=\"colSecond\" scope=\"row\">java.base</th>\n"
|
||||
+ "<td class=\"colLast\"> </td>",
|
||||
"<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlB/TestClass2InModuleB.html\" title=\"class in testpkgmdlB\">TestClass2InModuleB</a></th>\n"
|
||||
+ "<td class=\"colLast\"> </td>",
|
||||
"<th class=\"colFirst\" scope=\"row\"><a href=\"testpkg2mdlB/TestInterface2InModuleB.html\" title=\"interface in testpkg2mdlB\">TestInterface2InModuleB</a></th>\n"
|
||||
+ "<td class=\"colLast\"> <br>(<span class=\"implementationLabel\">Implementation(s):</span> <a href=\"testpkgmdlB/TestClass2InModuleB.html\" "
|
||||
+ "title=\"class in testpkgmdlB\">TestClass2InModuleB</a>)</td>",
|
||||
"<th class=\"colFirst\" scope=\"row\"><a href=\"testpkg2mdlB/TestInterfaceInModuleB.html\" title=\"interface in testpkg2mdlB\">TestInterfaceInModuleB</a></th>\n"
|
||||
+ "<td class=\"colLast\"> <br>(<span class=\"implementationLabel\">Implementation(s):</span> <a href=\"testpkgmdlB/TestClassInModuleB.html\" "
|
||||
+ "title=\"class in testpkgmdlB\">TestClassInModuleB</a>)</td>",
|
||||
"<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Packages</span><span class=\"tabEnd\"> </span></span><span id=\"t1\" class=\"tableTab\"><span>"
|
||||
+ "<a href=\"javascript:showPkgs(1);\">Exported Packages</a></span><span class=\"tabEnd\"> </span></span><span id=\"t2\" class=\"tableTab\"><span>"
|
||||
+ "<a href=\"javascript:showPkgs(2);\">Opened Packages</a></span><span class=\"tabEnd\"> </span></span></caption>");
|
||||
checkOutput("moduleC-summary.html", found,
|
||||
"<caption><span>Exported Packages</span><span class=\"tabEnd\"> </span></caption>\n"
|
||||
+ "<tr>\n"
|
||||
+ "<th class=\"colFirst\" scope=\"col\">Package</th>\n"
|
||||
+ "<th class=\"colSecond\" scope=\"col\">Module</th>\n"
|
||||
+ "<th class=\"colLast\" scope=\"col\">Description</th>\n"
|
||||
+ "</tr>");
|
||||
checkOutput("moduletags-summary.html", found,
|
||||
"<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdltags/package-summary.html\">testpkgmdltags</a></th>\n"
|
||||
+ "<td class=\"colSecond\">All Modules</td>\n"
|
||||
+ "<td class=\"colLast\"> </td>");
|
||||
}
|
||||
|
||||
void checkModuleDeprecation(boolean found) {
|
||||
checkOutput("moduleA-summary.html", found,
|
||||
"<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated, for removal:"
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (c) 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 concealedpkgmdlA;
|
||||
|
||||
public class ConcealedClassInModuleA {
|
||||
public void testMethodConcealedClass() { }
|
||||
}
|
||||
@ -30,7 +30,8 @@
|
||||
*/
|
||||
@Deprecated(forRemoval=true)
|
||||
module moduleA {
|
||||
requires moduleB;
|
||||
requires transitive moduleB;
|
||||
requires moduleC;
|
||||
|
||||
exports testpkgmdlA;
|
||||
}
|
||||
|
||||
@ -26,16 +26,20 @@
|
||||
/**
|
||||
* This is a test description for the moduleB module. Search word {@index search_word} with no description.
|
||||
*
|
||||
* @uses testpkgmdlB.TestClassInModuleB With a test description for uses.
|
||||
* @provides testpkg2mdlB.TestInterface2InModuleB
|
||||
* @deprecated This module is deprecated using just the javadoc tag.
|
||||
*/
|
||||
@testpkgmdlB.AnnotationType(optional="Module Annotation", required=2016)
|
||||
@testpkgmdlB.AnnotationTypeUndocumented(optional="Module Annotation", required=2016)
|
||||
module moduleB {
|
||||
exports testpkgmdlB;
|
||||
opens testpkgmdlB;
|
||||
|
||||
exports testpkg2mdlB to moduleA;
|
||||
|
||||
uses testpkgmdlB.TestClassInModuleB;
|
||||
uses testpkgmdlB.TestClass2InModuleB;
|
||||
|
||||
provides testpkg2mdlB.TestInterfaceInModuleB with testpkgmdlB.TestClassInModuleB;
|
||||
provides testpkg2mdlB.TestInterface2InModuleB with testpkgmdlB.TestClass2InModuleB;
|
||||
}
|
||||
|
||||
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 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 testpkg2mdlB;
|
||||
|
||||
public interface TestInterface2InModuleB {
|
||||
void testMethod2();
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 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 testpkgmdlB;
|
||||
|
||||
import testpkg2mdlB.TestInterface2InModuleB;
|
||||
|
||||
public class TestClass2InModuleB implements TestInterface2InModuleB {
|
||||
void testMethod2() {}
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (c) 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This is a test description for the moduleC module.
|
||||
*/
|
||||
module moduleC {
|
||||
|
||||
exports testpkgmdlC to moduleA;
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 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 testpkgmdlC;
|
||||
|
||||
public class TestClassInModuleC {
|
||||
public void testMethodClassModuleC() { }
|
||||
}
|
||||
@ -39,7 +39,7 @@
|
||||
*/
|
||||
@Deprecated
|
||||
module moduletags {
|
||||
requires moduleB;
|
||||
requires transitive static moduleA;
|
||||
|
||||
exports testpkgmdltags;
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4494033 7028815 7052425 8007338 8023608 8008164 8016549 8072461 8154261 8162363
|
||||
* @bug 4494033 7028815 7052425 8007338 8023608 8008164 8016549 8072461 8154261 8162363 8160196
|
||||
* @summary Run tests on doclet stylesheet.
|
||||
* @author jamieh
|
||||
* @library ../lib
|
||||
@ -111,7 +111,7 @@ public class TestStylesheet extends JavadocTester {
|
||||
+ " border: none;\n"
|
||||
+ " height:16px;\n"
|
||||
+ "}",
|
||||
".memberSummary caption span.activeTableTab span {\n"
|
||||
".memberSummary caption span.activeTableTab span, .packagesSummary caption span.activeTableTab span {\n"
|
||||
+ " white-space:nowrap;\n"
|
||||
+ " padding-top:5px;\n"
|
||||
+ " padding-left:12px;\n"
|
||||
@ -122,7 +122,7 @@ public class TestStylesheet extends JavadocTester {
|
||||
+ " background-color:#F8981D;\n"
|
||||
+ " height:16px;\n"
|
||||
+ "}",
|
||||
".memberSummary caption span.tableTab span {\n"
|
||||
".memberSummary caption span.tableTab span, .packagesSummary caption span.tableTab span {\n"
|
||||
+ " white-space:nowrap;\n"
|
||||
+ " padding-top:5px;\n"
|
||||
+ " padding-left:12px;\n"
|
||||
@ -138,11 +138,10 @@ public class TestStylesheet extends JavadocTester {
|
||||
+ ".requiresSummary td.colFirst, .requiresSummary th.colFirst,\n"
|
||||
+ ".packagesSummary td.colFirst, .packagesSummary td.colSecond, .packagesSummary th.colFirst, .packagesSummary th,\n"
|
||||
+ ".usesSummary td.colFirst, .usesSummary th.colFirst,\n"
|
||||
+ ".useSummary td.colFirst, .useSummary th.colFirst,\n"
|
||||
+ ".providesSummary td.colFirst, .providesSummary th.colFirst,\n"
|
||||
+ ".memberSummary td.colFirst, .memberSummary th.colFirst,\n"
|
||||
+ ".memberSummary td.colSecond, .memberSummary th.colSecond,\n"
|
||||
+ ".typeSummary td.colFirst{\n"
|
||||
+ " width:25%;\n"
|
||||
+ " vertical-align:top;\n"
|
||||
+ "}",
|
||||
".overviewSummary td, .memberSummary td, .typeSummary td,\n"
|
||||
@ -151,7 +150,8 @@ public class TestStylesheet extends JavadocTester {
|
||||
+ " text-align:left;\n"
|
||||
+ " padding:0px 0px 12px 10px;\n"
|
||||
+ "}",
|
||||
".memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab {\n"
|
||||
".memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab,\n"
|
||||
+ ".packagesSummary caption span.tableTab, .packagesSummary caption span.activeTableTab {\n"
|
||||
+ " padding-top:0px;\n"
|
||||
+ " padding-left:0px;\n"
|
||||
+ " padding-right:0px;\n"
|
||||
|
||||
29
langtools/test/tools/doclint/ProvidesTest.java
Normal file
29
langtools/test/tools/doclint/ProvidesTest.java
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8160196
|
||||
* @summary Module summary page should display information based on "api" or "detail" mode.
|
||||
* @modules jdk.compiler/com.sun.tools.doclint
|
||||
* @build DocLintTester
|
||||
* @run main DocLintTester -ref ProvidesTest.out ProvidesTest.java
|
||||
*/
|
||||
|
||||
/**
|
||||
* Invalid use of provides in class documentation.
|
||||
*
|
||||
* @provides UsesTest
|
||||
*/
|
||||
public class ProvidesTest {
|
||||
/**
|
||||
* Invalid use of provides in field documentation
|
||||
*
|
||||
* @provides UsesTest Test description.
|
||||
*/
|
||||
public int invalid_param;
|
||||
|
||||
/**
|
||||
* Invalid use of provides in method documentation
|
||||
*
|
||||
* @provides UsesTest Test description.
|
||||
*/
|
||||
public class InvalidParam { }
|
||||
}
|
||||
28
langtools/test/tools/doclint/ProvidesTest.out
Normal file
28
langtools/test/tools/doclint/ProvidesTest.out
Normal file
@ -0,0 +1,28 @@
|
||||
ProvidesTest.java:13: error: invalid use of @provides
|
||||
* @provides UsesTest
|
||||
^
|
||||
ProvidesTest.java:13: error: service-type not found
|
||||
* @provides UsesTest
|
||||
^
|
||||
ProvidesTest.java:13: error: reference not found
|
||||
* @provides UsesTest
|
||||
^
|
||||
ProvidesTest.java:19: error: invalid use of @provides
|
||||
* @provides UsesTest Test description.
|
||||
^
|
||||
ProvidesTest.java:19: error: service-type not found
|
||||
* @provides UsesTest Test description.
|
||||
^
|
||||
ProvidesTest.java:19: error: reference not found
|
||||
* @provides UsesTest Test description.
|
||||
^
|
||||
ProvidesTest.java:26: error: invalid use of @provides
|
||||
* @provides UsesTest Test description.
|
||||
^
|
||||
ProvidesTest.java:26: error: service-type not found
|
||||
* @provides UsesTest Test description.
|
||||
^
|
||||
ProvidesTest.java:26: error: reference not found
|
||||
* @provides UsesTest Test description.
|
||||
^
|
||||
9 errors
|
||||
29
langtools/test/tools/doclint/UsesTest.java
Normal file
29
langtools/test/tools/doclint/UsesTest.java
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8160196
|
||||
* @summary Module summary page should display information based on "api" or "detail" mode.
|
||||
* @modules jdk.compiler/com.sun.tools.doclint
|
||||
* @build DocLintTester
|
||||
* @run main DocLintTester -ref UsesTest.out UsesTest.java
|
||||
*/
|
||||
|
||||
/**
|
||||
* Invalid use of uses in class documentation.
|
||||
*
|
||||
* @uses ProvidesTest
|
||||
*/
|
||||
public class UsesTest {
|
||||
/**
|
||||
* Invalid use of uses in field documentation
|
||||
*
|
||||
* @uses ProvidesTest Test description.
|
||||
*/
|
||||
public int invalid_param;
|
||||
|
||||
/**
|
||||
* Invalid use of uses in method documentation
|
||||
*
|
||||
* @uses ProvidesTest Test description.
|
||||
*/
|
||||
public class InvalidParam { }
|
||||
}
|
||||
28
langtools/test/tools/doclint/UsesTest.out
Normal file
28
langtools/test/tools/doclint/UsesTest.out
Normal file
@ -0,0 +1,28 @@
|
||||
UsesTest.java:13: error: invalid use of @uses
|
||||
* @uses ProvidesTest
|
||||
^
|
||||
UsesTest.java:13: error: service-type not found
|
||||
* @uses ProvidesTest
|
||||
^
|
||||
UsesTest.java:13: error: reference not found
|
||||
* @uses ProvidesTest
|
||||
^
|
||||
UsesTest.java:19: error: invalid use of @uses
|
||||
* @uses ProvidesTest Test description.
|
||||
^
|
||||
UsesTest.java:19: error: service-type not found
|
||||
* @uses ProvidesTest Test description.
|
||||
^
|
||||
UsesTest.java:19: error: reference not found
|
||||
* @uses ProvidesTest Test description.
|
||||
^
|
||||
UsesTest.java:26: error: invalid use of @uses
|
||||
* @uses ProvidesTest Test description.
|
||||
^
|
||||
UsesTest.java:26: error: service-type not found
|
||||
* @uses ProvidesTest Test description.
|
||||
^
|
||||
UsesTest.java:26: error: reference not found
|
||||
* @uses ProvidesTest Test description.
|
||||
^
|
||||
9 errors
|
||||
@ -498,6 +498,17 @@ public class DocCommentTester {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Void visitProvides(ProvidesTree node, Void p) {
|
||||
header(node);
|
||||
indent(+1);
|
||||
print("serviceName", node.getServiceType());
|
||||
print("description", node.getDescription());
|
||||
indent(-1);
|
||||
indent();
|
||||
out.println("]");
|
||||
return null;
|
||||
}
|
||||
|
||||
public Void visitReference(ReferenceTree node, Void p) {
|
||||
header(node, compress(node.getSignature()));
|
||||
return null;
|
||||
@ -617,6 +628,17 @@ public class DocCommentTester {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Void visitUses(UsesTree node, Void p) {
|
||||
header(node);
|
||||
indent(+1);
|
||||
print("serviceName", node.getServiceType());
|
||||
print("description", node.getDescription());
|
||||
indent(-1);
|
||||
indent();
|
||||
out.println("]");
|
||||
return null;
|
||||
}
|
||||
|
||||
public Void visitValue(ValueTree node, Void p) {
|
||||
header(node);
|
||||
indent(+1);
|
||||
|
||||
75
langtools/test/tools/javac/doctree/ProvidesTest.java
Normal file
75
langtools/test/tools/javac/doctree/ProvidesTest.java
Normal file
@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Copyright (c) 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.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8160196
|
||||
* @summary Module summary page should display information based on "api" or "detail" mode.
|
||||
* @modules jdk.compiler/com.sun.tools.javac.api
|
||||
* jdk.compiler/com.sun.tools.javac.file
|
||||
* jdk.compiler/com.sun.tools.javac.tree
|
||||
* jdk.compiler/com.sun.tools.javac.util
|
||||
* @build DocCommentTester
|
||||
* @run main DocCommentTester ProvidesTest.java
|
||||
*/
|
||||
|
||||
class ProvidesTest {
|
||||
/**
|
||||
* abc.
|
||||
* @provides UsesTest
|
||||
*/
|
||||
void simple_provides() { }
|
||||
/*
|
||||
DocComment[DOC_COMMENT, pos:1
|
||||
firstSentence: 1
|
||||
Text[TEXT, pos:1, abc.]
|
||||
body: empty
|
||||
block tags: 1
|
||||
Provides[PROVIDES, pos:7
|
||||
serviceName:
|
||||
Reference[REFERENCE, pos:17, UsesTest]
|
||||
description: empty
|
||||
]
|
||||
]
|
||||
*/
|
||||
|
||||
/**
|
||||
* abc.
|
||||
* @provides UsesTest Test description for provides.
|
||||
*/
|
||||
void provides_with_description() { }
|
||||
/*
|
||||
DocComment[DOC_COMMENT, pos:1
|
||||
firstSentence: 1
|
||||
Text[TEXT, pos:1, abc.]
|
||||
body: empty
|
||||
block tags: 1
|
||||
Provides[PROVIDES, pos:7
|
||||
serviceName:
|
||||
Reference[REFERENCE, pos:17, UsesTest]
|
||||
description: 1
|
||||
Text[TEXT, pos:26, Test_description_for_provides.]
|
||||
]
|
||||
]
|
||||
*/
|
||||
}
|
||||
75
langtools/test/tools/javac/doctree/UsesTest.java
Normal file
75
langtools/test/tools/javac/doctree/UsesTest.java
Normal file
@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Copyright (c) 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.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8160196
|
||||
* @summary Module summary page should display information based on "api" or "detail" mode.
|
||||
* @modules jdk.compiler/com.sun.tools.javac.api
|
||||
* jdk.compiler/com.sun.tools.javac.file
|
||||
* jdk.compiler/com.sun.tools.javac.tree
|
||||
* jdk.compiler/com.sun.tools.javac.util
|
||||
* @build DocCommentTester
|
||||
* @run main DocCommentTester UsesTest.java
|
||||
*/
|
||||
|
||||
class UsesTest {
|
||||
/**
|
||||
* abc.
|
||||
* @uses ProvidesTest
|
||||
*/
|
||||
void simple_uses() { }
|
||||
/*
|
||||
DocComment[DOC_COMMENT, pos:1
|
||||
firstSentence: 1
|
||||
Text[TEXT, pos:1, abc.]
|
||||
body: empty
|
||||
block tags: 1
|
||||
Uses[USES, pos:7
|
||||
serviceName:
|
||||
Reference[REFERENCE, pos:13, ProvidesTest]
|
||||
description: empty
|
||||
]
|
||||
]
|
||||
*/
|
||||
|
||||
/**
|
||||
* abc.
|
||||
* @uses ProvidesTest Test description for uses.
|
||||
*/
|
||||
void uses_with_description() { }
|
||||
/*
|
||||
DocComment[DOC_COMMENT, pos:1
|
||||
firstSentence: 1
|
||||
Text[TEXT, pos:1, abc.]
|
||||
body: empty
|
||||
block tags: 1
|
||||
Uses[USES, pos:7
|
||||
serviceName:
|
||||
Reference[REFERENCE, pos:13, ProvidesTest]
|
||||
description: 1
|
||||
Text[TEXT, pos:26, Test_description_for_uses.]
|
||||
]
|
||||
]
|
||||
*/
|
||||
}
|
||||
@ -1085,6 +1085,13 @@ public class DPrinter {
|
||||
return visitBlockTag(node, null);
|
||||
}
|
||||
|
||||
public Void visitProvides(ProvidesTree node, Void p) {
|
||||
printString("kind", node.getKind().name());
|
||||
printDocTree("serviceType", node.getServiceType());
|
||||
printList("description", node.getDescription());
|
||||
return visitBlockTag(node, null);
|
||||
}
|
||||
|
||||
public Void visitReference(ReferenceTree node, Void p) {
|
||||
printString("signature", node.getSignature());
|
||||
return visitTree(node, null);
|
||||
@ -1152,6 +1159,13 @@ public class DPrinter {
|
||||
return visitInlineTag(node, null);
|
||||
}
|
||||
|
||||
public Void visitUses(UsesTree node, Void p) {
|
||||
printString("kind", node.getKind().name());
|
||||
printDocTree("serviceType", node.getServiceType());
|
||||
printList("description", node.getDescription());
|
||||
return visitBlockTag(node, null);
|
||||
}
|
||||
|
||||
public Void visitValue(ValueTree node, Void p) {
|
||||
printDocTree("value", node.getReference());
|
||||
return visitInlineTag(node, null);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user