Class JavassistModuleHelper


  • public class JavassistModuleHelper
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Optional<Pair<java.lang.String,​java.util.List<java.lang.String>>> getModuleWithExportedPackages​(javassist.CtClass moduleInfo)
      Javassist does not provide support for modules beyond letting users fetch the module attribute byte array, so the attribute needs to be parsed manually.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MODULE_INFO_CLASS_NAME

        public static java.lang.String MODULE_INFO_CLASS_NAME
    • Constructor Detail

      • JavassistModuleHelper

        public JavassistModuleHelper()
    • Method Detail

      • getModuleWithExportedPackages

        public static java.util.Optional<Pair<java.lang.String,​java.util.List<java.lang.String>>> getModuleWithExportedPackages​(javassist.CtClass moduleInfo)
        Javassist does not provide support for modules beyond letting users fetch the module attribute byte array, so the attribute needs to be parsed manually. This is done according to The JVM Spec for the module attribute.
        Parameters:
        moduleInfo - the CtClass for module-info.class
        Returns:
        a pair of [ModuleName, ExportedPackageNames] if the module attribute is not empty.