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;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Thin wrapper for Jackson 2 {@link ObjectMapper}.
|
||||||
|
*
|
||||||
* @author Dave Syer
|
* @author Dave Syer
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -25,11 +25,24 @@ import org.springframework.util.ClassUtils;
|
||||||
import org.springframework.util.StringUtils;
|
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
|
* @author Dave Syer
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class SimpleJsonParser implements JsonParser {
|
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() {
|
public static JsonParser instance() {
|
||||||
if (ClassUtils.isPresent("org.yaml.snakeyaml.Yaml", null)) {
|
if (ClassUtils.isPresent("org.yaml.snakeyaml.Yaml", null)) {
|
||||||
return new YamlParser();
|
return new YamlParser();
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,8 @@ import java.util.Map;
|
||||||
import org.yaml.snakeyaml.Yaml;
|
import org.yaml.snakeyaml.Yaml;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Thin wrapper for Snake {@link Yaml}.
|
||||||
|
*
|
||||||
* @author Dave Syer
|
* @author Dave Syer
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue