< prev index next >
src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ElementsTable.java
Print this page
rev 58565 : records: mark record related model API as preview
@@ -45,11 +45,11 @@
import javax.lang.model.element.ModuleElement.ExportsDirective;
import javax.lang.model.element.ModuleElement.RequiresDirective;
import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.util.ElementFilter;
-import javax.lang.model.util.SimpleElementVisitor9;
+import javax.lang.model.util.SimpleElementVisitor14;
import javax.tools.JavaFileManager;
import javax.tools.JavaFileManager.Location;
import javax.tools.JavaFileObject;
import javax.tools.StandardLocation;
@@ -983,27 +983,29 @@
private boolean isTypeElementSelected(TypeElement te) {
return (xclasses || toolEnv.getFileKind(te) == SOURCE) && isSelected(te);
}
- SimpleElementVisitor9<Boolean, Void> visibleElementVisitor = null;
+ @SuppressWarnings("preview")
+ SimpleElementVisitor14<Boolean, Void> visibleElementVisitor = null;
/**
* Returns true if the element is selected, by applying
* the access filter checks. Special treatment is applied to
* types, for a top level type the access filter applies completely,
* however if is a nested type then it is allowed either if
* the enclosing is a static or the enclosing is also selected.
*
* @param e the element to be checked
* @return true if the element is visible
*/
+ @SuppressWarnings("preview")
public boolean isSelected(Element e) {
if (toolEnv.isSynthetic((Symbol) e)) {
return false;
}
if (visibleElementVisitor == null) {
- visibleElementVisitor = new SimpleElementVisitor9<Boolean, Void>() {
+ visibleElementVisitor = new SimpleElementVisitor14<Boolean, Void>() {
@Override
public Boolean visitType(TypeElement e, Void p) {
if (!accessFilter.checkModifier(e)) {
return false; // it is not allowed
}
@@ -1033,11 +1035,12 @@
};
}
return visibleElementVisitor.visit(e);
}
- private class IncludedVisitor extends SimpleElementVisitor9<Boolean, Void> {
+ @SuppressWarnings("preview")
+ private class IncludedVisitor extends SimpleElementVisitor14<Boolean, Void> {
final private Set<Element> includedCache;
public IncludedVisitor() {
includedCache = new LinkedHashSet<>();
}
@@ -1198,11 +1201,11 @@
static final EnumSet<ElementKind> ALLOWED_KINDS = EnumSet.of(ElementKind.METHOD,
ElementKind.CLASS,
ElementKind.PACKAGE,
ElementKind.MODULE);
- // all possible accesss levels allowed for each element
+ // all possible access levels allowed for each element
private final EnumMap<ElementKind, EnumSet<AccessKind>> filterMap =
new EnumMap<>(ElementKind.class);
// the specified access level for each element
private final EnumMap<ElementKind, AccessKind> accessMap =
@@ -1283,11 +1286,11 @@
// convert a requested element kind to an allowed access kind
private ElementKind getAllowedKind(ElementKind kind) {
switch (kind) {
case CLASS: case METHOD: case MODULE: case PACKAGE:
return kind;
- case ANNOTATION_TYPE: case ENUM: case INTERFACE:
+ case RECORD: case ANNOTATION_TYPE: case ENUM: case INTERFACE:
return ElementKind.CLASS;
case CONSTRUCTOR: case ENUM_CONSTANT: case EXCEPTION_PARAMETER:
case FIELD: case INSTANCE_INIT: case LOCAL_VARIABLE: case PARAMETER:
case RESOURCE_VARIABLE: case STATIC_INIT: case TYPE_PARAMETER:
return ElementKind.METHOD;
< prev index next >