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 Details

    • LiteralParser

      public LiteralParser()
  • Method Details

    • 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.