109 return isSystem && 110 (mn.startsWith("java.") || mn.startsWith("jdk.") || mn.startsWith("javafx.")); 111 } 112 113 public boolean isSystem() { 114 return isSystem; 115 } 116 117 public Map<String, Set<String>> exports() { 118 return exports; 119 } 120 121 public Set<String> packages() { 122 return descriptor.packages(); 123 } 124 125 /** 126 * Tests if the package of the given name is exported. 127 */ 128 public boolean isExported(String pn) { 129 if (JDK_UNSUPPORTED.equals(this.name())) { 130 return false; 131 } 132 return exports.containsKey(pn) ? exports.get(pn).isEmpty() : false; 133 } 134 135 /** 136 * Converts this module to a strict module with the given dependences 137 * 138 * @throws IllegalArgumentException if this module is not an automatic module 139 */ 140 public Module toStrictModule(Map<String, Boolean> requires) { 141 if (!isAutomatic()) { 142 throw new IllegalArgumentException(name() + " already a strict module"); 143 } 144 return new StrictModule(this, requires); 145 } 146 147 /** 148 * Tests if the package of the given name is qualifiedly exported 149 * to the target. 150 */ 151 public boolean isExported(String pn, String target) { 152 return isExported(pn) || exports.containsKey(pn) && exports.get(pn).contains(target); 153 } 154 | 109 return isSystem && 110 (mn.startsWith("java.") || mn.startsWith("jdk.") || mn.startsWith("javafx.")); 111 } 112 113 public boolean isSystem() { 114 return isSystem; 115 } 116 117 public Map<String, Set<String>> exports() { 118 return exports; 119 } 120 121 public Set<String> packages() { 122 return descriptor.packages(); 123 } 124 125 /** 126 * Tests if the package of the given name is exported. 127 */ 128 public boolean isExported(String pn) { 129 return exports.containsKey(pn) ? exports.get(pn).isEmpty() : false; 130 } 131 132 public boolean isJDKUnsupported() { 133 return JDK_UNSUPPORTED.equals(this.name()); 134 } 135 136 /** 137 * Converts this module to a strict module with the given dependences 138 * 139 * @throws IllegalArgumentException if this module is not an automatic module 140 */ 141 public Module toStrictModule(Map<String, Boolean> requires) { 142 if (!isAutomatic()) { 143 throw new IllegalArgumentException(name() + " already a strict module"); 144 } 145 return new StrictModule(this, requires); 146 } 147 148 /** 149 * Tests if the package of the given name is qualifiedly exported 150 * to the target. 151 */ 152 public boolean isExported(String pn, String target) { 153 return isExported(pn) || exports.containsKey(pn) && exports.get(pn).contains(target); 154 } 155 |