public final class JsonParser
extends java.lang.Object
implements me.hypherionmc.moonconfig.core.io.ConfigParser<me.hypherionmc.moonconfig.core.Config>
| Constructor and Description |
|---|
JsonParser() |
| Modifier and Type | Method and Description |
|---|---|
me.hypherionmc.moonconfig.core.ConfigFormat<me.hypherionmc.moonconfig.core.Config> |
getFormat() |
boolean |
isEmptyDataAccepted() |
me.hypherionmc.moonconfig.core.Config |
parse(java.io.Reader reader)
Parses a JSON object to a Config.
|
void |
parse(java.io.Reader reader,
me.hypherionmc.moonconfig.core.Config destination,
me.hypherionmc.moonconfig.core.io.ParsingMode parsingMode)
Parses a JSON object to a Config.
|
java.lang.Object |
parseDocument(java.io.Reader reader)
Parses a JSON document, either a JSON object (parsed to a JsonConfig) or a JSON array
(parsed to a List).
|
java.lang.Object |
parseDocument(java.lang.String json)
Parses a JSON document, either a JSON object (parsed to a JsonConfig) or a JSON array
(parsed to a List).
|
<T> java.util.List<T> |
parseList(java.io.Reader reader)
Parses a JSON array to a List.
|
void |
parseList(java.io.Reader reader,
java.util.List<?> destination,
me.hypherionmc.moonconfig.core.io.ParsingMode parsingMode)
Parses a JSON array to a List.
|
<T> java.util.List<T> |
parseList(java.lang.String json)
Parses a JSON array to a List.
|
JsonParser |
setEmptyDataAccepted(boolean emptyDataAccepted)
Enables or disables the acceptance of empty input data.
|
public me.hypherionmc.moonconfig.core.ConfigFormat<me.hypherionmc.moonconfig.core.Config> getFormat()
getFormat in interface me.hypherionmc.moonconfig.core.io.ConfigParser<me.hypherionmc.moonconfig.core.Config>public boolean isEmptyDataAccepted()
public JsonParser setEmptyDataAccepted(boolean emptyDataAccepted)
parseList(Reader) call) when the input is empty.emptyDataAccepted - true to accept empty data as a valid input, false to reject itpublic java.lang.Object parseDocument(java.lang.String json)
json - the data to parsepublic java.lang.Object parseDocument(java.io.Reader reader)
reader - the Reader to parsepublic me.hypherionmc.moonconfig.core.Config parse(java.io.Reader reader)
parse in interface me.hypherionmc.moonconfig.core.io.ConfigParser<me.hypherionmc.moonconfig.core.Config>public void parse(java.io.Reader reader,
me.hypherionmc.moonconfig.core.Config destination,
me.hypherionmc.moonconfig.core.io.ParsingMode parsingMode)
parse in interface me.hypherionmc.moonconfig.core.io.ConfigParser<me.hypherionmc.moonconfig.core.Config>public <T> java.util.List<T> parseList(java.lang.String json)
json - the data to parsepublic <T> java.util.List<T> parseList(java.io.Reader reader)
reader - the Reader to parsepublic void parseList(java.io.Reader reader,
java.util.List<?> destination,
me.hypherionmc.moonconfig.core.io.ParsingMode parsingMode)
reader - the Reader to parsedestination - the List where to put the data