Class CatalogueLoader
java.lang.Object
com.ultikits.ultitools.text.internal.CatalogueLoader
Reads module-owned YAML resources without logging, publishing or writing files.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final recordMetadata is present only when the external plugin's own JAR has a recognized locale file.static final recordParsed entries, deferred diagnostics and unmodified shipped UTF-8 contents. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static booleancatalogueFile(String name, String display, List<String> diagnostics) catalogueLocale(String file) private static voidflatten(String namespace, String file, String prefix, Map<?, ?> mapping, Map<String, String> values, List<String> diagnostics) private static voidflattenEntry(String namespace, String file, String prefix, Object key, @Nullable Object value, Map<String, String> values, List<String> diagnostics) (package private) @Nullable CatalogueLoader.ExternalSourceinspectExternal(@Nullable URL location) private static booleanisExternalCatalogue(JarEntry entry) Loads only resources from the explicitly supplied module code source.(package private) CatalogueLoader.Loadedprivate static CatalogueparseFiles(String namespace, Locale sourceLocale, Map<String, String> files, List<String> diagnostics) private static CatalogueparseFiles(String namespace, Locale sourceLocale, Map<String, String> files, List<String> diagnostics, @Nullable Catalogue shipped) private static voidprivate static voidprivate static Stringprivate static @Nullable Stringprivate static voidremoveStaleReferences(Path reference, Map<String, String> shipped) private static voidwithOverrides(CatalogueLoader.Loaded shipped, Path directory) Reads operator-owned overrides without creating or rewriting any operator file.writeReferences(CatalogueLoader.Loaded shipped, Path overrideDirectory) Refreshes framework-owned references only, never the operator-owned files in the parent directory.
-
Field Details
-
LANGUAGE_FILE
-
-
Constructor Details
-
CatalogueLoader
public CatalogueLoader()
-
-
Method Details
-
load
public CatalogueLoader.Loaded load(String namespace, Locale sourceLocale, @Nullable @Nullable URL location) Loads only resources from the explicitly supplied module code source. -
load
CatalogueLoader.Loaded load(String namespace, Locale sourceLocale, @Nullable @Nullable URL location, boolean external) -
inspectExternal
@Nullable @Nullable CatalogueLoader.ExternalSource inspectExternal(@Nullable @Nullable URL location) throws IOException - Throws:
IOException
-
isExternalCatalogue
-
catalogueLocale
-
readSourceLanguage
- Throws:
IOException
-
withOverrides
Reads operator-owned overrides without creating or rewriting any operator file. -
writeReferences
Refreshes framework-owned references only, never the operator-owned files in the parent directory. These copies are informational and excluded from catalogue loading; startup may overwrite them.- Parameters:
shipped- original bundled UTF-8 filesoverrideDirectory- operator directory whose reference child is exclusively framework-owned- Returns:
- nonfatal write or cleanup diagnostics
-
readReferenceHeader
- Throws:
IOException
-
removeStaleReferences
private static void removeStaleReferences(Path reference, Map<String, String> shipped) throws IOException- Throws:
IOException
-
catalogueFile
-
readDirectory
private static void readDirectory(Path directory, Map<String, String> files, List<String> diagnostics) throws IOException- Throws:
IOException
-
readJar
private static void readJar(Path path, Map<String, String> files, List<String> diagnostics, boolean external) throws IOException- Throws:
IOException
-
warnMissingBaseLanguages
-
parseFiles
-
parseFiles
-
parseFile
-
flatten
-
flattenEntry
-