Package edu.suffolk.litlab.efspserver
Class JsonHelpers
java.lang.Object
edu.suffolk.litlab.efspserver.JsonHelpers
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetBoolMember
(com.fasterxml.jackson.databind.JsonNode obj, String memberName) getIntMember
(com.fasterxml.jackson.databind.JsonNode obj, String memberName) getMemberList
(com.fasterxml.jackson.databind.JsonNode obj, String memberName) getNonEmptyStringMember
(com.fasterxml.jackson.databind.JsonNode obj, String memberName) static Optional
<BigDecimal> getNumberMember
(com.fasterxml.jackson.databind.JsonNode obj, String memberName) static String
getStringDefault
(com.fasterxml.jackson.databind.JsonNode obj, String memberName, String def) getStringMember
(com.fasterxml.jackson.databind.JsonNode obj, String memberName) static boolean
isNull
(com.fasterxml.jackson.databind.JsonNode j) static Optional
<com.fasterxml.jackson.databind.JsonNode> unwrapDADict
(com.fasterxml.jackson.databind.JsonNode obj) static Optional
<com.fasterxml.jackson.databind.JsonNode> unwrapDAList
(com.fasterxml.jackson.databind.JsonNode obj) Returns the JsonNode where `.isArray()` is true.
-
Constructor Details
-
JsonHelpers
public JsonHelpers()
-
-
Method Details
-
isNull
public static boolean isNull(com.fasterxml.jackson.databind.JsonNode j) -
getStringMember
-
getNonEmptyStringMember
-
getStringDefault
-
getIntMember
-
getNumberMember
public static Optional<BigDecimal> getNumberMember(com.fasterxml.jackson.databind.JsonNode obj, String memberName) -
getBoolMember
-
getMemberList
-
unwrapDAList
public static Optional<com.fasterxml.jackson.databind.JsonNode> unwrapDAList(com.fasterxml.jackson.databind.JsonNode obj) Returns the JsonNode where `.isArray()` is true.For DAList objects, Docassemble puts the actual JSON array nested in the `elements` attribute. This function lets you treat a normal JSON array and a DAList JSON object the same.
-
unwrapDADict
public static Optional<com.fasterxml.jackson.databind.JsonNode> unwrapDADict(com.fasterxml.jackson.databind.JsonNode obj)
-