1 /*
2  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * This code is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License version 2 only, as
7  * published by the Free Software Foundation.  Oracle designates this
8  * particular file as subject to the "Classpath" exception as provided
9  * by Oracle in the LICENSE file that accompanied this code.
10  *
11  * This code is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14  * version 2 for more details (a copy is included in the LICENSE file that
15  * accompanied this code).
16  *
17  * You should have received a copy of the GNU General Public License version
18  * 2 along with this work; if not, write to the Free Software Foundation,
19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20  *
21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22  * or visit www.oracle.com if you need additional information or have any
23  * questions.
24  */
25 
26 package jdk.internal.module;
27 
28 import java.lang.module.ModuleDescriptor;
29 import java.util.Map;
30 import java.util.Set;
31 
32 /**
33  * A SystemModules object reconstitutes module descriptors and other modules
34  * attributes in an efficient way to avoid parsing module-info.class files at
35  * startup. Implementations of this class are generated by the "system modules"
36  * jlink plugin.
37  *
38  * @see SystemModuleFinders
39  * @see jdk.tools.jlink.internal.plugins.SystemModulesPlugin
40  */
41 
42 interface SystemModules {
43 
44     /**
45      * Returns false if the module reconstituted by this SystemModules object
46      * have no overlapping packages. Returns true if there are overlapping
47      * packages or unknown.
48      */
hasSplitPackages()49     boolean hasSplitPackages();
50 
51     /**
52      * Return false if the modules reconstituted by this SystemModules object
53      * do not include any incubator modules. Returns true if there are
54      * incubating modules or unknown.
55      */
hasIncubatorModules()56     boolean hasIncubatorModules();
57 
58     /**
59      * Returns the non-empty array of ModuleDescriptor objects.
60      */
moduleDescriptors()61     ModuleDescriptor[] moduleDescriptors();
62 
63     /**
64      * Returns the array of ModuleTarget objects. The array elements correspond
65      * to the array of ModuleDescriptor objects.
66      */
moduleTargets()67     ModuleTarget[] moduleTargets();
68 
69     /**
70      * Returns the array of ModuleHashes objects. The array elements correspond
71      * to the array of ModuleDescriptor objects.
72      */
moduleHashes()73     ModuleHashes[] moduleHashes();
74 
75     /**
76      * Returns the array of ModuleResolution objects. The array elements correspond
77      * to the array of ModuleDescriptor objects.
78      */
moduleResolutions()79     ModuleResolution[] moduleResolutions();
80 
81     /**
82      * Returns the map representing readability graph for the modules reconstituted
83      * by this SystemModules object.
84      */
moduleReads()85     Map<String, Set<String>> moduleReads();
86 
87     /**
88      * Returns the map of module concealed packages to open. The map key is the
89      * module name, the value is the set of concealed packages to open.
90      */
concealedPackagesToOpen()91     Map<String, Set<String>> concealedPackagesToOpen();
92 
93     /**
94      * Returns the map of module exported packages to open. The map key is the
95      * module name, the value is the set of exported packages to open.
96      */
exportedPackagesToOpen()97     Map<String, Set<String>> exportedPackagesToOpen();
98 }
99