171 // System.err.format("%s depend %s reexports %s%n", name, d, reexport); |
171 // System.err.format("%s depend %s reexports %s%n", name, d, reexport); |
172 requires.put(d, reexport); |
172 requires.put(d, reexport); |
173 return this; |
173 return this; |
174 } |
174 } |
175 |
175 |
176 public Builder include(String p) { |
176 public Builder packages(Set<String> pkgs) { |
177 packages.add(p); |
177 packages.addAll(pkgs); |
178 return this; |
178 return this; |
179 } |
179 } |
180 |
180 |
181 public Builder export(String p, Set<String> ms) { |
181 public Builder export(String p, Set<String> ms) { |
182 Objects.requireNonNull(p); |
182 Objects.requireNonNull(p); |
183 Objects.requireNonNull(ms); |
183 Objects.requireNonNull(ms); |
184 exports.put(p, new HashSet<>(ms)); |
184 exports.put(p, new HashSet<>(ms)); |
185 return this; |
185 return this; |
186 } |
186 } |
187 public Builder classes(ClassFileReader reader) { |
187 public Builder classes(ClassFileReader.ModuleClassReader reader) { |
188 this.reader = reader; |
188 this.reader = reader; |
189 return this; |
189 return this; |
190 } |
190 } |
|
191 |
191 public Module build() { |
192 public Module build() { |
192 Module m = new Module(reader, name, requires, exports, packages); |
193 Module m = new Module(reader, name, requires, exports, packages); |
193 return m; |
194 return m; |
194 } |
195 } |
195 } |
196 } |