io.github.endreman0.javajson.Parser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-json Show documentation
Show all versions of java-json Show documentation
A JSON parser and mutable object-model implememntation
package io.github.endreman0.javajson;
import io.github.endreman0.javajson.nodes.Node;
/**
* The old JSON parser. JSON parsing methods have been moved to the {@link JavaJson} class.
* @author endreman0
* @deprecated Use {@link JavaJson} instead.
*/
@Deprecated
public class Parser{
/**
* Parse a JSON node from a string.
*
* The passed string can be any JSON node: boolean, number, string, null, object, or array.
*
* If an invalid string is passed in, two things could happen:
*
* - If the first character of the string does not match any known JSON node, null will be returned.
* - If the first character matches a node, but there is an error somewhere else in the the string, an IllegalArgumentException will be thrown.
*
* @param json the string to parse
* @return the parsed node, or null if error
* @throws IllegalArgumentException if error
*/
public static Node parse(String json){
return JavaJson.parse(json);
}
}