Package sk.antons.json.parse
Class LiteralParser
java.lang.Object
sk.antons.json.parse.LiteralParser
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic List<JsonLiteral>all(JsonSource source, PathMatcher matcher) All literals with mathed path.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.
-
Constructor Details
-
LiteralParser
public LiteralParser()
-
-
Method Details
-
first
First literal with mathed path.- Parameters:
source- json sourcematcher- mather to identify resulted literal- Returns:
- first matched literal from json.
-
all
All literals with mathed path.- Parameters:
source- json sourcematcher- mather to identify resulted literals- Returns:
- all matched literals from json.
-
firstAsString
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
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.
-