Interface JsonParser<T>
- Type Parameters:
T- The type the element will be parsed to.
- All Known Subinterfaces:
NumberJsonParser<T>
- All Known Implementing Classes:
HexCodeJsonParser, NamespaceJsonParser, NaturalCaseJsonParser, NegativeIntJsonParser, NegativeToNegativeJsonParser, NegativeToNonpositiveJsonParser, NonnegativeIntJsonParser, NonnegativeToNonnegativeJsonParser, NonnegativeToPositiveJsonParser, NonpositiveIntJsonParser, NonpositiveToNonnegativeJsonParser, PositiveIntJsonParser, PositiveToPositiveJsonParser, RangeJsonParser, SnakeCaseJsonParser, StringJsonParser, StringToStringJsonParser
public interface JsonParser<T>
Parses a JSON element to a specific type.
This is implemented by classes such as NamespaceJsonParser and PositiveIntJsonParser for validating complex data types not handled by GSON alone.
-
Method Summary
Modifier and TypeMethodDescriptionparse(@NonNull com.google.gson.JsonElement element, ElytrasOfFire plugin) Parse a givenJsonElement.
-
Method Details
-
parse
T parse(@NonNull com.google.gson.JsonElement element, ElytrasOfFire plugin) throws EoFJsonParseException Parse a givenJsonElement.- Parameters:
element- The element to parse and validate.plugin- The Elytras of Fire plugin instance.- Returns:
- The parsed and validated object.
- Throws:
EoFJsonParseException- If something goes wrong while parsing or validating.
-