Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
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 (309)
Collections:
Other Resources:
JDK 17 java.base.jmod - Base Module
JDK 17 java.base.jmod is the JMOD file for JDK 17 Base module.
JDK 17 Base module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\java.base.jmod.
JDK 17 Base module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 Base module source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\java.base.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ jdk/internal/module/Builder.java
/* * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package jdk.internal.module; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleDescriptor.Exports; import java.lang.module.ModuleDescriptor.Opens; import java.lang.module.ModuleDescriptor.Provides; import java.lang.module.ModuleDescriptor.Requires; import java.lang.module.ModuleDescriptor.Version; import java.util.List; import java.util.Set; import jdk.internal.access.JavaLangModuleAccess; import jdk.internal.access.SharedSecrets; /** * This builder is optimized for reconstituting the {@code ModuleDescriptor}s * for system modules. The validation should be done at jlink time. * * 1. skip name validation * 2. ignores dependency hashes. * 3. ModuleDescriptor skips the defensive copy and directly uses the * sets/maps created in this Builder. * * SystemModules should contain modules for the boot layer. */ final class Builder { private static final JavaLangModuleAccess JLMA = SharedSecrets.getJavaLangModuleAccess(); // Static cache of the most recently seen Version to cheaply deduplicate // most Version objects. JDK modules have the same version. static Version cachedVersion; /** * Returns a {@link Requires} for a dependence on a module with the given * (and possibly empty) set of modifiers, and optionally the version * recorded at compile time. */ public static Requires newRequires(Set<Requires.Modifier> mods, String mn, String compiledVersion) { Version version = null; if (compiledVersion != null) { // use the cached version if the same version string Version ver = cachedVersion; if (ver != null && compiledVersion.equals(ver.toString())) { version = ver; } else { version = Version.parse(compiledVersion); } } return JLMA.newRequires(mods, mn, version); } /** * Returns a {@link Requires} for a dependence on a module with the given * (and possibly empty) set of modifiers, and optionally the version * recorded at compile time. */ public static Requires newRequires(Set<Requires.Modifier> mods, String mn) { return newRequires(mods, mn, null); } /** * Returns a {@link Exports} for a qualified export, with * the given (and possibly empty) set of modifiers, * to a set of target modules. */ public static Exports newExports(Set<Exports.Modifier> ms, String pn, Set<String> targets) { return JLMA.newExports(ms, pn, targets); } /** * Returns an {@link Opens} for an unqualified open with a given set of * modifiers. */ public static Opens newOpens(Set<Opens.Modifier> ms, String pn) { return JLMA.newOpens(ms, pn); } /** * Returns an {@link Opens} for a qualified opens, with * the given (and possibly empty) set of modifiers, * to a set of target modules. */ public static Opens newOpens(Set<Opens.Modifier> ms, String pn, Set<String> targets) { return JLMA.newOpens(ms, pn, targets); } /** * Returns a {@link Exports} for an unqualified export with a given set * of modifiers. */ public static Exports newExports(Set<Exports.Modifier> ms, String pn) { return JLMA.newExports(ms, pn); } /** * Returns a {@link Provides} for a service with a given list of * implementation classes. */ public static Provides newProvides(String st, List<String> pcs) { return JLMA.newProvides(st, pcs); } final String name; boolean open, synthetic, mandated; Set<Requires> requires; Set<Exports> exports; Set<Opens> opens; Set<String> packages; Set<String> uses; Set<Provides> provides; Version version; String mainClass; Builder(String name) { this.name = name; this.requires = Set.of(); this.exports = Set.of(); this.opens = Set.of(); this.provides = Set.of(); this.uses = Set.of(); } Builder open(boolean value) { this.open = value; return this; } Builder synthetic(boolean value) { this.synthetic = value; return this; } Builder mandated(boolean value) { this.mandated = value; return this; } /** * Sets module exports. */ public Builder exports(Exports[] exports) { this.exports = Set.of(exports); return this; } /** * Sets module opens. */ public Builder opens(Opens[] opens) { this.opens = Set.of(opens); return this; } /** * Sets module requires. */ public Builder requires(Requires[] requires) { this.requires = Set.of(requires); return this; } /** * Adds a set of (possible empty) packages. */ public Builder packages(Set<String> packages) { this.packages = packages; return this; } /** * Sets the set of service dependences. */ public Builder uses(Set<String> uses) { this.uses = uses; return this; } /** * Sets module provides. */ public Builder provides(Provides[] provides) { this.provides = Set.of(provides); return this; } /** * Sets the module version. * * @throws IllegalArgumentException if {@code v} is null or cannot be * parsed as a version string * * @see Version#parse(String) */ public Builder version(String v) { Version ver = cachedVersion; if (ver != null && v.equals(ver.toString())) { version = ver; } else { cachedVersion = version = Version.parse(v); } return this; } /** * Sets the module main class. */ public Builder mainClass(String mc) { mainClass = mc; return this; } /** * Returns an immutable set of the module modifiers derived from the flags. */ private Set<ModuleDescriptor.Modifier> modifiers() { int n = 0; if (open) n++; if (synthetic) n++; if (mandated) n++; if (n == 0) { return Set.of(); } else { ModuleDescriptor.Modifier[] mods = new ModuleDescriptor.Modifier[n]; if (open) mods[--n] = ModuleDescriptor.Modifier.OPEN; if (synthetic) mods[--n] = ModuleDescriptor.Modifier.SYNTHETIC; if (mandated) mods[--n] = ModuleDescriptor.Modifier.MANDATED; return Set.of(mods); } } /** * Builds a {@code ModuleDescriptor} from the components. */ public ModuleDescriptor build(int hashCode) { assert name != null; return JLMA.newModuleDescriptor(name, version, modifiers(), requires, exports, opens, uses, provides, packages, mainClass, hashCode); } }
⏎ jdk/internal/module/Builder.java
Or download all of them as a single archive file:
File name: java.base-17.0.5-src.zip File size: 8883851 bytes Release date: 2022-09-13 Download
2023-09-26, 68967👍, 1💬
Popular Posts:
The Jakarta-ORO Java classes are a set of text-processing Java classes that provide Perl5 compatible...
MP3SPI is a Java Service Provider Interface that adds MP3 (MPEG 1/2/2.5 Layer 1/2/3) audio format su...
How to download and install xml-commons External Source Package? The source package contains Java so...
What Is log4j-1.2.15.jar? I got the JAR file from apache-log4j-1.2.15.zip. log4j-1.2.15.jar is the v...
What Is HttpComponents httpclient-4.2.2.jar? HttpComponents httpclient-4.2.2.jar is the JAR file for...