Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
JDK 17 jdk.jdeps.jmod - JDeps Tool
JDK 17 jdk.jdeps.jmod is the JMOD file for JDK 17 JDeps tool,
which can be invoked by the "jdeps" command.
JDK 17 JDeps tool compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\jdk.jdeps.jmod.
JDK 17 JDeps tool compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 JDeps tool source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\jdk.jdeps.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ com/sun/tools/jdeprscan/TraverseProc.java
/*
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package com.sun.tools.jdeprscan;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.Messager;
import javax.annotation.processing.ProcessingEnvironment;
import javax.annotation.processing.RoundEnvironment;
import javax.annotation.processing.SupportedAnnotationTypes;
import javax.annotation.processing.SupportedSourceVersion;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.Element;
import javax.lang.model.element.ElementKind;
import javax.lang.model.element.Modifier;
import javax.lang.model.element.ModuleElement;
import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.util.Elements;
import javax.tools.Diagnostic;
@SupportedAnnotationTypes("*")
public class TraverseProc extends AbstractProcessor {
Elements elements;
Messager messager;
final List<String> moduleRoots;
Map<PackageElement, List<TypeElement>> publicTypes;
TraverseProc(List<String> roots) {
moduleRoots = roots;
}
@Override
public void init(ProcessingEnvironment pe) {
super.init(pe);
elements = pe.getElementUtils();
messager = pe.getMessager();
}
@Override
public SourceVersion getSupportedSourceVersion() {
return SourceVersion.latest();
}
@Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
if (roundEnv.processingOver()) {
return false;
}
Set<ModuleElement> modules = new HashSet<>();
for (String mname : moduleRoots) {
ModuleElement me = elements.getModuleElement(mname);
if (me == null) {
messager.printMessage(Diagnostic.Kind.ERROR,
String.format("module %s not found%n", mname));
} else {
modules.addAll(findModules(me));
}
}
Set<PackageElement> packages = findPackages(modules);
publicTypes = findPublicTypes(packages);
return true;
}
void printPublicTypes() {
printPublicTypes(publicTypes);
}
public Map<PackageElement, List<TypeElement>> getPublicTypes() {
return publicTypes;
}
void printPublicTypes(Map<PackageElement, List<TypeElement>> types) {
System.out.println("All public types:");
types.entrySet().stream()
.sorted(Comparator.comparing(e -> e.getKey().toString()))
.forEach(e -> {
System.out.println(" " + e.getKey());
e.getValue().stream()
.sorted(Comparator.comparing(TypeElement::toString))
.forEach(t -> System.out.println(" " + t));
});
System.out.println();
System.out.flush();
}
Set<ModuleElement> findModules(ModuleElement root) {
return findModules0(root, new HashSet<>(), 0);
}
Set<ModuleElement> findModules0(ModuleElement m, Set<ModuleElement> set, int nesting) {
set.add(m);
for (ModuleElement.Directive dir : m.getDirectives()) {
if (dir.getKind() == ModuleElement.DirectiveKind.REQUIRES) {
ModuleElement.RequiresDirective req = (ModuleElement.RequiresDirective)dir;
findModules0(req.getDependency(), set, nesting + 1);
}
}
return set;
}
Set<PackageElement> findPackages(Collection<ModuleElement> mods) {
Set<PackageElement> set = new HashSet<>();
for (ModuleElement m : mods) {
for (ModuleElement.Directive dir : m.getDirectives()) {
if (dir.getKind() == ModuleElement.DirectiveKind.EXPORTS) { //XXX
ModuleElement.ExportsDirective exp = (ModuleElement.ExportsDirective)dir;
if (exp.getTargetModules() == null) {
set.add(exp.getPackage());
}
}
}
}
return set;
}
Map<PackageElement, List<TypeElement>> findPublicTypes(Collection<PackageElement> pkgs) {
Map<PackageElement, List<TypeElement>> map = new HashMap<>();
for (PackageElement pkg : pkgs) {
List<TypeElement> enclosed = new ArrayList<>();
for (Element e : pkg.getEnclosedElements()) {
addPublicTypes(enclosed, e);
}
map.put(pkg, enclosed);
}
return map;
}
void addPublicTypes(List<TypeElement> list, Element e) {
ElementKind kind = e.getKind();
if ((kind.isClass() || kind.isInterface())
&& e.getModifiers().contains(Modifier.PUBLIC)) {
list.add((TypeElement)e);
for (Element enc : e.getEnclosedElements()) {
addPublicTypes(list, enc);
}
}
}
}
⏎ com/sun/tools/jdeprscan/TraverseProc.java
Or download all of them as a single archive file:
File name: jdk.jdeps-17.0.5-src.zip File size: 258425 bytes Release date: 2022-09-13 Download
⇒ JDK 17 jdk.jdi.jmod - JDI Tool
2023-04-17, ≈54🔥, 0💬
Popular Posts:
maven-compat-3.5.4.jar is the JAR file for Apache Maven 3.5.4 Compact module. The JAR file name may ...
SLF4J API is a simple API that allows to plug in any desired logging library at deployment time. Her...
What Is fop.jar? I got it from the fop-2.7-bin.zip. fop.jar in fop-2.7-bin.zip is the JAR file for F...
What Is XMLBeans xbean.jar 2.6.0? XMLBeans xbean.jar 2.6.0 is the JAR file for Apache XMLBeans 2.6.0...
What Is mail.jar of JavaMail 1.4.2? I got the JAR file from javamail-1.4.2.zip. mail.jar in javamail...