public abstract class JsonObjectArrayBase extends Object implements JsonObjectOrArray
| Modifier and Type | Class and Description |
|---|---|
static class |
JsonObjectArrayBase.JsonPathCachingItem |
| Modifier and Type | Field and Description |
|---|---|
protected Object |
defaultElementValidator |
protected org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
JsonObjectArrayBase(boolean mutable,
JsonManager jsonManager,
SpincastUtils spincastUtils,
ObjectConverter objectConverter)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected Object |
clone() |
abstract JsonObjectOrArray |
clone(boolean mutable)
Clone the object.
|
protected <T> T |
getArrayFirst(String jsonPath,
boolean parseJsonPath,
boolean hasdefaultElement,
T defaultElement,
JsonObjectDefault.IFirstElementGetter<T> firstElementGetter) |
BigDecimal |
getArrayFirstBigDecimal(String key)
Gets the first value (as BigDecimal) of a
JsonArray property
of the object, using the JsonPath to find the array. |
BigDecimal |
getArrayFirstBigDecimal(String key,
BigDecimal defaultElement)
Gets the first value (as BigDecimal) of a
JsonArray property
of the object, using the JsonPath to find the array. |
protected BigDecimal |
getArrayFirstBigDecimal(String key,
boolean parseJsonPath,
boolean hasdefaultElement,
BigDecimal defaultElement) |
BigDecimal |
getArrayFirstBigDecimalNoKeyParsing(String key) |
BigDecimal |
getArrayFirstBigDecimalNoKeyParsing(String key,
BigDecimal defaultElement) |
Boolean |
getArrayFirstBoolean(String key)
Gets the first value (as Boolean) of a
JsonArray property
of the object, using the JsonPath to find the array. |
Boolean |
getArrayFirstBoolean(String key,
Boolean defaultElement)
Gets the first value (as Boolean) of a
JsonArray property
of the object, using the JsonPath to find the array. |
protected Boolean |
getArrayFirstBoolean(String key,
boolean parseJsonPath,
boolean hasdefaultElement,
Boolean defaultElement) |
Boolean |
getArrayFirstBooleanNoKeyParsing(String key) |
Boolean |
getArrayFirstBooleanNoKeyParsing(String key,
Boolean defaultElement) |
byte[] |
getArrayFirstBytesFromBase64String(String key)
Gets the first value (as byte[]) of a
JsonArray property
of the object, using the JsonPath to find the array. |
protected byte[] |
getArrayFirstBytesFromBase64String(String key,
boolean parseJsonPath,
boolean hasdefaultElement,
byte[] defaultElement) |
byte[] |
getArrayFirstBytesFromBase64String(String key,
byte[] defaultElement)
Gets the first value (as byte[]) of a
JsonArray property
of the object, using the JsonPath to find the array. |
byte[] |
getArrayFirstBytesFromBase64StringNoKeyParsing(String key) |
byte[] |
getArrayFirstBytesFromBase64StringNoKeyParsing(String key,
byte[] defaultElement) |
Date |
getArrayFirstDate(String key)
Gets the first value (as Date) of a
JsonArray property
of the object, using the JsonPath to find the array. |
protected Date |
getArrayFirstDate(String jsonPath,
boolean parseJsonPath,
boolean hasdefaultElement,
Date defaultElement) |
Date |
getArrayFirstDate(String key,
Date defaultElement)
Gets the first value (as Date) of a
JsonArray property
of the object, using the JsonPath to find the array. |
Date |
getArrayFirstDateNoKeyParsing(String key) |
Date |
getArrayFirstDateNoKeyParsing(String key,
Date defaultElement) |
Double |
getArrayFirstDouble(String key)
Gets the first value (as Double) of a
JsonArray property
of the object, using the JsonPath to find the array. |
protected Double |
getArrayFirstDouble(String key,
boolean parseJsonPath,
boolean hasdefaultElement,
Double defaultElement) |
Double |
getArrayFirstDouble(String key,
Double defaultElement)
Gets the first value (as Double) of a
JsonArray property
of the object, using the JsonPath to find the array. |
Double |
getArrayFirstDoubleNoKeyParsing(String key) |
Double |
getArrayFirstDoubleNoKeyParsing(String key,
Double defaultElement) |
Float |
getArrayFirstFloat(String key)
Gets the first value (as Float) of a
JsonArray property
of the object, using the JsonPath to find the array. |
protected Float |
getArrayFirstFloat(String key,
boolean parseJsonPath,
boolean hasdefaultElement,
Float defaultElement) |
Float |
getArrayFirstFloat(String key,
Float defaultElement)
Gets the first value (as Float) of a
JsonArray property
of the object, using the JsonPath to find the array. |
Float |
getArrayFirstFloatNoKeyParsing(String key) |
Float |
getArrayFirstFloatNoKeyParsing(String key,
Float defaultElement) |
Instant |
getArrayFirstInstant(String key)
Gets the first value (as Instant) of a
JsonArray property
of the object, using the JsonPath to find the array. |
protected Instant |
getArrayFirstInstant(String jsonPath,
boolean parseJsonPath,
boolean hasdefaultElement,
Instant defaultElement) |
Instant |
getArrayFirstInstant(String key,
Instant defaultElement)
Gets the first value (as Instant) of a
JsonArray property
of the object, using the JsonPath to find the array. |
Instant |
getArrayFirstInstantNoKeyParsing(String key) |
Instant |
getArrayFirstInstantNoKeyParsing(String key,
Instant defaultElement) |
Integer |
getArrayFirstInteger(String key)
Gets the first value (as Integer) of a
JsonArray property
of the object, using the JsonPath to find the array. |
protected Integer |
getArrayFirstInteger(String key,
boolean parseJsonPath,
boolean hasdefaultElement,
Integer defaultElement) |
Integer |
getArrayFirstInteger(String key,
Integer defaultElement)
Gets the first value (as Integer) of a
JsonArray property
of the object, using the JsonPath to find the array. |
Integer |
getArrayFirstIntegerNoKeyParsing(String key) |
Integer |
getArrayFirstIntegerNoKeyParsing(String key,
Integer defaultElement) |
JsonArray |
getArrayFirstJsonArray(String key)
Gets the first value (as JsonArray) of a
JsonArray property
of the object, using the JsonPath to find the array. |
protected JsonArray |
getArrayFirstJsonArray(String key,
boolean parseJsonPath,
boolean hasdefaultElement,
JsonArray defaultElement) |
JsonArray |
getArrayFirstJsonArray(String key,
JsonArray defaultElement)
Gets the first value (as JsonArray) of a
JsonArray property
of the object, using the JsonPath to find the array. |
JsonArray |
getArrayFirstJsonArrayNoKeyParsing(String key) |
JsonArray |
getArrayFirstJsonArrayNoKeyParsing(String key,
JsonArray defaultElement) |
JsonObject |
getArrayFirstJsonObject(String key)
Gets the first value (as JsonObject) of a
JsonArray property
of the object, using the JsonPath to find the array. |
protected JsonObject |
getArrayFirstJsonObject(String key,
boolean parseJsonPath,
boolean hasdefaultElement,
JsonObject defaultElement) |
JsonObject |
getArrayFirstJsonObject(String key,
JsonObject defaultElement)
Gets the first value (as JsonObject) of a
JsonArray property
of the object, using the JsonPath to find the array. |
JsonObject |
getArrayFirstJsonObjectNoKeyParsing(String key) |
JsonObject |
getArrayFirstJsonObjectNoKeyParsing(String key,
JsonObject defaultElement) |
Long |
getArrayFirstLong(String key)
Gets the first value (as Long) of a
JsonArray property
of the object, using the JsonPath to find the array. |
protected Long |
getArrayFirstLong(String key,
boolean parseJsonPath,
boolean hasdefaultElement,
Long defaultElement) |
Long |
getArrayFirstLong(String key,
Long defaultElement)
Gets the first value (as Long) of a
JsonArray property
of the object, using the JsonPath to find the array. |
Long |
getArrayFirstLongNoKeyParsing(String key) |
Long |
getArrayFirstLongNoKeyParsing(String key,
Long defaultElement) |
String |
getArrayFirstString(String key)
Gets the first value (as String) of a
JsonArray property
of the object, using the JsonPath to find the array. |
protected String |
getArrayFirstString(String key,
boolean parseJsonPath,
boolean hasdefaultElement,
String defaultElement) |
String |
getArrayFirstString(String key,
String defaultElement)
Gets the first value (as String) of a
JsonArray property
of the object, using the JsonPath to find the array. |
String |
getArrayFirstStringNoKeyParsing(String key) |
String |
getArrayFirstStringNoKeyParsing(String key,
String defaultElement) |
BigDecimal |
getBigDecimal(String jsonPath)
Gets an element as
BigDecimal using the
specified JsonPath. |
BigDecimal |
getBigDecimal(String jsonPath,
BigDecimal defaultElement)
Gets an element as
BigDecimal using the
specified JsonPath. |
protected BigDecimal |
getBigDecimal(String jsonPath,
boolean hasdefaultElement,
BigDecimal defaultElement,
boolean parseJsonPath) |
protected BigDecimal |
getBigDecimalElement(String jsonPath,
boolean hasdefaultElement,
BigDecimal defaultElement) |
protected BigDecimal |
getBigDecimalFromObject(Object object) |
BigDecimal |
getBigDecimalNoKeyParsing(String jsonPath) |
BigDecimal |
getBigDecimalNoKeyParsing(String jsonPath,
BigDecimal defaultElement) |
Boolean |
getBoolean(String jsonPath)
Gets an element as
Boolean using the
specified JsonPath. |
Boolean |
getBoolean(String jsonPath,
Boolean defaultElement)
Gets an element as
Boolean using the
specified JsonPath. |
protected Boolean |
getBoolean(String jsonPath,
boolean hasdefaultElement,
Boolean defaultElement,
boolean parseJsonPath) |
protected Boolean |
getBooleanElement(String jsonPath,
boolean hasdefaultElement,
Boolean defaultElement) |
protected Boolean |
getBooleanFromObject(Object object) |
Boolean |
getBooleanNoKeyParsing(String jsonPath) |
Boolean |
getBooleanNoKeyParsing(String jsonPath,
Boolean defaultElement) |
byte[] |
getBytesFromBase64String(String jsonPath)
Gets a byte array, from a base 64 encoded element using the
specified
JsonPath. |
protected byte[] |
getBytesFromBase64String(String jsonPath,
boolean hasdefaultElement,
byte[] defaultElement,
boolean parseJsonPath) |
byte[] |
getBytesFromBase64String(String jsonPath,
byte[] defaultElement)
Gets a byte array, from a base 64 encoded element using the
specified
JsonPath. |
protected byte[] |
getBytesFromBase64StringElement(String jsonPath,
boolean hasdefaultElement,
byte[] defaultElement) |
byte[] |
getBytesFromBase64StringNoKeyParsing(String jsonPath) |
byte[] |
getBytesFromBase64StringNoKeyParsing(String jsonPath,
byte[] defaultElement) |
protected byte[] |
getBytesFromBase64StringValueFromObject(Object object) |
Date |
getDate(String jsonPath)
Gets a UTC timezoned date from a
ISO 8601 date string element using the
specified JsonPath. |
protected Date |
getDate(String jsonPath,
boolean hasdefaultElement,
Date defaultElement,
boolean parseJsonPath) |
Date |
getDate(String jsonPath,
Date defaultElement)
Gets a UTC timezoned date from a
ISO 8601 date string element using the
specified JsonPath. |
protected Date |
getDateElement(String jsonPath,
boolean hasdefaultElement,
Date defaultElement) |
protected Date |
getDateFromObject(Object object) |
Date |
getDateNoKeyParsing(String jsonPath) |
Date |
getDateNoKeyParsing(String jsonPath,
Date defaultElement) |
protected Object |
getdefaultElementValidator() |
Double |
getDouble(String jsonPath)
Gets an element as
Double using the
specified JsonPath. |
protected Double |
getDouble(String jsonPath,
boolean hasdefaultElement,
Double defaultElement,
boolean parseJsonPath) |
Double |
getDouble(String jsonPath,
Double defaultElement)
Gets an element as
Double using the
specified JsonPath. |
protected Double |
getDoubleElement(String jsonPath,
boolean hasdefaultElement,
Double defaultElement) |
protected Double |
getDoubleFromObject(Object object) |
Double |
getDoubleNoKeyParsing(String jsonPath) |
Double |
getDoubleNoKeyParsing(String jsonPath,
Double defaultElement) |
protected Object |
getElement(String key,
boolean hasdefaultElement,
Object defaultElement,
boolean parseJsonPath)
Gets the element at this key/jsonPath/index.
|
protected abstract Object |
getElementNoKeyParsing(String key,
boolean hasdefaultElement,
Object defaultElement)
Gets the element at this key/index, without
key parsing.
|
Float |
getFloat(String jsonPath)
Gets an element as
Float using the
specified JsonPath. |
protected Float |
getFloat(String jsonPath,
boolean hasdefaultElement,
Float defaultElement,
boolean parseJsonPath) |
Float |
getFloat(String jsonPath,
Float defaultElement)
Gets an element as
Float using the
specified JsonPath. |
protected Float |
getFloatElement(String jsonPath,
boolean hasdefaultElement,
Float defaultElement) |
protected Float |
getFloatFromObject(Object object) |
Float |
getFloatNoKeyParsing(String jsonPath) |
Float |
getFloatNoKeyParsing(String jsonPath,
Float defaultElement) |
Instant |
getInstant(String jsonPath)
Gets an Instant from a
ISO 8601 date string element using the
specified JsonPath. |
protected Instant |
getInstant(String jsonPath,
boolean hasdefaultElement,
Instant defaultElement,
boolean parseJsonPath) |
Instant |
getInstant(String jsonPath,
Instant defaultElement)
Gets an Instant from a
ISO 8601 date string element using the
specified JsonPath. |
protected Instant |
getInstantElement(String jsonPath,
boolean hasdefaultElement,
Instant defaultElement) |
protected Instant |
getInstantFromObject(Object object) |
Instant |
getInstantNoKeyParsing(String jsonPath) |
Instant |
getInstantNoKeyParsing(String jsonPath,
Instant defaultElement) |
Integer |
getInteger(String jsonPath)
Gets an element as
Integer using the
specified JsonPath. |
protected Integer |
getInteger(String jsonPath,
boolean hasdefaultElement,
Integer defaultElement,
boolean parseJsonPath) |
Integer |
getInteger(String jsonPath,
Integer defaultElement)
Gets an element as
Integer using the
specified JsonPath. |
protected Integer |
getIntegerElement(String jsonPath,
boolean hasdefaultElement,
Integer defaultElement) |
protected Integer |
getIntegerFromObject(Object object) |
Integer |
getIntegerNoKeyParsing(String jsonPath) |
Integer |
getIntegerNoKeyParsing(String jsonPath,
Integer defaultElement) |
JsonArray |
getJsonArray(String jsonPath)
Gets an element as
JsonArray using the
specified JsonPath. |
protected JsonArray |
getJsonArray(String jsonPath,
boolean hasdefaultElement,
JsonArray defaultElement,
boolean parseJsonPath) |
JsonArray |
getJsonArray(String jsonPath,
JsonArray defaultElement)
Gets an element as
JsonArray using the
specified JsonPath. |
protected JsonArray |
getJsonArrayFromObject(Object object) |
JsonArray |
getJsonArrayNoKeyParsing(String jsonPath) |
JsonArray |
getJsonArrayNoKeyParsing(String jsonPath,
JsonArray defaultElement) |
JsonArray |
getJsonArrayOrEmpty(String jsonPath)
Gets an element as
JsonArray using the
specified JsonPath. |
JsonArray |
getJsonArrayOrEmpty(String jsonPath,
boolean addIfDoesntExist)
Gets an element as
JsonArray using the
specified JsonPath. |
JsonArray |
getJsonArrayOrEmptyNoKeyParsing(String jsonPath) |
protected JsonManager |
getJsonManager() |
JsonObject |
getJsonObject(String jsonPath)
Gets an element as
JsonObject using the
specified JsonPath. |
protected JsonObject |
getJsonObject(String jsonPath,
boolean hasdefaultElement,
JsonObject defaultElement) |
protected JsonObject |
getJsonObject(String jsonPath,
boolean hasdefaultElement,
JsonObject defaultElement,
boolean parseJsonPath) |
JsonObject |
getJsonObject(String jsonPath,
JsonObject defaultElement)
Gets an element as
JsonObject using the
specified JsonPath. |
protected JsonObject |
getJsonObjectFromObject(Object object) |
JsonObject |
getJsonObjectNoKeyParsing(String jsonPath) |
JsonObject |
getJsonObjectNoKeyParsing(String jsonPath,
JsonObject defaultElement) |
JsonObject |
getJsonObjectOrEmpty(String jsonPath)
Gets an element as
JsonObject using the
specified JsonPath. |
JsonObject |
getJsonObjectOrEmpty(String jsonPath,
boolean addIfDoesntExist)
Gets an element as
JsonObject using the
specified JsonPath. |
JsonObject |
getJsonObjectOrEmptyNoKeyParsing(String jsonPath) |
protected Map<String,JsonObjectArrayBase.JsonPathCachingItem> |
getJsonPathCachingMap() |
Long |
getLong(String jsonPath)
Gets an element as
Long using the
specified JsonPath. |
protected Long |
getLong(String jsonPath,
boolean hasdefaultElement,
Long defaultElement,
boolean parseJsonPath) |
Long |
getLong(String jsonPath,
Long defaultElement)
Gets an element as
Long using the
specified JsonPath. |
protected Long |
getLongElement(String jsonPath,
boolean hasdefaultElement,
Long defaultElement) |
protected Long |
getLongFromObject(Object object) |
Long |
getLongNoKeyParsing(String jsonPath) |
Long |
getLongNoKeyParsing(String jsonPath,
Long defaultElement) |
Object |
getObject(String jsonPath)
Gets an untyped Object using the
specified
JsonPath. |
protected Object |
getObject(String jsonPath,
boolean hasdefaultElement,
Object defaultElement,
boolean parseJsonPath) |
Object |
getObject(String jsonPath,
Object defaultElement)
Gets an untyped Object using the
specified
JsonPath. |
protected ObjectConverter |
getObjectConverter() |
Object |
getObjectNoKeyParsing(String jsonPath) |
Object |
getObjectNoKeyParsing(String jsonPath,
Object defaultElement) |
protected SpincastUtils |
getSpincastUtils() |
String |
getString(String jsonPath)
Gets an element as
String using the
specified JsonPath. |
protected String |
getString(String jsonPath,
boolean hasdefaultElement,
String defaultElement) |
protected String |
getString(String jsonPath,
boolean hasdefaultElement,
String defaultElement,
boolean parseJsonPath) |
String |
getString(String jsonPath,
String defaultElement)
Gets an element as
String using the
specified JsonPath. |
protected String |
getStringFromObject(Object object) |
String |
getStringNoKeyParsing(String jsonPath) |
String |
getStringNoKeyParsing(String jsonPath,
String defaultElement) |
protected ElementTransformer |
getTrimTransformer() |
boolean |
isCanBeConvertedToBigDecimal(String jsonPath)
Validates that the value at the specified
JsonPath exists and
is currently null, of type BigDecimal, or can be
converted and retrieved as one. |
protected boolean |
isCanBeConvertedToBigDecimal(String jsonPath,
boolean parseKey) |
boolean |
isCanBeConvertedToBigDecimalNoKeyParsing(String jsonPath) |
boolean |
isCanBeConvertedToBoolean(String jsonPath)
Validates that the value at the specified
JsonPath exists and
is currently null, of type Boolean, or can be
converted and retrieved as one. |
protected boolean |
isCanBeConvertedToBoolean(String jsonPath,
boolean parseKey) |
boolean |
isCanBeConvertedToBooleanNoKeyParsing(String jsonPath) |
boolean |
isCanBeConvertedToByteArray(String jsonPath)
Validates that the value at the specified
JsonPath exists and
is currently null, of type base 64 String representing
a byte array, or can be converted and retrieved as one. |
protected boolean |
isCanBeConvertedToByteArray(String jsonPath,
boolean parseKey) |
boolean |
isCanBeConvertedToByteArrayNoKeyParsing(String jsonPath) |
boolean |
isCanBeConvertedToDate(String jsonPath)
Validates that the value at the specified
JsonPath exists and
is currently null, of type Date, or can be
converted and retrieved as one. |
protected boolean |
isCanBeConvertedToDate(String jsonPath,
boolean parseKey) |
boolean |
isCanBeConvertedToDateNoKeyParsing(String jsonPath) |
boolean |
isCanBeConvertedToDouble(String jsonPath)
Validates that the value at the specified
JsonPath exists and
is currently null, of type Double, or can be
converted and retrieved as one. |
protected boolean |
isCanBeConvertedToDouble(String jsonPath,
boolean parseKey) |
boolean |
isCanBeConvertedToDoubleNoKeyParsing(String jsonPath) |
boolean |
isCanBeConvertedToFloat(String jsonPath)
Validates that the value at the specified
JsonPath exists and
is currently null, of type Float, or can be
converted and retrieved as one. |
protected boolean |
isCanBeConvertedToFloat(String jsonPath,
boolean parseKey) |
boolean |
isCanBeConvertedToFloatNoKeyParsing(String jsonPath) |
boolean |
isCanBeConvertedToInteger(String jsonPath)
Validates that the value at the specified
JsonPath exists and
is currently null, of type Integer, or can be
converted and retrieved as one. |
protected boolean |
isCanBeConvertedToInteger(String jsonPath,
boolean parseKey) |
boolean |
isCanBeConvertedToIntegerNoKeyParsing(String jsonPath) |
boolean |
isCanBeConvertedToJsonArray(String jsonPath)
Validates that the value at the specified
JsonPath exists and
is currently null, of type JsonArray, or can be
converted and retrieved as one. |
protected boolean |
isCanBeConvertedToJsonArray(String jsonPath,
boolean parseKey) |
boolean |
isCanBeConvertedToJsonArrayNoKeyParsing(String jsonPath) |
boolean |
isCanBeConvertedToJsonObject(String jsonPath)
Validates that the value at the specified
JsonPath exists and
is currently null, of type JsonObject, or can be
converted and retrieved as one. |
protected boolean |
isCanBeConvertedToJsonObject(String jsonPath,
boolean parseKey) |
boolean |
isCanBeConvertedToJsonObjectNoKeyParsing(String jsonPath) |
boolean |
isCanBeConvertedToLong(String jsonPath)
Validates that the value at the specified
JsonPath exists and
is currently null, of type Long, or can be
converted and retrieved as one. |
protected boolean |
isCanBeConvertedToLong(String jsonPath,
boolean parseKey) |
boolean |
isCanBeConvertedToLongNoKeyParsing(String jsonPath) |
boolean |
isCanBeConvertedToString(String jsonPath)
Validates that the value at the specified
JsonPath exists and
is currently null, of type String, or can be
converted and retrieved as one. |
protected boolean |
isCanBeConvertedToString(String jsonPath,
boolean parseKey) |
boolean |
isCanBeConvertedToStringNoKeyParsing(String jsonPath) |
boolean |
isElementExists(String jsonPath)
Does the object contain an element at
the
JsonPath position (even if
null)? |
boolean |
isMutable()
Is this object/array mutable?
|
boolean |
isNull(String jsonPath)
Validates that the value at the specified
JsonPath exists and
is null. |
boolean |
isNullNoKeyParsing(String jsonPath) |
boolean |
isOfTypeBigDecimal(String jsonPath)
Validates that the value at the specified
JsonPath exists and
is currently null or of type BigDecimal, without requiring
any conversion. |
boolean |
isOfTypeBigDecimalNoKeyParsing(String jsonPath) |
boolean |
isOfTypeBoolean(String jsonPath)
Validates that the value at the specified
JsonPath exists and
is currently null or of type Boolean, without requiring
any conversion. |
boolean |
isOfTypeBoolean(String jsonPath,
boolean parseKey) |
boolean |
isOfTypeBooleanNoKeyParsing(String jsonPath) |
boolean |
isOfTypeByteArray(String jsonPath,
boolean acceptBase64StringToo)
Validates that the value at the specified
JsonPath exists and
is currently null or of type byte[], without requiring
any conversion. |
boolean |
isOfTypeByteArray(String jsonPath,
boolean acceptBase64StringToo,
boolean parseKey) |
boolean |
isOfTypeByteArrayNoKeyParsing(String jsonPath,
boolean acceptBase64StringToo) |
boolean |
isOfTypeDate(String jsonPath)
Validates that the value at the specified
JsonPath exists and
is currently null or of type Date, without requiring
any conversion. |
boolean |
isOfTypeDate(String jsonPath,
boolean parseKey) |
boolean |
isOfTypeDateNoKeyParsing(String jsonPath) |
boolean |
isOfTypeDouble(String jsonPath)
Validates that the value at the specified
JsonPath exists and
is currently null or of type Double, without requiring
any conversion. |
boolean |
isOfTypeDouble(String jsonPath,
boolean parseKey) |
boolean |
isOfTypeDoubleNoKeyParsing(String jsonPath) |
boolean |
isOfTypeeBigDecimal(String jsonPath,
boolean parseKey) |
boolean |
isOfTypeFloat(String jsonPath)
Validates that the value at the specified
JsonPath exists and
is currently null or of type Float, without requiring
any conversion. |
boolean |
isOfTypeFloat(String jsonPath,
boolean parseKey) |
boolean |
isOfTypeFloatNoKeyParsing(String jsonPath) |
boolean |
isOfTypeInteger(String jsonPath)
Validates that the value at the specified
JsonPath exists and
is currently null or of type Integer, without requiring
any conversion. |
boolean |
isOfTypeInteger(String jsonPath,
boolean parseKey) |
boolean |
isOfTypeIntegerNoKeyParsing(String jsonPath) |
boolean |
isOfTypeJsonArray(String jsonPath)
Validates that the value at the specified
JsonPath exists and
is currently null or of type JsonArray, without requiring
any conversion. |
boolean |
isOfTypeJsonArray(String jsonPath,
boolean parseKey) |
boolean |
isOfTypeJsonArrayNoKeyParsing(String jsonPath) |
boolean |
isOfTypeJsonObject(String jsonPath)
Validates that the value at the specified
JsonPath exists and
is currently null or of type JsonObject, without requiring
any conversion. |
boolean |
isOfTypeJsonObject(String jsonPath,
boolean parseKey) |
boolean |
isOfTypeJsonObjectNoKeyParsing(String jsonPath) |
boolean |
isOfTypeLong(String jsonPath)
Validates that the value at the specified
JsonPath exists and
is currently null or of type Long, without requiring
any conversion. |
boolean |
isOfTypeLong(String jsonPath,
boolean parseKey) |
boolean |
isOfTypeLongNoKeyParsing(String jsonPath) |
boolean |
isOfTypeString(String jsonPath)
Validates that the value at the specified
JsonPath exists and
is currently null or of type String, without requiring
any conversion. |
boolean |
isOfTypeString(String jsonPath,
boolean parseKey) |
boolean |
isOfTypeStringNoKeyParsing(String jsonPath) |
JsonObjectOrArray |
put(String jsonPath,
Object element)
Puts an element at the specified
JsonPath. |
JsonObjectOrArray |
put(String jsonPath,
Object element,
boolean clone)
Puts an element at the specified
JsonPath. |
protected JsonObjectOrArray |
put(String jsonPath,
Object element,
boolean clone,
boolean parseJsonPath) |
protected abstract JsonObjectOrArray |
putAsIs(String key,
Object element) |
String |
toJsonString()
The
Json string representation
of the object. |
String |
toJsonString(boolean pretty)
The
Json string representation
of the object. |
String |
toString() |
void |
transform(String jsonPath,
ElementTransformer transformer)
Transforms the element at the specified
JsonPath using
the transformer. |
void |
transformAll(ElementTransformer transformer)
Transforms all the elements of the object, using the specified
transformer.
|
abstract void |
transformAll(ElementTransformer transformer,
boolean recursive)
Transforms all the elements of the object, using the specified
transformer.
|
void |
trim(String jsonPath)
Trims the element at the specified
JsonPath if
it's of type String. |
void |
trimAll()
Trims all the elements of the object that are of type
String. |
void |
trimAll(boolean recursive)
Trims all the elements of the object that are of type
String.
|
boolean |
validateIsNull(String jsonPath,
boolean parseKey) |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclear, remove, sizeprotected final org.slf4j.Logger logger
protected final Object defaultElementValidator
public JsonObjectArrayBase(boolean mutable,
JsonManager jsonManager,
SpincastUtils spincastUtils,
ObjectConverter objectConverter)
public boolean isMutable()
JsonObjectOrArrayisMutable in interface JsonObjectOrArrayprotected JsonManager getJsonManager()
protected SpincastUtils getSpincastUtils()
protected ObjectConverter getObjectConverter()
protected Object getdefaultElementValidator()
protected Map<String,JsonObjectArrayBase.JsonPathCachingItem> getJsonPathCachingMap()
public Object getObject(String jsonPath)
JsonObjectOrArrayJsonPath.getObject in interface JsonObjectOrArraynull if not found. This object
will necessarily be of a type managed by JsonObjectOrArray, since
an object of any other type is automatically converted when added.public Object getObject(String jsonPath, Object defaultElement)
JsonObjectOrArrayJsonPath.getObject in interface JsonObjectOrArraydefaultElement if not found. This object
will necessarily be of a type managed by JsonObjectOrArray, since
an object of any other type is automatically converted when added.protected Object getObject(String jsonPath, boolean hasdefaultElement, Object defaultElement, boolean parseJsonPath)
public JsonObject getJsonObject(String jsonPath)
JsonObjectOrArrayJsonObject using the
specified JsonPath.getJsonObject in interface JsonObjectOrArraynull if not found.public JsonObject getJsonObjectOrEmpty(String jsonPath)
JsonObjectOrArrayJsonObject using the
specified JsonPath.getJsonObjectOrEmpty in interface JsonObjectOrArrayJsonObject if not found or if null. The empty
JsonObject will not be added to the specified
path.public JsonObject getJsonObjectOrEmpty(String jsonPath, boolean addIfDoesntExist)
JsonObjectOrArrayJsonObject using the
specified JsonPath.getJsonObjectOrEmpty in interface JsonObjectOrArrayaddIfDoesntExist - if true and the element doesn't exist,
the created empty JsonObject will be added to the specified
JsonPath.JsonObject if not found or if null.public JsonObject getJsonObject(String jsonPath, JsonObject defaultElement)
JsonObjectOrArrayJsonObject using the
specified JsonPath.getJsonObject in interface JsonObjectOrArraydefaultElement if not found.protected JsonObject getJsonObject(String jsonPath, boolean hasdefaultElement, JsonObject defaultElement)
public JsonObject getJsonObjectNoKeyParsing(String jsonPath)
public JsonObject getJsonObjectNoKeyParsing(String jsonPath, JsonObject defaultElement)
public JsonObject getJsonObjectOrEmptyNoKeyParsing(String jsonPath)
protected JsonObject getJsonObject(String jsonPath, boolean hasdefaultElement, JsonObject defaultElement, boolean parseJsonPath)
protected JsonObject getJsonObjectFromObject(Object object)
public JsonArray getJsonArray(String jsonPath)
JsonObjectOrArrayJsonArray using the
specified JsonPath.getJsonArray in interface JsonObjectOrArraynull if not found.public JsonArray getJsonArrayOrEmpty(String jsonPath)
JsonObjectOrArrayJsonArray using the
specified JsonPath.getJsonArrayOrEmpty in interface JsonObjectOrArrayJsonArray if not found or if null. The empty
JsonArray will not be added to the specified
path.public JsonArray getJsonArrayOrEmpty(String jsonPath, boolean addIfDoesntExist)
JsonObjectOrArrayJsonArray using the
specified JsonPath.getJsonArrayOrEmpty in interface JsonObjectOrArrayaddIfDoesntExist - if true and the element doesn't exist,
the created empty JsonArray will be added to the specified
JsonPath.JsonArray if not found or if null.public JsonArray getJsonArray(String jsonPath, JsonArray defaultElement)
JsonObjectOrArrayJsonArray using the
specified JsonPath.getJsonArray in interface JsonObjectOrArraydefaultElement if not found.public JsonArray getJsonArrayNoKeyParsing(String jsonPath, JsonArray defaultElement)
protected JsonArray getJsonArray(String jsonPath, boolean hasdefaultElement, JsonArray defaultElement, boolean parseJsonPath)
public String getString(String jsonPath)
JsonObjectOrArrayString using the
specified JsonPath.getString in interface JsonObjectOrArraynull if not found.public String getString(String jsonPath, String defaultElement)
JsonObjectOrArrayString using the
specified JsonPath.getString in interface JsonObjectOrArraydefaultElement if not found.protected String getString(String jsonPath, boolean hasdefaultElement, String defaultElement)
protected String getString(String jsonPath, boolean hasdefaultElement, String defaultElement, boolean parseJsonPath)
public Integer getInteger(String jsonPath)
JsonObjectOrArrayInteger using the
specified JsonPath.getInteger in interface JsonObjectOrArraynull if not found.public Integer getInteger(String jsonPath, Integer defaultElement)
JsonObjectOrArrayInteger using the
specified JsonPath.getInteger in interface JsonObjectOrArraydefaultElement if not found.protected Integer getIntegerElement(String jsonPath, boolean hasdefaultElement, Integer defaultElement)
public Integer getIntegerNoKeyParsing(String jsonPath, Integer defaultElement)
protected Integer getInteger(String jsonPath, boolean hasdefaultElement, Integer defaultElement, boolean parseJsonPath)
public Long getLong(String jsonPath)
JsonObjectOrArrayLong using the
specified JsonPath.getLong in interface JsonObjectOrArraynull if not found.public Long getLong(String jsonPath, Long defaultElement)
JsonObjectOrArrayLong using the
specified JsonPath.getLong in interface JsonObjectOrArraydefaultElement if not found.protected Long getLongElement(String jsonPath, boolean hasdefaultElement, Long defaultElement)
protected Long getLong(String jsonPath, boolean hasdefaultElement, Long defaultElement, boolean parseJsonPath)
public Float getFloat(String jsonPath)
JsonObjectOrArrayFloat using the
specified JsonPath.getFloat in interface JsonObjectOrArraynull if not found.public Float getFloat(String jsonPath, Float defaultElement)
JsonObjectOrArrayFloat using the
specified JsonPath.getFloat in interface JsonObjectOrArraydefaultElement if not found.protected Float getFloatElement(String jsonPath, boolean hasdefaultElement, Float defaultElement)
protected Float getFloat(String jsonPath, boolean hasdefaultElement, Float defaultElement, boolean parseJsonPath)
public Double getDouble(String jsonPath)
JsonObjectOrArrayDouble using the
specified JsonPath.getDouble in interface JsonObjectOrArraynull if not found.public Double getDouble(String jsonPath, Double defaultElement)
JsonObjectOrArrayDouble using the
specified JsonPath.getDouble in interface JsonObjectOrArraydefaultElement if not found.protected Double getDoubleElement(String jsonPath, boolean hasdefaultElement, Double defaultElement)
protected Double getDouble(String jsonPath, boolean hasdefaultElement, Double defaultElement, boolean parseJsonPath)
public Boolean getBoolean(String jsonPath)
JsonObjectOrArrayBoolean using the
specified JsonPath.getBoolean in interface JsonObjectOrArraynull if not found.public Boolean getBoolean(String jsonPath, Boolean defaultElement)
JsonObjectOrArrayBoolean using the
specified JsonPath.getBoolean in interface JsonObjectOrArraydefaultElement if not found.protected Boolean getBooleanElement(String jsonPath, boolean hasdefaultElement, Boolean defaultElement)
public Boolean getBooleanNoKeyParsing(String jsonPath, Boolean defaultElement)
protected Boolean getBoolean(String jsonPath, boolean hasdefaultElement, Boolean defaultElement, boolean parseJsonPath)
public BigDecimal getBigDecimal(String jsonPath)
JsonObjectOrArrayBigDecimal using the
specified JsonPath.getBigDecimal in interface JsonObjectOrArraynull if not found.public BigDecimal getBigDecimal(String jsonPath, BigDecimal defaultElement)
JsonObjectOrArrayBigDecimal using the
specified JsonPath.getBigDecimal in interface JsonObjectOrArraydefaultElement if not found.protected BigDecimal getBigDecimalElement(String jsonPath, boolean hasdefaultElement, BigDecimal defaultElement)
public BigDecimal getBigDecimalNoKeyParsing(String jsonPath)
public BigDecimal getBigDecimalNoKeyParsing(String jsonPath, BigDecimal defaultElement)
protected BigDecimal getBigDecimal(String jsonPath, boolean hasdefaultElement, BigDecimal defaultElement, boolean parseJsonPath)
protected BigDecimal getBigDecimalFromObject(Object object)
public byte[] getBytesFromBase64String(String jsonPath)
JsonObjectOrArrayJsonPath.getBytesFromBase64String in interface JsonObjectOrArraynull if not found.public byte[] getBytesFromBase64String(String jsonPath, byte[] defaultElement)
JsonObjectOrArrayJsonPath.getBytesFromBase64String in interface JsonObjectOrArraydefaultElement if not found.protected byte[] getBytesFromBase64StringElement(String jsonPath, boolean hasdefaultElement, byte[] defaultElement)
public byte[] getBytesFromBase64StringNoKeyParsing(String jsonPath)
public byte[] getBytesFromBase64StringNoKeyParsing(String jsonPath, byte[] defaultElement)
protected byte[] getBytesFromBase64String(String jsonPath, boolean hasdefaultElement, byte[] defaultElement, boolean parseJsonPath)
protected byte[] getBytesFromBase64StringValueFromObject(Object object)
public Date getDate(String jsonPath)
JsonObjectOrArrayISO 8601 date string element using the
specified JsonPath.getDate in interface JsonObjectOrArraynull if not found.public Date getDate(String jsonPath, Date defaultElement)
JsonObjectOrArrayISO 8601 date string element using the
specified JsonPath.getDate in interface JsonObjectOrArraydefaultElement if not found.protected Date getDateElement(String jsonPath, boolean hasdefaultElement, Date defaultElement)
protected Date getDate(String jsonPath, boolean hasdefaultElement, Date defaultElement, boolean parseJsonPath)
public Instant getInstant(String jsonPath) throws CantConvertException
JsonObjectOrArrayISO 8601 date string element using the
specified JsonPath.getInstant in interface JsonObjectOrArraynull if not found.CantConvertException - if an existing element can't be converted to the
required type.public Instant getInstant(String jsonPath, Instant defaultElement) throws CantConvertException
JsonObjectOrArrayISO 8601 date string element using the
specified JsonPath.getInstant in interface JsonObjectOrArraydefaultElement if not found.CantConvertException - if an existing element can't be converted to the
required type.protected Instant getInstantElement(String jsonPath, boolean hasdefaultElement, Instant defaultElement)
public Instant getInstantNoKeyParsing(String jsonPath, Instant defaultElement)
protected Instant getInstant(String jsonPath, boolean hasdefaultElement, Instant defaultElement, boolean parseJsonPath)
protected <T> T getArrayFirst(String jsonPath, boolean parseJsonPath, boolean hasdefaultElement, T defaultElement, JsonObjectDefault.IFirstElementGetter<T> firstElementGetter)
public String getArrayFirstString(String key)
JsonObjectOrArrayJsonArray property
of the object, using the JsonPath to find the array.getArrayFirstString in interface JsonObjectOrArraynull if the array or
the first element are not found.public String getArrayFirstString(String key, String defaultElement)
JsonObjectOrArrayJsonArray property
of the object, using the JsonPath to find the array.getArrayFirstString in interface JsonObjectOrArraydefaultElement if the array or
the first element are not found.public String getArrayFirstStringNoKeyParsing(String key, String defaultElement)
protected String getArrayFirstString(String key, boolean parseJsonPath, boolean hasdefaultElement, String defaultElement)
public String toJsonString()
JsonObjectOrArrayJson string representation
of the object.toJsonString in interface JsonObjectOrArraypublic String toJsonString(boolean pretty)
JsonObjectOrArrayJson string representation
of the object.toJsonString in interface JsonObjectOrArraypretty - if true, the generated String will
be formatted.public JsonObject getArrayFirstJsonObject(String key)
JsonObjectOrArrayJsonArray property
of the object, using the JsonPath to find the array.getArrayFirstJsonObject in interface JsonObjectOrArraynull if the array or
the first element are not found.public JsonObject getArrayFirstJsonObject(String key, JsonObject defaultElement)
JsonObjectOrArrayJsonArray property
of the object, using the JsonPath to find the array.getArrayFirstJsonObject in interface JsonObjectOrArraydefaultElement if the array or
the first element are not found.public JsonObject getArrayFirstJsonObjectNoKeyParsing(String key)
public JsonObject getArrayFirstJsonObjectNoKeyParsing(String key, JsonObject defaultElement)
protected JsonObject getArrayFirstJsonObject(String key, boolean parseJsonPath, boolean hasdefaultElement, JsonObject defaultElement)
public JsonArray getArrayFirstJsonArray(String key)
JsonObjectOrArrayJsonArray property
of the object, using the JsonPath to find the array.getArrayFirstJsonArray in interface JsonObjectOrArraynull if the array or
the first element are not found.public JsonArray getArrayFirstJsonArray(String key, JsonArray defaultElement)
JsonObjectOrArrayJsonArray property
of the object, using the JsonPath to find the array.getArrayFirstJsonArray in interface JsonObjectOrArraydefaultElement if the array or
the first element are not found.public JsonArray getArrayFirstJsonArrayNoKeyParsing(String key, JsonArray defaultElement)
protected JsonArray getArrayFirstJsonArray(String key, boolean parseJsonPath, boolean hasdefaultElement, JsonArray defaultElement)
public Integer getArrayFirstInteger(String key)
JsonObjectOrArrayJsonArray property
of the object, using the JsonPath to find the array.getArrayFirstInteger in interface JsonObjectOrArraynull if the array or
the first element are not found.public Integer getArrayFirstInteger(String key, Integer defaultElement)
JsonObjectOrArrayJsonArray property
of the object, using the JsonPath to find the array.getArrayFirstInteger in interface JsonObjectOrArraydefaultElement if the array or
the first element are not found.public Integer getArrayFirstIntegerNoKeyParsing(String key, Integer defaultElement)
protected Integer getArrayFirstInteger(String key, boolean parseJsonPath, boolean hasdefaultElement, Integer defaultElement)
public Long getArrayFirstLong(String key)
JsonObjectOrArrayJsonArray property
of the object, using the JsonPath to find the array.getArrayFirstLong in interface JsonObjectOrArraynull if the array or
the first element are not found.public Long getArrayFirstLong(String key, Long defaultElement)
JsonObjectOrArrayJsonArray property
of the object, using the JsonPath to find the array.getArrayFirstLong in interface JsonObjectOrArraydefaultElement if the array or
the first element are not found.public Long getArrayFirstLongNoKeyParsing(String key, Long defaultElement)
protected Long getArrayFirstLong(String key, boolean parseJsonPath, boolean hasdefaultElement, Long defaultElement)
public Double getArrayFirstDouble(String key)
JsonObjectOrArrayJsonArray property
of the object, using the JsonPath to find the array.getArrayFirstDouble in interface JsonObjectOrArraynull if the array or
the first element are not found.public Double getArrayFirstDouble(String key, Double defaultElement)
JsonObjectOrArrayJsonArray property
of the object, using the JsonPath to find the array.getArrayFirstDouble in interface JsonObjectOrArraydefaultElement if the array or
the first element are not found.public Double getArrayFirstDoubleNoKeyParsing(String key, Double defaultElement)
protected Double getArrayFirstDouble(String key, boolean parseJsonPath, boolean hasdefaultElement, Double defaultElement)
public Float getArrayFirstFloat(String key)
JsonObjectOrArrayJsonArray property
of the object, using the JsonPath to find the array.getArrayFirstFloat in interface JsonObjectOrArraynull if the array or
the first element are not found.public Float getArrayFirstFloat(String key, Float defaultElement)
JsonObjectOrArrayJsonArray property
of the object, using the JsonPath to find the array.getArrayFirstFloat in interface JsonObjectOrArraydefaultElement if the array or
the first element are not found.public Float getArrayFirstFloatNoKeyParsing(String key, Float defaultElement)
protected Float getArrayFirstFloat(String key, boolean parseJsonPath, boolean hasdefaultElement, Float defaultElement)
public Boolean getArrayFirstBoolean(String key)
JsonObjectOrArrayJsonArray property
of the object, using the JsonPath to find the array.getArrayFirstBoolean in interface JsonObjectOrArraynull if the array or
the first element are not found.public Boolean getArrayFirstBoolean(String key, Boolean defaultElement)
JsonObjectOrArrayJsonArray property
of the object, using the JsonPath to find the array.getArrayFirstBoolean in interface JsonObjectOrArraydefaultElement if the array or
the first element are not found.public Boolean getArrayFirstBooleanNoKeyParsing(String key, Boolean defaultElement)
protected Boolean getArrayFirstBoolean(String key, boolean parseJsonPath, boolean hasdefaultElement, Boolean defaultElement)
public BigDecimal getArrayFirstBigDecimal(String key)
JsonObjectOrArrayJsonArray property
of the object, using the JsonPath to find the array.getArrayFirstBigDecimal in interface JsonObjectOrArraynull if the array or
the first element are not found.public BigDecimal getArrayFirstBigDecimal(String key, BigDecimal defaultElement)
JsonObjectOrArrayJsonArray property
of the object, using the JsonPath to find the array.getArrayFirstBigDecimal in interface JsonObjectOrArraydefaultElement if the array or
the first element are not found.public BigDecimal getArrayFirstBigDecimalNoKeyParsing(String key)
public BigDecimal getArrayFirstBigDecimalNoKeyParsing(String key, BigDecimal defaultElement)
protected BigDecimal getArrayFirstBigDecimal(String key, boolean parseJsonPath, boolean hasdefaultElement, BigDecimal defaultElement)
public byte[] getArrayFirstBytesFromBase64String(String key)
JsonObjectOrArrayJsonArray property
of the object, using the JsonPath to find the array.getArrayFirstBytesFromBase64String in interface JsonObjectOrArraynull if the array or
the first element are not found.public byte[] getArrayFirstBytesFromBase64String(String key, byte[] defaultElement)
JsonObjectOrArrayJsonArray property
of the object, using the JsonPath to find the array.getArrayFirstBytesFromBase64String in interface JsonObjectOrArraydefaultElement if the array or
the first element are not found.public byte[] getArrayFirstBytesFromBase64StringNoKeyParsing(String key)
public byte[] getArrayFirstBytesFromBase64StringNoKeyParsing(String key, byte[] defaultElement)
protected byte[] getArrayFirstBytesFromBase64String(String key, boolean parseJsonPath, boolean hasdefaultElement, byte[] defaultElement)
public Date getArrayFirstDate(String key)
JsonObjectOrArrayJsonArray property
of the object, using the JsonPath to find the array.getArrayFirstDate in interface JsonObjectOrArraynull if the array or
the first element are not found.public Date getArrayFirstDate(String key, Date defaultElement)
JsonObjectOrArrayJsonArray property
of the object, using the JsonPath to find the array.getArrayFirstDate in interface JsonObjectOrArraydefaultElement if the array or
the first element are not found.public Date getArrayFirstDateNoKeyParsing(String key, Date defaultElement)
protected Date getArrayFirstDate(String jsonPath, boolean parseJsonPath, boolean hasdefaultElement, Date defaultElement)
public Instant getArrayFirstInstant(String key)
JsonObjectOrArrayJsonArray property
of the object, using the JsonPath to find the array.getArrayFirstInstant in interface JsonObjectOrArraynull if the array or
the first element are not found.public Instant getArrayFirstInstant(String key, Instant defaultElement)
JsonObjectOrArrayJsonArray property
of the object, using the JsonPath to find the array.getArrayFirstInstant in interface JsonObjectOrArraydefaultElement if the array or
the first element are not found.public Instant getArrayFirstInstantNoKeyParsing(String key, Instant defaultElement)
protected Instant getArrayFirstInstant(String jsonPath, boolean parseJsonPath, boolean hasdefaultElement, Instant defaultElement)
public boolean isCanBeConvertedToString(String jsonPath)
JsonObjectOrArrayJsonPath exists and
is currently null, of type String, or can be
converted and retrieved as one.isCanBeConvertedToString in interface JsonObjectOrArraypublic boolean isCanBeConvertedToStringNoKeyParsing(String jsonPath)
protected boolean isCanBeConvertedToString(String jsonPath, boolean parseKey)
public boolean isCanBeConvertedToInteger(String jsonPath)
JsonObjectOrArrayJsonPath exists and
is currently null, of type Integer, or can be
converted and retrieved as one.isCanBeConvertedToInteger in interface JsonObjectOrArraypublic boolean isCanBeConvertedToIntegerNoKeyParsing(String jsonPath)
protected boolean isCanBeConvertedToInteger(String jsonPath, boolean parseKey)
public boolean isCanBeConvertedToLong(String jsonPath)
JsonObjectOrArrayJsonPath exists and
is currently null, of type Long, or can be
converted and retrieved as one.isCanBeConvertedToLong in interface JsonObjectOrArraypublic boolean isCanBeConvertedToLongNoKeyParsing(String jsonPath)
protected boolean isCanBeConvertedToLong(String jsonPath, boolean parseKey)
public boolean isCanBeConvertedToFloat(String jsonPath)
JsonObjectOrArrayJsonPath exists and
is currently null, of type Float, or can be
converted and retrieved as one.isCanBeConvertedToFloat in interface JsonObjectOrArraypublic boolean isCanBeConvertedToFloatNoKeyParsing(String jsonPath)
protected boolean isCanBeConvertedToFloat(String jsonPath, boolean parseKey)
public boolean isCanBeConvertedToDouble(String jsonPath)
JsonObjectOrArrayJsonPath exists and
is currently null, of type Double, or can be
converted and retrieved as one.isCanBeConvertedToDouble in interface JsonObjectOrArraypublic boolean isCanBeConvertedToDoubleNoKeyParsing(String jsonPath)
protected boolean isCanBeConvertedToDouble(String jsonPath, boolean parseKey)
public boolean isCanBeConvertedToBoolean(String jsonPath)
JsonObjectOrArrayJsonPath exists and
is currently null, of type Boolean, or can be
converted and retrieved as one.isCanBeConvertedToBoolean in interface JsonObjectOrArraypublic boolean isCanBeConvertedToBooleanNoKeyParsing(String jsonPath)
protected boolean isCanBeConvertedToBoolean(String jsonPath, boolean parseKey)
public boolean isCanBeConvertedToBigDecimal(String jsonPath)
JsonObjectOrArrayJsonPath exists and
is currently null, of type BigDecimal, or can be
converted and retrieved as one.isCanBeConvertedToBigDecimal in interface JsonObjectOrArraypublic boolean isCanBeConvertedToBigDecimalNoKeyParsing(String jsonPath)
protected boolean isCanBeConvertedToBigDecimal(String jsonPath, boolean parseKey)
public boolean isCanBeConvertedToByteArray(String jsonPath)
JsonObjectOrArrayJsonPath exists and
is currently null, of type base 64 String representing
a byte array, or can be converted and retrieved as one.isCanBeConvertedToByteArray in interface JsonObjectOrArraypublic boolean isCanBeConvertedToByteArrayNoKeyParsing(String jsonPath)
protected boolean isCanBeConvertedToByteArray(String jsonPath, boolean parseKey)
public boolean isCanBeConvertedToDate(String jsonPath)
JsonObjectOrArrayJsonPath exists and
is currently null, of type Date, or can be
converted and retrieved as one.isCanBeConvertedToDate in interface JsonObjectOrArraypublic boolean isCanBeConvertedToDateNoKeyParsing(String jsonPath)
protected boolean isCanBeConvertedToDate(String jsonPath, boolean parseKey)
public boolean isCanBeConvertedToJsonObject(String jsonPath)
JsonObjectOrArrayJsonPath exists and
is currently null, of type JsonObject, or can be
converted and retrieved as one.isCanBeConvertedToJsonObject in interface JsonObjectOrArraypublic boolean isCanBeConvertedToJsonObjectNoKeyParsing(String jsonPath)
protected boolean isCanBeConvertedToJsonObject(String jsonPath, boolean parseKey)
public boolean isCanBeConvertedToJsonArray(String jsonPath)
JsonObjectOrArrayJsonPath exists and
is currently null, of type JsonArray, or can be
converted and retrieved as one.isCanBeConvertedToJsonArray in interface JsonObjectOrArraypublic boolean isCanBeConvertedToJsonArrayNoKeyParsing(String jsonPath)
protected boolean isCanBeConvertedToJsonArray(String jsonPath, boolean parseKey)
public boolean isOfTypeString(String jsonPath)
JsonObjectOrArrayJsonPath exists and
is currently null or of type String, without requiring
any conversion.isOfTypeString in interface JsonObjectOrArraypublic boolean isOfTypeStringNoKeyParsing(String jsonPath)
public boolean isOfTypeString(String jsonPath, boolean parseKey)
public boolean isOfTypeInteger(String jsonPath)
JsonObjectOrArrayJsonPath exists and
is currently null or of type Integer, without requiring
any conversion.isOfTypeInteger in interface JsonObjectOrArraypublic boolean isOfTypeIntegerNoKeyParsing(String jsonPath)
public boolean isOfTypeInteger(String jsonPath, boolean parseKey)
public boolean isOfTypeLong(String jsonPath)
JsonObjectOrArrayJsonPath exists and
is currently null or of type Long, without requiring
any conversion.isOfTypeLong in interface JsonObjectOrArraypublic boolean isOfTypeLongNoKeyParsing(String jsonPath)
public boolean isOfTypeLong(String jsonPath, boolean parseKey)
public boolean isOfTypeFloat(String jsonPath)
JsonObjectOrArrayJsonPath exists and
is currently null or of type Float, without requiring
any conversion.isOfTypeFloat in interface JsonObjectOrArraypublic boolean isOfTypeFloatNoKeyParsing(String jsonPath)
public boolean isOfTypeFloat(String jsonPath, boolean parseKey)
public boolean isOfTypeDouble(String jsonPath)
JsonObjectOrArrayJsonPath exists and
is currently null or of type Double, without requiring
any conversion.isOfTypeDouble in interface JsonObjectOrArraypublic boolean isOfTypeDoubleNoKeyParsing(String jsonPath)
public boolean isOfTypeDouble(String jsonPath, boolean parseKey)
public boolean isOfTypeBoolean(String jsonPath)
JsonObjectOrArrayJsonPath exists and
is currently null or of type Boolean, without requiring
any conversion.isOfTypeBoolean in interface JsonObjectOrArraypublic boolean isOfTypeBooleanNoKeyParsing(String jsonPath)
public boolean isOfTypeBoolean(String jsonPath, boolean parseKey)
public boolean isOfTypeBigDecimal(String jsonPath)
JsonObjectOrArrayJsonPath exists and
is currently null or of type BigDecimal, without requiring
any conversion.isOfTypeBigDecimal in interface JsonObjectOrArraypublic boolean isOfTypeBigDecimalNoKeyParsing(String jsonPath)
public boolean isOfTypeeBigDecimal(String jsonPath, boolean parseKey)
public boolean isOfTypeByteArray(String jsonPath, boolean acceptBase64StringToo)
JsonObjectOrArrayJsonPath exists and
is currently null or of type byte[], without requiring
any conversion.isOfTypeByteArray in interface JsonObjectOrArrayacceptBase64StringToo - if true, then a valid base 64 String
will also be accepted.public boolean isOfTypeByteArrayNoKeyParsing(String jsonPath, boolean acceptBase64StringToo)
public boolean isOfTypeByteArray(String jsonPath, boolean acceptBase64StringToo, boolean parseKey)
public boolean isOfTypeDate(String jsonPath)
JsonObjectOrArrayJsonPath exists and
is currently null or of type Date, without requiring
any conversion.isOfTypeDate in interface JsonObjectOrArraypublic boolean isOfTypeDateNoKeyParsing(String jsonPath)
public boolean isOfTypeDate(String jsonPath, boolean parseKey)
public boolean isOfTypeJsonObject(String jsonPath)
JsonObjectOrArrayJsonPath exists and
is currently null or of type JsonObject, without requiring
any conversion.isOfTypeJsonObject in interface JsonObjectOrArraypublic boolean isOfTypeJsonObjectNoKeyParsing(String jsonPath)
public boolean isOfTypeJsonObject(String jsonPath, boolean parseKey)
public boolean isOfTypeJsonArray(String jsonPath)
JsonObjectOrArrayJsonPath exists and
is currently null or of type JsonArray, without requiring
any conversion.isOfTypeJsonArray in interface JsonObjectOrArraypublic boolean isOfTypeJsonArrayNoKeyParsing(String jsonPath)
public boolean isOfTypeJsonArray(String jsonPath, boolean parseKey)
public boolean isNull(String jsonPath)
JsonObjectOrArrayJsonPath exists and
is null.isNull in interface JsonObjectOrArraypublic boolean isNullNoKeyParsing(String jsonPath)
public boolean validateIsNull(String jsonPath, boolean parseKey)
public boolean isElementExists(String jsonPath)
JsonObjectOrArrayJsonPath position (even if
null)?isElementExists in interface JsonObjectOrArrayprotected Object getElement(String key, boolean hasdefaultElement, Object defaultElement, boolean parseJsonPath)
protected Object clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionprotected ElementTransformer getTrimTransformer()
public void trim(String jsonPath)
JsonObjectOrArrayJsonPath if
it's of type String.trim in interface JsonObjectOrArraypublic void trimAll()
JsonObjectOrArrayString. This transformation is not recursive.trimAll in interface JsonObjectOrArraypublic void trimAll(boolean recursive)
JsonObjectOrArraytrimAll in interface JsonObjectOrArrayrecursive - if true,
then all children elements will also be trimmed,
recursively.public void transform(String jsonPath, ElementTransformer transformer)
JsonObjectOrArrayJsonPath using
the transformer.transform in interface JsonObjectOrArraypublic void transformAll(ElementTransformer transformer)
JsonObjectOrArraytransformAll in interface JsonObjectOrArraypublic JsonObjectOrArray put(String jsonPath, Object element)
JsonObjectOrArrayJsonPath.
Overwrites any existing element at that JsonPath.
The required hierarchy will be created, if required, to
support the JsonPath.
If the object to add is not of a JsonObject's native type, the object is converted to a JsonObject or a JsonArray before being added. Once the object is converted and added, a modification to the original object won't affect the added element, and vice-versa.
If the element to add is a JsonObject or
a JsonArray and is immutable then
it will be cloned.
Doing so, we can make sure that the current object is always
fully mutable or fully immutable.
If the element implements ToJsonObjectConvertible, it
will be converted to a JsonObject using the associated
conversion method. If it implements ToJsonArrayConvertible, it
will be converted to a JsonArray using the associated
conversion method.
Those are the types of object that will be converted to a JsonArray instead of a JsonObject, if no conversion interface is implemented :
put in interface JsonObjectOrArraypublic JsonObjectOrArray put(String jsonPath, Object element, boolean clone)
JsonObjectOrArrayJsonPath.
Overwrites any existing element at that JsonPath.
The required hierarchy will be created, if required, to
support the JsonPath.
If the object to add is not of a JsonObject's native type, the object is converted to a JsonObject or a JsonArray before being added. Once the object is converted and added, a modification to the original object won't affect the added element, and vice-versa.
If the element to add is a JsonObject or
a JsonArray and is immutable then
it will be cloned.
Doing so, we can make sure that the current object is always
fully mutable or fully immutable.
If the element implements ToJsonObjectConvertible, it
will be converted to a JsonObject using the associated
conversion method. If it implements ToJsonArrayConvertible, it
will be converted to a JsonArray using the associated
conversion method.
Those are the types of object that will be converted to a JsonArray instead of a JsonObject, if no conversion interface is implemented :
put in interface JsonObjectOrArrayclone - if true, and the element to add is a
JsonObject or JsonArray, a clone will be made
before being added. If that case, any modification to the
original element won't affect the added one,
and vice-versa. If the element is immutable then it will
always be cloned. Doing so, we can make sure the current object is always
fully mutable or fully immutable.protected JsonObjectOrArray put(String jsonPath, Object element, boolean clone, boolean parseJsonPath)
protected abstract JsonObjectOrArray putAsIs(String key, Object element)
public abstract void transformAll(ElementTransformer transformer, boolean recursive)
JsonObjectOrArraytransformAll in interface JsonObjectOrArrayrecursive - if true,
then all children elements will also be transformed,
recursively.public abstract JsonObjectOrArray clone(boolean mutable)
clone in interface JsonObjectOrArraymutable - if true the resulting
object and all its children will be mutable, otherwise
they will all be immutable.Copyright © 2018. All rights reserved.