Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2019-03-08 18:37:46 -0500
committerVikas Chandra2019-03-25 00:41:05 -0400
commit7dd8745650d01bdb6132484e7cee2c76fc35bea8 (patch)
tree2ae45580286fafd2c7c2c490d0c5a69c4d0a9af4
parent24d47c292ed4bd8fdc28b3c2f9afdab1401d025c (diff)
downloadeclipse.jdt.core-I20190325-0105.tar.gz
eclipse.jdt.core-I20190325-0105.tar.xz
eclipse.jdt.core-I20190325-0105.zip
Bug 544362 - Add support for Java 9/10/11 Javadoc tagsI20190325-0105
- add new @hidden, @index, and @summary tag support to JavadocTagConstants, setting all for JDK 9 except for @summary which is JDK 10 - in IModuleDescription add new methods to get the provides and uses service names and implement these new methods in DocCommentParser and AbstractModule - in JavadocParser, add support @hidden, @index, and @summary - add support for the new tags in TagElement - modify JavadocCompletionParserTest Change-Id: Icd266865ff6fd3fdd1056d567c0e91de613eb300 Signed-off-by: Jeff Johnston <jjohnstn@redhat.com>
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/JavadocCompletionParserTest.java132
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java18
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java54
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TagElement.java32
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IModuleDescription.java20
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/AbstractModule.java23
6 files changed, 248 insertions, 31 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/JavadocCompletionParserTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/JavadocCompletionParserTest.java
index 42fd9349dd..ba60e7de32 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/JavadocCompletionParserTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/JavadocCompletionParserTest.java
@@ -173,7 +173,7 @@ protected void verifyAllTagsCompletion() {
// Block tags
TAG_AUTHOR, TAG_DEPRECATED, TAG_EXCEPTION, TAG_PARAM, TAG_RETURN, TAG_SEE, TAG_VERSION, TAG_CATEGORY,
TAG_SINCE,
- TAG_SERIAL, TAG_SERIAL_DATA, TAG_SERIAL_FIELD , TAG_THROWS, TAG_USES, TAG_PROVIDES,
+ TAG_SERIAL, TAG_SERIAL_DATA, TAG_SERIAL_FIELD , TAG_THROWS, TAG_HIDDEN, TAG_USES, TAG_PROVIDES,
// Inline tags
TAG_LINK,
TAG_DOC_ROOT
@@ -183,15 +183,27 @@ protected void verifyAllTagsCompletion() {
additionalTags = new char[][] {
TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE
};
- } else if(this.complianceLevel > ClassFileConstants.JDK1_4 && this.complianceLevel < ClassFileConstants.JDK12) {
+ } else if(this.complianceLevel > ClassFileConstants.JDK1_4
+ && this.complianceLevel < ClassFileConstants.JDK9) {
additionalTags = new char[][] {
TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE,
TAG_CODE, TAG_LITERAL
};
+ } else if (this.complianceLevel == ClassFileConstants.JDK9) {
+ additionalTags = new char[][] {
+ TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE,
+ TAG_CODE, TAG_LITERAL, TAG_INDEX
+ };
+ } else if (this.complianceLevel > ClassFileConstants.JDK9
+ && this.complianceLevel < ClassFileConstants.JDK12) {
+ additionalTags = new char[][] {
+ TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE,
+ TAG_CODE, TAG_LITERAL, TAG_INDEX, TAG_SUMMARY
+ };
} else if(this.complianceLevel >= ClassFileConstants.JDK12) {
additionalTags = new char[][] {
TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE,
- TAG_CODE, TAG_LITERAL, TAG_SYSTEM_PROPERTY
+ TAG_CODE, TAG_LITERAL, TAG_INDEX, TAG_SUMMARY, TAG_SYSTEM_PROPERTY
};
}
allTagsFinal = this.complianceLevel > ClassFileConstants.JDK1_8 ? allTagsJava9Plus : allTags;
@@ -284,15 +296,29 @@ public void test006() {
additionalTags = new char[][] {
TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE
};
- } else if(this.complianceLevel > ClassFileConstants.JDK1_4 && this.complianceLevel < ClassFileConstants.JDK12) {
+ } else if (this.complianceLevel > ClassFileConstants.JDK1_4
+ && this.complianceLevel < ClassFileConstants.JDK9) {
additionalTags = new char[][] {
TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE,
TAG_CODE, TAG_LITERAL
};
+ } else if (this.complianceLevel == ClassFileConstants.JDK9) {
+ additionalTags = new char[][] {
+ TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE,
+ TAG_CODE, TAG_LITERAL,
+ TAG_INDEX
+ };
+ } else if (this.complianceLevel >= ClassFileConstants.JDK10
+ && this.complianceLevel < ClassFileConstants.JDK12) {
+ additionalTags = new char[][] {
+ TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE,
+ TAG_CODE, TAG_LITERAL,
+ TAG_INDEX, TAG_SUMMARY
+ };
} else if(this.complianceLevel >= ClassFileConstants.JDK12) {
additionalTags = new char[][] {
TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE,
- TAG_CODE, TAG_LITERAL, TAG_SYSTEM_PROPERTY
+ TAG_CODE, TAG_LITERAL, TAG_INDEX, TAG_SUMMARY, TAG_SYSTEM_PROPERTY
};
}
if (additionalTags != null) {
@@ -432,9 +458,20 @@ public void test020() {
" */\n" +
"public class Test {}\n";
verifyCompletionInJavadoc(source, "@s");
- char[][] expectedTags = {TAG_SEE, TAG_SINCE, TAG_SERIAL, TAG_SERIAL_DATA, TAG_SERIAL_FIELD};
- char[][] expectedTags12Plus = {TAG_SEE, TAG_SINCE, TAG_SERIAL, TAG_SERIAL_DATA, TAG_SERIAL_FIELD,TAG_SYSTEM_PROPERTY};
- verifyCompletionOnJavadocTag("s".toCharArray(),this.complianceLevel >= ClassFileConstants.JDK12 ? expectedTags12Plus : expectedTags, false);
+ char[][] expectedTags = new char[][] {
+ TAG_SEE, TAG_SINCE, TAG_SERIAL, TAG_SERIAL_DATA, TAG_SERIAL_FIELD
+ };
+ if (this.complianceLevel > ClassFileConstants.JDK9
+ && this.complianceLevel < ClassFileConstants.JDK12) {
+ expectedTags = new char[][] {
+ TAG_SEE, TAG_SINCE, TAG_SERIAL, TAG_SERIAL_DATA, TAG_SERIAL_FIELD, TAG_SUMMARY
+ };
+ } else if (this.complianceLevel >= ClassFileConstants.JDK12) {
+ expectedTags = new char[][] {
+ TAG_SEE, TAG_SINCE, TAG_SERIAL, TAG_SERIAL_DATA, TAG_SERIAL_FIELD, TAG_SUMMARY, TAG_SYSTEM_PROPERTY
+ };
+ }
+ verifyCompletionOnJavadocTag("s".toCharArray(), expectedTags, false);
CompletionOnJavadocTag completionTag = (CompletionOnJavadocTag) this.javadoc.getCompletionNode();
assertEquals("Invalid tag start position", 24, completionTag.tagSourceStart);
assertEquals("Invalid tag end position", 28, completionTag.tagSourceEnd+1);
@@ -512,15 +549,30 @@ public void test025() {
additionalTags = new char[][] {
TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE
};
- }else if (this.complianceLevel > ClassFileConstants.JDK1_4 && this.complianceLevel < ClassFileConstants.JDK12) {
+ } else if (this.complianceLevel > ClassFileConstants.JDK1_4
+ && this.complianceLevel < ClassFileConstants.JDK9) {
additionalTags = new char[][] {
TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE,
TAG_CODE, TAG_LITERAL
};
- }else if (this.complianceLevel >= ClassFileConstants.JDK12) {
+ } else if (this.complianceLevel == ClassFileConstants.JDK9) {
+ additionalTags = new char[][] {
+ TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE,
+ TAG_CODE, TAG_LITERAL,
+ TAG_INDEX
+ };
+ } else if (this.complianceLevel > ClassFileConstants.JDK9
+ && this.complianceLevel < ClassFileConstants.JDK12) {
additionalTags = new char[][] {
TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE,
- TAG_CODE, TAG_LITERAL, TAG_SYSTEM_PROPERTY
+ TAG_CODE, TAG_LITERAL,
+ TAG_INDEX, TAG_SUMMARY
+ };
+ } else if (this.complianceLevel >= ClassFileConstants.JDK12) {
+ additionalTags = new char[][] {
+ TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE,
+ TAG_CODE, TAG_LITERAL,
+ TAG_INDEX, TAG_SUMMARY, TAG_SYSTEM_PROPERTY
};
}
if (additionalTags != null) {
@@ -590,19 +642,32 @@ public void test028() {
additionalTags = new char[][] {
TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE
};
- }
- else if(this.complianceLevel > ClassFileConstants.JDK1_4 && this.complianceLevel < ClassFileConstants.JDK12) {
+ } else if (this.complianceLevel > ClassFileConstants.JDK1_4
+ && this.complianceLevel < ClassFileConstants.JDK9) {
additionalTags = new char[][] {
TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE,
TAG_CODE, TAG_LITERAL
};
+ } else if (this.complianceLevel == ClassFileConstants.JDK9) {
+ additionalTags = new char[][] {
+ TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE,
+ TAG_CODE, TAG_LITERAL,
+ TAG_INDEX
+ };
+ } else if (this.complianceLevel > ClassFileConstants.JDK9
+ && this.complianceLevel < ClassFileConstants.JDK12) {
+ additionalTags = new char[][] {
+ TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE,
+ TAG_CODE, TAG_LITERAL,
+ TAG_INDEX, TAG_SUMMARY
+ };
} else if(this.complianceLevel >= ClassFileConstants.JDK12) {
additionalTags = new char[][] {
TAG_INHERITDOC, TAG_LINKPLAIN, TAG_VALUE,
- TAG_CODE, TAG_LITERAL, TAG_SYSTEM_PROPERTY
+ TAG_CODE, TAG_LITERAL,
+ TAG_INDEX, TAG_SUMMARY, TAG_SYSTEM_PROPERTY
};
}
-
if (additionalTags != null) {
int length = allTags.length;
int add = additionalTags.length;
@@ -654,4 +719,41 @@ public void test030() {
int end = source.indexOf('+');
assertEquals("Invalid tag end position", end, completionTag.tagSourceEnd);
}
+
+public void test031() {
+ String source = "package javadoc;\n" +
+ "/**\n" +
+ " * @u+\n" +
+ " */\n" +
+ "module newproj {}\n";
+ verifyCompletionInJavadoc(source, "@u");
+ char[][] allTags = this.complianceLevel < ClassFileConstants.JDK9
+ ? null
+ : new char[][] { TAG_USES };
+ verifyCompletionOnJavadocTag("u".toCharArray(), allTags, false);
+ CompletionOnJavadocTag completionTag = (CompletionOnJavadocTag) this.javadoc.getCompletionNode();
+ int start = source.indexOf("@u");
+ assertEquals("Invalid tag start position", start, completionTag.tagSourceStart);
+ int end = source.indexOf('+');
+ assertEquals("Invalid tag end position", end, completionTag.tagSourceEnd);
+}
+
+public void test032() {
+ String source = "package javadoc;\n" +
+ "/**\n" +
+ " * @p+\n" +
+ " */\n" +
+ "module newproj {}\n";
+ verifyCompletionInJavadoc(source, "@p");
+ char[][] allTags = this.complianceLevel < ClassFileConstants.JDK9
+ ? new char[][] { TAG_PARAM }
+ : new char[][] { TAG_PARAM, TAG_PROVIDES };
+ verifyCompletionOnJavadocTag("p".toCharArray(), allTags, false);
+ CompletionOnJavadocTag completionTag = (CompletionOnJavadocTag) this.javadoc.getCompletionNode();
+ int start = source.indexOf("@p");
+ assertEquals("Invalid tag start position", start, completionTag.tagSourceStart);
+ int end = source.indexOf('+');
+ assertEquals("Invalid tag end position", end, completionTag.tagSourceEnd);
+}
+
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java
index fd1225603f..cba26f476e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java
@@ -557,8 +557,18 @@ public class JavadocParser extends AbstractCommentParser {
}
}
break;
+ case 'h':
+ if (length == TAG_HIDDEN_LENGTH && CharOperation.equals(TAG_HIDDEN, tagName, 0, length)) {
+ valid = true;
+ this.tagValue = TAG_HIDDEN_VALUE;
+ }
+ break;
case 'i':
- if (length == TAG_INHERITDOC_LENGTH && CharOperation.equals(TAG_INHERITDOC, tagName, 0, length)) {
+ if (length == TAG_INDEX_LENGTH && CharOperation.equals(TAG_INDEX, tagName, 0, length)) {
+ valid = true;
+ this.tagValue = TAG_INDEX_VALUE;
+ this.tagWaitingForDescription = this.tagValue;
+ } else if (length == TAG_INHERITDOC_LENGTH && CharOperation.equals(TAG_INHERITDOC, tagName, 0, length)) {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=247037, @inheritDoc usage is illegal
// outside of few block tags and the main description.
switch (this.lastBlockTagValue) {
@@ -608,8 +618,7 @@ public class JavadocParser extends AbstractCommentParser {
if (!this.inlineTagStarted) {
valid = parseParam();
}
- }
- if (length == TAG_PROVIDES_LENGTH && CharOperation.equals(TAG_PROVIDES, tagName, 0, length)) {
+ } else if (length == TAG_PROVIDES_LENGTH && CharOperation.equals(TAG_PROVIDES, tagName, 0, length)) {
this.tagValue = TAG_PROVIDES_VALUE;
this.tagWaitingForDescription = this.tagValue;
}
@@ -643,6 +652,9 @@ public class JavadocParser extends AbstractCommentParser {
} else if (length == TAG_SYSTEM_PROPERTY_LENGTH && CharOperation.equals(TAG_SYSTEM_PROPERTY, tagName, 0, length)) {
this.tagValue = TAG_SYSTEM_PROPERTY_VALUE;
this.tagWaitingForDescription = this.tagValue;
+ } else if (length == TAG_SUMMARY_LENGTH && CharOperation.equals(TAG_SUMMARY, tagName, 0, length)) {
+ this.tagValue = TAG_SUMMARY_VALUE;
+ this.tagWaitingForDescription = this.tagValue;
}
break;
case 't':
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java
index ffcb743db2..6382f2f68d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java
@@ -47,6 +47,9 @@ public interface JavadocTagConstants {
public static final char[] TAG_SYSTEM_PROPERTY = "systemProperty".toCharArray(); //$NON-NLS-1$
public static final char[] TAG_USES = "uses".toCharArray(); //$NON-NLS-1$
public static final char[] TAG_PROVIDES = "provides".toCharArray(); //$NON-NLS-1$
+ public static final char[] TAG_HIDDEN = "hidden".toCharArray(); //$NON-NLS-1$
+ public static final char[] TAG_INDEX = "index".toCharArray(); //$NON-NLS-1$
+ public static final char[] TAG_SUMMARY = "summary".toCharArray(); //$NON-NLS-1$
// tags lengthes
public static final int TAG_DEPRECATED_LENGTH = TAG_DEPRECATED.length;
@@ -72,6 +75,9 @@ public interface JavadocTagConstants {
public static final int TAG_SYSTEM_PROPERTY_LENGTH = TAG_SYSTEM_PROPERTY.length;
public static final int TAG_USES_LENGTH = TAG_USES.length;
public static final int TAG_PROVIDES_LENGTH = TAG_PROVIDES.length;
+ public static final int TAG_HIDDEN_LENGTH = TAG_HIDDEN.length;
+ public static final int TAG_INDEX_LENGTH = TAG_INDEX.length;
+ public static final int TAG_SUMMARY_LENGTH = TAG_SUMMARY.length;
// tags value
public static final int NO_TAG_VALUE = 0;
@@ -98,6 +104,9 @@ public interface JavadocTagConstants {
public static final int TAG_SYSTEM_PROPERTY_VALUE=21;
public static final int TAG_USES_VALUE=21;
public static final int TAG_PROVIDES_VALUE=22;
+ public static final int TAG_HIDDEN_VALUE = 23;
+ public static final int TAG_INDEX_VALUE = 24;
+ public static final int TAG_SUMMARY_VALUE = 25;
public static final int TAG_OTHERS_VALUE = 100;
// Tag names array
public static final char[][] TAG_NAMES = {
@@ -122,7 +131,12 @@ public interface JavadocTagConstants {
TAG_CODE, /* 18 */
TAG_LITERAL, /* 19 */
TAG_DOC_ROOT, /* 20 */
- TAG_SYSTEM_PROPERTY /* 21 */
+ TAG_SYSTEM_PROPERTY, /* 21 */
+ TAG_USES, /* 22 */
+ TAG_PROVIDES, /* 23 */
+ TAG_HIDDEN, /* 24 */
+ TAG_INDEX, /* 25 */
+ TAG_SUMMARY, /* 26 */
};
// tags expected positions
@@ -162,7 +176,7 @@ public interface JavadocTagConstants {
// since 1.8
{},
// since 9
- {TAG_USES, TAG_PROVIDES},
+ { TAG_HIDDEN, TAG_USES, TAG_PROVIDES },
// since 10
{},
// since 11
@@ -190,9 +204,9 @@ public interface JavadocTagConstants {
// since 1.8
{},
// since 9
- {},
+ { TAG_INDEX },
// since 10
- {},
+ { TAG_SUMMARY },
// since 11
{},
//since 12
@@ -227,7 +241,12 @@ public interface JavadocTagConstants {
TAG_TYPE_INLINE, // TAG_CODE_VALUE = 18;
TAG_TYPE_INLINE, // TAG_LITERAL_VALUE = 19;
TAG_TYPE_INLINE, // TAG_DOC_ROOT_VALUE = 20;
- TAG_TYPE_INLINE // TAG_DOC_ROOT_VALUE = 21
+ TAG_TYPE_INLINE, // TAG_DOC_ROOT_VALUE = 21
+ TAG_TYPE_BLOCK, // TAG_HIDDEN_VALUE = 22;
+ TAG_TYPE_BLOCK, // TAG_PROVIDES_VALUE = 23;
+ TAG_TYPE_BLOCK, // TAG_USES_VALUE = 24;
+ TAG_TYPE_INLINE, // TAG_INDEX_VALUE = 25;
+ TAG_TYPE_INLINE, // TAG_SUMMARY_VALUE = 26;
};
/*
* Tags usage
@@ -243,7 +262,10 @@ public interface JavadocTagConstants {
TAG_LINKPLAIN,
TAG_DOC_ROOT,
TAG_VALUE,
- TAG_SYSTEM_PROPERTY
+ TAG_SYSTEM_PROPERTY,
+ TAG_HIDDEN,
+ TAG_INDEX,
+ TAG_SUMMARY,
};
public static final char[][] COMPILATION_UNIT_TAGS = {};
public static final char[][] CLASS_TAGS = {
@@ -261,7 +283,10 @@ public interface JavadocTagConstants {
TAG_VALUE,
TAG_CODE,
TAG_LITERAL,
- TAG_SYSTEM_PROPERTY
+ TAG_SYSTEM_PROPERTY,
+ TAG_HIDDEN,
+ TAG_INDEX,
+ TAG_SUMMARY,
};
public static final char[][] FIELD_TAGS = {
TAG_SEE,
@@ -276,7 +301,10 @@ public interface JavadocTagConstants {
TAG_VALUE,
TAG_CODE,
TAG_LITERAL,
- TAG_SYSTEM_PROPERTY
+ TAG_SYSTEM_PROPERTY,
+ TAG_INDEX,
+ TAG_HIDDEN,
+ TAG_SUMMARY,
};
public static final char[][] METHOD_TAGS = {
TAG_SEE,
@@ -295,7 +323,10 @@ public interface JavadocTagConstants {
TAG_VALUE,
TAG_CODE,
TAG_LITERAL,
- TAG_SYSTEM_PROPERTY
+ TAG_SYSTEM_PROPERTY,
+ TAG_HIDDEN,
+ TAG_INDEX,
+ TAG_SUMMARY,
};
public static final char[][] MODULE_TAGS = {
TAG_SEE,
@@ -312,6 +343,9 @@ public interface JavadocTagConstants {
TAG_CODE,
TAG_LITERAL,
TAG_USES,
- TAG_PROVIDES
+ TAG_PROVIDES,
+ TAG_HIDDEN,
+ TAG_INDEX,
+ TAG_SUMMARY
};
}
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TagElement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TagElement.java
index fefb927774..71463bcf61 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TagElement.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TagElement.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2013 IBM Corporation and others.
+ * Copyright (c) 2004, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -112,8 +112,20 @@ public final class TagElement extends ASTNode implements IDocElement {
* Standard doc tag name (value {@value}).
*/
public static final String TAG_EXCEPTION = "@exception"; //$NON-NLS-1$
+
+ /**
+ * Standard doc tag name (value {@value}).
+ * @since 3.18
+ */
+ public static final String TAG_HIDDEN = "@hidden"; //$NON-NLS-1$
/**
+ * Standard doc tag name (value {@value}).
+ * @since 3.18
+ */
+ public static final String TAG_INDEX = "@index"; //$NON-NLS-1$
+
+ /**
* Standard inline doc tag name (value {@value}).
*/
public static final String TAG_INHERITDOC = "@inheritDoc"; //$NON-NLS-1$
@@ -144,6 +156,12 @@ public final class TagElement extends ASTNode implements IDocElement {
/**
* Standard doc tag name (value {@value}).
+ * @since 3.18
+ */
+ public static final String TAG_PROVIDES = "@provides"; //$NON-NLS-1$
+
+ /**
+ * Standard doc tag name (value {@value}).
*/
public static final String TAG_RETURN = "@return"; //$NON-NLS-1$
@@ -174,10 +192,22 @@ public final class TagElement extends ASTNode implements IDocElement {
/**
* Standard doc tag name (value {@value}).
+ * @since 3.18
+ */
+ public static final String TAG_SUMMARY = "@summary"; //$NON-NLS-1$
+
+ /**
+ * Standard doc tag name (value {@value}).
*/
public static final String TAG_THROWS = "@throws"; //$NON-NLS-1$
/**
+ * Standard doc tag name (value {@value}).
+ * @since 3.18
+ */
+ public static final String TAG_USES = "@uses"; //$NON-NLS-1$
+
+ /**
* Standard inline doc tag name (value {@value}).
*/
public static final String TAG_VALUE= "@value"; //$NON-NLS-1$
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IModuleDescription.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IModuleDescription.java
index 602b1d275c..ebda6d8ce8 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IModuleDescription.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IModuleDescription.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2017, 2018 IBM Corporation.
+ * Copyright (c) 2017, 2019 IBM Corporation.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -38,6 +38,24 @@ public interface IModuleDescription extends IMember, IAnnotatable {
String[] getRequiredModuleNames() throws JavaModelException;
/**
+ * Get provided service names for this module.
+ *
+ * @return a non-null array of provided service names
+ * @throws JavaModelException
+ * @since 3.18
+ */
+ String[] getProvidedServiceNames() throws JavaModelException;
+
+ /**
+ * Get used service names for this module.
+ *
+ * @return a non-null array of used service names
+ * @throws JavaModelException
+ * @since 3.18
+ */
+ String[] getUsedServiceNames() throws JavaModelException;
+
+ /**
*
* @return true if automatic module, else false
* @since 3.14
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/AbstractModule.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/AbstractModule.java
index 61316949c7..761778fc16 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/AbstractModule.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/AbstractModule.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2017, 2018 IBM Corporation and others.
+ * Copyright (c) 2017, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,6 +13,7 @@
*******************************************************************************/
package org.eclipse.jdt.internal.core;
+import java.util.ArrayList;
import java.util.Arrays;
import org.eclipse.jdt.core.IJavaElement;
@@ -88,9 +89,29 @@ public interface AbstractModule extends IModuleDescription {
default IService[] getProvidedServices() throws JavaModelException {
return getModuleInfo().provides();
}
+ @Override
+ default String[] getProvidedServiceNames() throws JavaModelException {
+ ArrayList<String> results = new ArrayList<>();
+ IService[] services = getProvidedServices();
+ for (IService service : services) {
+ results.add(new String(service.name()));
+ }
+ return results.toArray(new String[0]);
+
+ }
default char[][] getUsedServices() throws JavaModelException {
return getModuleInfo().uses();
}
+ @Override
+ default String[] getUsedServiceNames() throws JavaModelException {
+ ArrayList<String> results = new ArrayList<>();
+ char[][] services = getUsedServices();
+ for (int i = 0; i < services.length; ++i) {
+ char[] service = services[i];
+ results.add(new String(service));
+ }
+ return results.toArray(new String[0]);
+ }
default IPackageExport[] getOpenedPackages() throws JavaModelException {
return getModuleInfo().opens();
}

Back to the top