Class AbstractTranslationLoader
- java.lang.Object
-
- com.github.siroshun09.mcmessage.translation.AbstractTranslationLoader
-
- All Implemented Interfaces:
TranslationLoader
public abstract class AbstractTranslationLoader extends Object implements TranslationLoader
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractTranslationLoader(@NotNull Path directory, @NotNull net.kyori.adventure.key.Key registryKey, @NotNull Locale defaultLocale)protectedAbstractTranslationLoader(@NotNull Path directory, @NotNull net.kyori.adventure.key.Key registryKey, @NotNull Locale defaultLocale, @NotNull String fileExtension)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract @NotNull FileConfigurationcreateFileConfiguration(@NotNull Path path)@NotNull LocalegetDefaultLocale()@NotNull PathgetDirectory()@NotNull StringgetFileExtension()@NotNull @Unmodifiable Set<Locale>getLoadedLocales()@NotNull net.kyori.adventure.key.KeygetRegistryKey()voidload()voidreload()protected abstract voidsaveDefaultIfNotExists()
-
-
-
Constructor Detail
-
AbstractTranslationLoader
protected AbstractTranslationLoader(@NotNull @NotNull Path directory, @NotNull @NotNull net.kyori.adventure.key.Key registryKey, @NotNull @NotNull Locale defaultLocale)
-
AbstractTranslationLoader
protected AbstractTranslationLoader(@NotNull @NotNull Path directory, @NotNull @NotNull net.kyori.adventure.key.Key registryKey, @NotNull @NotNull Locale defaultLocale, @NotNull @NotNull String fileExtension)
-
-
Method Detail
-
load
public void load() throws IOException
- Specified by:
loadin interfaceTranslationLoader- Throws:
IOException
-
reload
public void reload() throws IOException
- Specified by:
reloadin interfaceTranslationLoader- Throws:
IOException
-
getLoadedLocales
@NotNull public @NotNull @Unmodifiable Set<Locale> getLoadedLocales()
- Specified by:
getLoadedLocalesin interfaceTranslationLoader
-
getDirectory
@NotNull public @NotNull Path getDirectory()
- Specified by:
getDirectoryin interfaceTranslationLoader
-
getRegistryKey
@NotNull public @NotNull net.kyori.adventure.key.Key getRegistryKey()
- Specified by:
getRegistryKeyin interfaceTranslationLoader
-
getDefaultLocale
@NotNull public @NotNull Locale getDefaultLocale()
- Specified by:
getDefaultLocalein interfaceTranslationLoader
-
getFileExtension
@NotNull public @NotNull String getFileExtension()
- Specified by:
getFileExtensionin interfaceTranslationLoader
-
saveDefaultIfNotExists
protected abstract void saveDefaultIfNotExists() throws IOException
- Throws:
IOException
-
createFileConfiguration
@NotNull protected abstract @NotNull FileConfiguration createFileConfiguration(@NotNull @NotNull Path path)
-
-