Package sk.antons.json.parse
Class LiteralParser
- java.lang.Object
-
- sk.antons.json.parse.LiteralParser
-
public class LiteralParser extends Object
Json parser, which finds only literal values. It does not build all json data tree. Simple traverse that data tree and finds specified literal values.- Author:
- antons
-
-
Constructor Summary
Constructors Constructor Description LiteralParser()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<JsonLiteral>all(JsonSource source, PathMatcher matcher)All literals with mathed path.static List<String>allAsString(JsonSource source, PathMatcher matcher)All literals with mathed path converted to string.static JsonLiteralfirst(JsonSource source, PathMatcher matcher)First literal with mathed path.static StringfirstAsString(JsonSource source, PathMatcher matcher)First literal with mathed path converted to string.
-
-
-
Method Detail
-
first
public static JsonLiteral first(JsonSource source, PathMatcher matcher)
First literal with mathed path.- Parameters:
source- json sourcematcher- mather to identify resulted literal- Returns:
- first matched literal from json.
-
all
public static List<JsonLiteral> all(JsonSource source, PathMatcher matcher)
All literals with mathed path.- Parameters:
source- json sourcematcher- mather to identify resulted literals- Returns:
- all matched literals from json.
-
firstAsString
public static String firstAsString(JsonSource source, PathMatcher matcher)
First literal with mathed path converted to string.- Parameters:
source- json sourcematcher- mather to identify resulted literal- Returns:
- first matched literal from json converted to string.
-
allAsString
public static List<String> allAsString(JsonSource source, PathMatcher matcher)
All literals with mathed path converted to string.- Parameters:
source- json sourcematcher- mather to identify resulted literals- Returns:
- all matched literals from json converted to string.
-
-