Package net.neoforged.fml.jarmoduleinfo
Class ModuleDescriptorFactory
java.lang.Object
net.neoforged.fml.jarmoduleinfo.ModuleDescriptorFactory
Utilities for creating
ModuleDescriptor from JarContents.
Most of this code also lives in the JDK in the internal ModulePath class.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static String(package private) static NameAndVersioncomputeNameAndVersion(Path path) private static voidparseServiceFile(String serviceName, BufferedReader reader, Set<String> packageNames, ModuleDescriptor.Builder builder) Parses a Java ServiceLoader file and adds its content as a provided service to the given module descriptor builder.private static StringsafeParseVersion(String ver, String filename) static voidscanAutomaticModule(JarContents jar, ModuleDescriptor.Builder builder, String... excludedRootDirectories)
-
Field Details
-
DASH_VERSION
-
NON_ALPHANUM
-
REPEATING_DOTS
-
LEADING_DOTS
-
TRAILING_DOTS
-
MODULE_VERSION
-
NUMBERLIKE_PARTS
-
ILLEGAL_KEYWORDS
-
KEYWORD_PARTS
-
-
Constructor Details
-
ModuleDescriptorFactory
private ModuleDescriptorFactory()
-
-
Method Details
-
computeNameAndVersion
-
safeParseVersion
-
cleanModuleName
-
scanAutomaticModule
public static void scanAutomaticModule(JarContents jar, ModuleDescriptor.Builder builder, String... excludedRootDirectories) - See Also:
-
parseServiceFile
private static void parseServiceFile(String serviceName, BufferedReader reader, Set<String> packageNames, ModuleDescriptor.Builder builder) throws IOException Parses a Java ServiceLoader file and adds its content as a provided service to the given module descriptor builder.Equivalent to the code found in ModulePath#deriveModuleDescriptor(JarFile)
- Throws:
IOException
-
scanModulePackages
- See Also:
-