JavaLangModuleAccess.java revision 13901:b2a69d66dc65
1/* 2 * Copyright (c) 2015, 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 26package jdk.internal.misc; 27 28import java.lang.module.ModuleDescriptor; 29import java.lang.module.ModuleDescriptor.Exports; 30import java.lang.module.ModuleDescriptor.Requires; 31import java.lang.module.ModuleDescriptor.Provides; 32import java.lang.module.ModuleDescriptor.Version; 33import java.util.Map; 34import java.util.Set; 35 36/** 37 * Provides access to non-public methods in java.lang.module. 38 */ 39 40public interface JavaLangModuleAccess { 41 42 /** 43 * Returns {@code ModuleDescriptor.Requires} of the given modifier 44 * and module name. 45 */ 46 Requires newRequires(Set<Requires.Modifier> ms, String mn); 47 48 /** 49 * Returns an unqualified {@code ModuleDescriptor.Exports} 50 * of the given package name. 51 */ 52 Exports newExports(String source); 53 54 /** 55 * Returns a qualified {@code ModuleDescriptor.Exports} 56 * of the given package name and targets. 57 */ 58 Exports newExports(String source, Set<String> targets); 59 60 /** 61 * Returns a {@code ModuleDescriptor.Provides} 62 * of the given service name and providers. 63 */ 64 Provides newProvides(String service, Set<String> providers); 65 66 /** 67 * Returns a {@code ModuleDescriptor.Version} of the given version. 68 */ 69 Version newVersion(String v); 70 71 /** 72 * Clones the given module descriptor with an augmented set of packages 73 */ 74 ModuleDescriptor newModuleDescriptor(ModuleDescriptor md, Set<String> pkgs); 75 76 /** 77 * Returns a new {@code ModuleDescriptor} instance. 78 */ 79 ModuleDescriptor newModuleDescriptor(String name, 80 boolean automatic, 81 boolean synthetic, 82 Set<Requires> requires, 83 Set<String> uses, 84 Set<Exports> exports, 85 Map<String, Provides> provides, 86 Version version, 87 String mainClass, 88 String osName, 89 String osArch, 90 String osVersion, 91 Set<String> conceals, 92 Set<String> packages); 93} 94