org.springframework.boot.config
Class SimpleJsonParser

java.lang.Object
  extended by org.springframework.boot.config.SimpleJsonParser
All Implemented Interfaces:
JsonParser

public class SimpleJsonParser
extends Object
implements JsonParser

Really basic JSON parser for when you have nothing else available. Comes with some limitations with respect to the JSON specification (e.g. only supports String values), so users will probably prefer to have a library handle things instead (Jackson or Snake YAML are supported).

Author:
Dave Syer
See Also:
JsonParserFactory

Constructor Summary
SimpleJsonParser()
           
 
Method Summary
 List<Object> parseList(String json)
          Parse the specified JSON string into a List.
 Map<String,Object> parseMap(String json)
          Parse the specified JSON string into a Map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleJsonParser

public SimpleJsonParser()
Method Detail

parseMap

public Map<String,Object> parseMap(String json)
Description copied from interface: JsonParser
Parse the specified JSON string into a Map.

Specified by:
parseMap in interface JsonParser
Parameters:
json - the JSON to parse
Returns:
the parsed JSON as a map

parseList

public List<Object> parseList(String json)
Description copied from interface: JsonParser
Parse the specified JSON string into a List.

Specified by:
parseList in interface JsonParser
Parameters:
json - the JSON to parse
Returns:
the parsed JSON as a list


Copyright © 2013. All Rights Reserved.