File tree Expand file tree Collapse file tree
byte-buddy-dep/src/main/java/net/bytebuddy/utility Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929import java .io .InputStream ;
3030import java .lang .reflect .AnnotatedElement ;
3131import java .security .PrivilegedAction ;
32+ import java .util .Set ;
3233
3334/**
3435 * Type-safe representation of a {@code java.lang.Module}. On platforms that do not support the module API, modules are represented by {@code null}.
@@ -128,6 +129,15 @@ public String getActualName() {
128129 return MODULE .getName (module );
129130 }
130131
132+ /**
133+ * Returns the packages of this module.
134+ *
135+ * @return A set of the names of the packages that are defined by this module.
136+ */
137+ public Set <String > getPackages () {
138+ return MODULE .getPackages (module );
139+ }
140+
131141 /**
132142 * Returns a resource stream for this module for a resource of the given name or {@code null} if such a resource does not exist.
133143 *
@@ -271,6 +281,14 @@ protected interface Module {
271281 */
272282 String getName (Object value );
273283
284+ /**
285+ * Returns the module's exported packages.
286+ *
287+ * @param value The {@code java.lang.Module} to check for its packages.
288+ * @return The module's packages.
289+ */
290+ Set <String > getPackages (Object value );
291+
274292 /**
275293 * Returns the class loader of a module.
276294 *
You can’t perform that action at this time.
0 commit comments