Author: Amanda Tissot
-
Conditional Formatting 2 – Localization
•
Output from the program: Click here to view code image Requested Locale: en_USArguments:[0.5] Result: There are no bananas.Arguments:[1.5] Result: There is only one banana.Arguments:[2.5, 2] Result: There are 2 bananas. Requested Locale: es_ESArguments:[0.5] Result: Ahí no hay plátanos.Arguments:[1.5] Result: Ahí es solo un plátano.Arguments:[2.5, 2] Result: Ahí son 2 plátanos.…
-
Categories of Modules – Java Module System
•
19.11 Categories of Modules The Java Module System is designed to allow both non-modular and modular code to work together. Types are usually bundled in JAR files. Regardless of whether it a plain JAR or a modular JAR, how its content is handled by the module system depends on the…
-
Automatic Modules – Java Module System
•
Automatic Modules A plain JAR—that is, a JAR that does not have a module-info.class file in its top-level directory—defines an automatic module when placed on the module path. An automatic module has a module name which is determined according to the scheme described below. An automatic module can read all…
-
Explicit Modules – Java Module System
•
Explicit Modules As the name implies, an explicit module is described by its module descriptor that explicitly specifies its name and the modules it reads (i.e., its dependencies), including any packages it exports or opens, or any services it provides or uses. A modular JAR is treated as an explicit…
-
Bottom-Up Strategy for Code Migration – Java Module System
•
Bottom-Up Strategy for Code Migration If all direct dependencies of a plain JAR are known to be modules, the plain JAR can be directly converted to an explicit module by declaring their dependencies and exports in a module declaration. This idea is embodied in the following algorithm, based on the…
-
Exploring Modules – Java Module System
•
19.13 Exploring Modules This section provides an introduction to using the JDK tools to discover, explore, and analyze modular applications. Given the JARs main.jar, control.jar, view.jar, and model.jar for the adviceApp application in the mlib directory in Figure 19.14(c), p. 1188, we will use JDK tools to explore these archives…
-
Goals of the Modular JDK – Java Module System
•
Goals of the Modular JDK Specific goals of the modular JDK, not surprisingly, align with the benefits of modules extolled in §19.1, p. 1163. Overview of the Modular JDK The monolithic library of the JDK has now been split into many modules, with each module defining a specific functionality of…
-
Module Graph of the JDK – Java Module System
•
Module Graph of the JDK The modules in the JDK define dependencies on other modules. These dependencies can be viewed as a graph in which the modules are the nodes and the unidirectional edges between the nodes define the dependencies between the modules. A partial module graph of the JDK…
-
Module Basics – Java Module System
•
19.3 Module Basics Underlying the Java Module System is the concept of a module which is defined in the language and supported by the various JDK tools (such as javac, java, jar, and jdeps) and the Java runtime environment. An understanding of packages is a prerequisite for understanding modules. The…
-
Module Name – Java Module System
•
Module Name A legal module name can consist of one or more (by convention, lowercase) legal identifiers separated by a . (dot), as in the case of a package name. Module names and package names are in different namespaces. From the context in which such a name occurs, the compiler…