mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-05 00:56:58 +08:00
Some javadocs
This commit is contained in:
parent
e60efc7e55
commit
fc021fc86a
@ -21,6 +21,8 @@ import java.util.Map;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
/**
|
||||
* Thin wrapper for Jackson 2 {@link ObjectMapper}.
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
*/
|
||||
|
@ -25,11 +25,24 @@ import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* 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).
|
||||
*
|
||||
* @see #instance()
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
*/
|
||||
public class SimpleJsonParser implements JsonParser {
|
||||
|
||||
/**
|
||||
* Static factory for the "best" JSON parser available on the classpath. Tries Jackson
|
||||
* (2), then Snake YAML, and then falls back to the {@link SimpleJsonParser}.
|
||||
*
|
||||
* @return a {@link JsonParser}
|
||||
*/
|
||||
public static JsonParser instance() {
|
||||
if (ClassUtils.isPresent("org.yaml.snakeyaml.Yaml", null)) {
|
||||
return new YamlParser();
|
||||
|
@ -21,6 +21,8 @@ import java.util.Map;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
|
||||
/**
|
||||
* Thin wrapper for Snake {@link Yaml}.
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user