Class 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 Detail

      • LiteralParser

        public LiteralParser()
    • Method Detail

      • first

        public static JsonLiteral first​(JsonSource source,
                                        PathMatcher matcher)
        First literal with mathed path.
        Parameters:
        source - json source
        matcher - 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 source
        matcher - 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 source
        matcher - 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 source
        matcher - mather to identify resulted literals
        Returns:
        all matched literals from json converted to string.