Skip to content

Commit

Permalink
Add more Javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
Almighty-Satan committed Mar 10, 2024
1 parent c0dfef1 commit 9ea8b30
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ public interface LanguageParser {
*/
void load(@NotNull Values values) throws IOException;

/**
* Contains values provided by one or multiple {@link LanguageParser LanguageParsers}.
*/
interface Values {
/**
* Returns a {@link Set} containing all valid paths.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
*/
public class MissingTranslationException extends RuntimeException {

/**
* Creates a new {@link MissingTranslationException}.
*
* @param languageIdentifier the identifier of the language
* @param path the path of the missing translation
*/
public MissingTranslationException(@NotNull String languageIdentifier, @NotNull String path) {
super(String.format("Missing translation: %s in language %s", path, languageIdentifier));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
@FunctionalInterface
public interface PlaceholderResolver {

/**
* A {@link PlaceholderResolver} that always returns null (does not resolve any {@link Placeholder Placeholders}).
*/
PlaceholderResolver EMPTY = key -> null;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
/**
* Represents a map of {@link Translation Translations}.
*
* @param <K> the type of the key
* @param <T> the type of this translation
* @param <U> the {@link Translation Translations} in this map
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
*/
public class UnknownLanguageException extends RuntimeException {

/**
* Creates a new {@link UnknownLanguageException}.
*
* @param languageIdentifier the unknown identifier
*/
public UnknownLanguageException(@NotNull String languageIdentifier) {
super(String.format("Unknown language: %s", languageIdentifier));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
/**
* Represents a map of {@link AdventureTranslation AdventureTranslations}.
*
* @param <K> the type of the key
* @param <T> the type of this translation
* @param <U> the {@link AdventureTranslation AdventureTranslations} in this map
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
*/
public interface ContextTagResolver extends TagResolver {

/**
* A {@link ContextTagResolver} that does not resolve any tags.
*/
ContextTagResolver EMPTY = new ContextTagResolver() {
@Override
public @Nullable Tag resolve(@TagPattern @NotNull String name, @NotNull ArgumentQueue arguments, net.kyori.adventure.text.minimessage.@NotNull Context ctx, @Nullable Context context) throws ParsingException {
Expand Down

0 comments on commit 9ea8b30

Please sign in to comment.