mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-07-01 12:36:41 +00:00
24 lines
771 B
Java
24 lines
771 B
Java
package ca.momothereal.mojangson;
|
|
|
|
import ca.momothereal.mojangson.ex.MojangsonParseException;
|
|
import ca.momothereal.mojangson.value.MojangsonString;
|
|
import ca.momothereal.mojangson.value.MojangsonValue;
|
|
|
|
public class MojangsonFinder
|
|
{
|
|
|
|
/**
|
|
* Automatically detects the appropriate MojangsonValue from the given value.
|
|
*
|
|
* @param value The value to parse
|
|
* @return The resulting MojangsonValue. If the type couldn't be found, it falls back to MojangsonString
|
|
* @throws MojangsonParseException if the given value could not be parsed
|
|
*/
|
|
public static MojangsonValue readFromValue(String value) throws MojangsonParseException
|
|
{
|
|
MojangsonValue val = new MojangsonString();
|
|
val.read(value);
|
|
return val;
|
|
}
|
|
}
|