Class JsonObjectArrayBase
- All Implemented Interfaces:
JsonObjectOrArray
- Direct Known Subclasses:
JsonArrayDefault,JsonObjectDefault
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJsonObjectArrayBase(boolean mutable, JsonManager jsonManager, SpincastUtils spincastUtils, ObjectConverter objectConverter) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected Objectclone()abstract JsonObjectOrArrayclone(boolean mutable) Clone the object.booleanDoes the object contain an element at theJsonPathposition (even ifnull)?protected <T> TgetArrayFirst(String jsonPath, boolean parseJsonPath, boolean hasdefaultElement, T defaultElement, JsonObjectDefault.IFirstElementGetter<T> firstElementGetter) Gets the first value (as BigDecimal) of aJsonArrayproperty of the object, using theJsonPathto find the array.protected BigDecimalgetArrayFirstBigDecimal(String key, boolean parseJsonPath, boolean hasdefaultElement, BigDecimal defaultElement) getArrayFirstBigDecimal(String key, BigDecimal defaultElement) Gets the first value (as BigDecimal) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstBigDecimalNoKeyParsing(String key, BigDecimal defaultElement) Gets the first value (as Boolean) of aJsonArrayproperty of the object, using theJsonPathto find the array.protected BooleangetArrayFirstBoolean(String key, boolean parseJsonPath, boolean hasdefaultElement, Boolean defaultElement) getArrayFirstBoolean(String key, Boolean defaultElement) Gets the first value (as Boolean) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstBooleanNoKeyParsing(String key, Boolean defaultElement) byte[]Gets the first value (as byte[]) of aJsonArrayproperty of the object, using theJsonPathto 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 aJsonArrayproperty of the object, using theJsonPathto find the array.byte[]byte[]getArrayFirstBytesFromBase64StringNoKeyParsing(String key, byte[] defaultElement) getArrayFirstDate(String key) Gets the first value (as Date) of aJsonArrayproperty of the object, using theJsonPathto find the array.protected DategetArrayFirstDate(String jsonPath, boolean parseJsonPath, boolean hasdefaultElement, Date defaultElement) getArrayFirstDate(String key, Date defaultElement) Gets the first value (as Date) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstDateNoKeyParsing(String key, Date defaultElement) Gets the first value (as Double) of aJsonArrayproperty of the object, using theJsonPathto find the array.protected DoublegetArrayFirstDouble(String key, boolean parseJsonPath, boolean hasdefaultElement, Double defaultElement) getArrayFirstDouble(String key, Double defaultElement) Gets the first value (as Double) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstDoubleNoKeyParsing(String key, Double defaultElement) getArrayFirstFloat(String key) Gets the first value (as Float) of aJsonArrayproperty of the object, using theJsonPathto find the array.protected FloatgetArrayFirstFloat(String key, boolean parseJsonPath, boolean hasdefaultElement, Float defaultElement) getArrayFirstFloat(String key, Float defaultElement) Gets the first value (as Float) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstFloatNoKeyParsing(String key, Float defaultElement) Gets the first value (as Instant) of aJsonArrayproperty of the object, using theJsonPathto find the array.protected InstantgetArrayFirstInstant(String jsonPath, boolean parseJsonPath, boolean hasdefaultElement, Instant defaultElement) getArrayFirstInstant(String key, Instant defaultElement) Gets the first value (as Instant) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstInstantNoKeyParsing(String key, Instant defaultElement) Gets the first value (as Integer) of aJsonArrayproperty of the object, using theJsonPathto find the array.protected IntegergetArrayFirstInteger(String key, boolean parseJsonPath, boolean hasdefaultElement, Integer defaultElement) getArrayFirstInteger(String key, Integer defaultElement) Gets the first value (as Integer) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstIntegerNoKeyParsing(String key, Integer defaultElement) Gets the first value (as JsonArray) of aJsonArrayproperty of the object, using theJsonPathto find the array.protected JsonArraygetArrayFirstJsonArray(String key, boolean parseJsonPath, boolean hasdefaultElement, JsonArray defaultElement) getArrayFirstJsonArray(String key, JsonArray defaultElement) Gets the first value (as JsonArray) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstJsonArrayNoKeyParsing(String key, JsonArray defaultElement) Gets the first value (as JsonObject) of aJsonArrayproperty of the object, using theJsonPathto find the array.protected JsonObjectgetArrayFirstJsonObject(String key, boolean parseJsonPath, boolean hasdefaultElement, JsonObject defaultElement) getArrayFirstJsonObject(String key, JsonObject defaultElement) Gets the first value (as JsonObject) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstJsonObjectNoKeyParsing(String key, JsonObject defaultElement) getArrayFirstLong(String key) Gets the first value (as Long) of aJsonArrayproperty of the object, using theJsonPathto find the array.protected LonggetArrayFirstLong(String key, boolean parseJsonPath, boolean hasdefaultElement, Long defaultElement) getArrayFirstLong(String key, Long defaultElement) Gets the first value (as Long) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstLongNoKeyParsing(String key, Long defaultElement) Gets the first value (as String) of aJsonArrayproperty of the object, using theJsonPathto find the array.protected StringgetArrayFirstString(String key, boolean parseJsonPath, boolean hasdefaultElement, String defaultElement) getArrayFirstString(String key, String defaultElement) Gets the first value (as String) of aJsonArrayproperty of the object, using theJsonPathto find the array.getArrayFirstStringNoKeyParsing(String key, String defaultElement) getBigDecimal(String jsonPath) Gets an element asBigDecimalusing the specifiedJsonPath.protected BigDecimalgetBigDecimal(String jsonPath, boolean hasdefaultElement, BigDecimal defaultElement, boolean parseJsonPath) getBigDecimal(String jsonPath, BigDecimal defaultElement) Gets an element asBigDecimalusing the specifiedJsonPath.protected BigDecimalgetBigDecimalElement(String jsonPath, boolean hasdefaultElement, BigDecimal defaultElement) protected BigDecimalgetBigDecimalFromObject(Object object) getBigDecimalNoKeyParsing(String jsonPath) getBigDecimalNoKeyParsing(String jsonPath, BigDecimal defaultElement) getBoolean(String jsonPath) Gets an element asBooleanusing the specifiedJsonPath.protected BooleangetBoolean(String jsonPath, boolean hasdefaultElement, Boolean defaultElement, boolean parseJsonPath) getBoolean(String jsonPath, Boolean defaultElement) Gets an element asBooleanusing the specifiedJsonPath.protected BooleangetBooleanElement(String jsonPath, boolean hasdefaultElement, Boolean defaultElement) protected BooleangetBooleanFromObject(Object object) getBooleanNoKeyParsing(String jsonPath) getBooleanNoKeyParsing(String jsonPath, Boolean defaultElement) byte[]getBytesFromBase64String(String jsonPath) Gets a byte array, from a base 64 encoded element using the specifiedJsonPath.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 specifiedJsonPath.protected byte[]getBytesFromBase64StringElement(String jsonPath, boolean hasdefaultElement, byte[] defaultElement) byte[]getBytesFromBase64StringNoKeyParsing(String jsonPath) byte[]getBytesFromBase64StringNoKeyParsing(String jsonPath, byte[] defaultElement) protected byte[]Gets a UTC timezoned date from aISO 8601date string element using the specifiedJsonPath.protected DateGets a UTC timezoned date from aISO 8601date string element using the specifiedJsonPath.protected DategetDateElement(String jsonPath, boolean hasdefaultElement, Date defaultElement) protected DategetDateFromObject(Object object) getDateNoKeyParsing(String jsonPath) getDateNoKeyParsing(String jsonPath, Date defaultElement) protected ObjectGets an element asDoubleusing the specifiedJsonPath.protected DoubleGets an element asDoubleusing the specifiedJsonPath.protected DoublegetDoubleElement(String jsonPath, boolean hasdefaultElement, Double defaultElement) protected DoublegetDoubleFromObject(Object object) getDoubleNoKeyParsing(String jsonPath) getDoubleNoKeyParsing(String jsonPath, Double defaultElement) protected ObjectgetElement(String key, boolean hasdefaultElement, Object defaultElement, boolean parseJsonPath) Gets the element at this key/jsonPath/index.protected abstract ObjectgetElementNoKeyParsing(String key, boolean hasdefaultElement, Object defaultElement) Gets the element at this key/index, without key parsing.Gets an element asFloatusing the specifiedJsonPath.protected FloatGets an element asFloatusing the specifiedJsonPath.protected FloatgetFloatElement(String jsonPath, boolean hasdefaultElement, Float defaultElement) protected FloatgetFloatFromObject(Object object) getFloatNoKeyParsing(String jsonPath) getFloatNoKeyParsing(String jsonPath, Float defaultElement) getInstant(String jsonPath) Gets an Instant from aISO 8601date string element using the specifiedJsonPath.protected InstantgetInstant(String jsonPath, boolean hasdefaultElement, Instant defaultElement, boolean parseJsonPath) getInstant(String jsonPath, Instant defaultElement) Gets an Instant from aISO 8601date string element using the specifiedJsonPath.protected InstantgetInstantElement(String jsonPath, boolean hasdefaultElement, Instant defaultElement) protected InstantgetInstantFromObject(Object object) getInstantNoKeyParsing(String jsonPath) getInstantNoKeyParsing(String jsonPath, Instant defaultElement) getInteger(String jsonPath) Gets an element asIntegerusing the specifiedJsonPath.protected IntegergetInteger(String jsonPath, boolean hasdefaultElement, Integer defaultElement, boolean parseJsonPath) getInteger(String jsonPath, Integer defaultElement) Gets an element asIntegerusing the specifiedJsonPath.protected IntegergetIntegerElement(String jsonPath, boolean hasdefaultElement, Integer defaultElement) protected IntegergetIntegerFromObject(Object object) getIntegerNoKeyParsing(String jsonPath) getIntegerNoKeyParsing(String jsonPath, Integer defaultElement) getJsonArray(String jsonPath) Gets an element asJsonArrayusing the specifiedJsonPath.protected JsonArraygetJsonArray(String jsonPath, boolean hasdefaultElement, JsonArray defaultElement, boolean parseJsonPath) getJsonArray(String jsonPath, JsonArray defaultElement) Gets an element asJsonArrayusing the specifiedJsonPath.protected JsonArraygetJsonArrayFromObject(Object object) getJsonArrayNoKeyParsing(String jsonPath) getJsonArrayNoKeyParsing(String jsonPath, JsonArray defaultElement) getJsonArrayOrEmpty(String jsonPath) Gets an element asJsonArrayusing the specifiedJsonPath.getJsonArrayOrEmpty(String jsonPath, boolean addIfDoesntExist) Gets an element asJsonArrayusing the specifiedJsonPath.getJsonArrayOrEmptyNoKeyParsing(String jsonPath) protected JsonManagergetJsonObject(String jsonPath) Gets an element asJsonObjectusing the specifiedJsonPath.protected JsonObjectgetJsonObject(String jsonPath, boolean hasdefaultElement, JsonObject defaultElement) protected JsonObjectgetJsonObject(String jsonPath, boolean hasdefaultElement, JsonObject defaultElement, boolean parseJsonPath) getJsonObject(String jsonPath, JsonObject defaultElement) Gets an element asJsonObjectusing the specifiedJsonPath.protected JsonObjectgetJsonObjectFromObject(Object object) getJsonObjectNoKeyParsing(String jsonPath) getJsonObjectNoKeyParsing(String jsonPath, JsonObject defaultElement) getJsonObjectOrEmpty(String jsonPath) Gets an element asJsonObjectusing the specifiedJsonPath.getJsonObjectOrEmpty(String jsonPath, boolean addIfDoesntExist) Gets an element asJsonObjectusing the specifiedJsonPath.getJsonObjectOrEmptyNoKeyParsing(String jsonPath) protected Map<String,JsonObjectArrayBase.JsonPathCachingItem> Gets an element asLongusing the specifiedJsonPath.protected LongGets an element asLongusing the specifiedJsonPath.protected LonggetLongElement(String jsonPath, boolean hasdefaultElement, Long defaultElement) protected LonggetLongFromObject(Object object) getLongNoKeyParsing(String jsonPath) getLongNoKeyParsing(String jsonPath, Long defaultElement) Gets an untyped Object using the specifiedJsonPath.protected ObjectGets an untyped Object using the specifiedJsonPath.protected ObjectConvertergetObjectNoKeyParsing(String jsonPath) getObjectNoKeyParsing(String jsonPath, Object defaultElement) protected SpincastUtilsGets an element asStringusing the specifiedJsonPath.protected Stringprotected StringGets an element asStringusing the specifiedJsonPath.protected StringgetStringFromObject(Object object) getStringNoKeyParsing(String jsonPath) getStringNoKeyParsing(String jsonPath, String defaultElement) protected ElementTransformerbooleanisCanBeConvertedToBigDecimal(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynull, of typeBigDecimal, or can be converted and retrieved as one.protected booleanisCanBeConvertedToBigDecimal(String jsonPath, boolean parseKey) booleanbooleanisCanBeConvertedToBoolean(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynull, of typeBoolean, or can be converted and retrieved as one.protected booleanisCanBeConvertedToBoolean(String jsonPath, boolean parseKey) booleanisCanBeConvertedToBooleanNoKeyParsing(String jsonPath) booleanisCanBeConvertedToByteArray(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynull, of typebase 64 Stringrepresenting a byte array, or can be converted and retrieved as one.protected booleanisCanBeConvertedToByteArray(String jsonPath, boolean parseKey) booleanbooleanisCanBeConvertedToDate(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynull, of typeDate, or can be converted and retrieved as one.protected booleanisCanBeConvertedToDate(String jsonPath, boolean parseKey) booleanisCanBeConvertedToDateNoKeyParsing(String jsonPath) booleanisCanBeConvertedToDouble(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynull, of typeDouble, or can be converted and retrieved as one.protected booleanisCanBeConvertedToDouble(String jsonPath, boolean parseKey) booleanisCanBeConvertedToDoubleNoKeyParsing(String jsonPath) booleanisCanBeConvertedToFloat(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynull, of typeFloat, or can be converted and retrieved as one.protected booleanisCanBeConvertedToFloat(String jsonPath, boolean parseKey) booleanisCanBeConvertedToFloatNoKeyParsing(String jsonPath) booleanisCanBeConvertedToInteger(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynull, of typeInteger, or can be converted and retrieved as one.protected booleanisCanBeConvertedToInteger(String jsonPath, boolean parseKey) booleanisCanBeConvertedToIntegerNoKeyParsing(String jsonPath) booleanisCanBeConvertedToJsonArray(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynull, of typeJsonArray, or can be converted and retrieved as one.protected booleanisCanBeConvertedToJsonArray(String jsonPath, boolean parseKey) booleanbooleanisCanBeConvertedToJsonObject(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynull, of typeJsonObject, or can be converted and retrieved as one.protected booleanisCanBeConvertedToJsonObject(String jsonPath, boolean parseKey) booleanbooleanisCanBeConvertedToLong(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynull, of typeLong, or can be converted and retrieved as one.protected booleanisCanBeConvertedToLong(String jsonPath, boolean parseKey) booleanisCanBeConvertedToLongNoKeyParsing(String jsonPath) booleanisCanBeConvertedToString(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynull, of typeString, or can be converted and retrieved as one.protected booleanisCanBeConvertedToString(String jsonPath, boolean parseKey) booleanisCanBeConvertedToStringNoKeyParsing(String jsonPath) booleanIs this object/array mutable?booleanValidates that the value at the specifiedJsonPathexists and isnull.booleanisNullNoKeyParsing(String jsonPath) booleanisOfTypeBigDecimal(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynullor of typeBigDecimal, without requiring any conversion.booleanisOfTypeBigDecimalNoKeyParsing(String jsonPath) booleanisOfTypeBoolean(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynullor of typeBoolean, without requiring any conversion.booleanisOfTypeBoolean(String jsonPath, boolean parseKey) booleanisOfTypeBooleanNoKeyParsing(String jsonPath) booleanisOfTypeByteArray(String jsonPath, boolean acceptBase64StringToo) Validates that the value at the specifiedJsonPathexists and is currentlynullor of typebyte[], without requiring any conversion.booleanisOfTypeByteArray(String jsonPath, boolean acceptBase64StringToo, boolean parseKey) booleanisOfTypeByteArrayNoKeyParsing(String jsonPath, boolean acceptBase64StringToo) booleanisOfTypeDate(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynullor of typeDate, without requiring any conversion.booleanisOfTypeDate(String jsonPath, boolean parseKey) booleanisOfTypeDateNoKeyParsing(String jsonPath) booleanisOfTypeDouble(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynullor of typeDouble, without requiring any conversion.booleanisOfTypeDouble(String jsonPath, boolean parseKey) booleanisOfTypeDoubleNoKeyParsing(String jsonPath) booleanisOfTypeeBigDecimal(String jsonPath, boolean parseKey) booleanisOfTypeFloat(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynullor of typeFloat, without requiring any conversion.booleanisOfTypeFloat(String jsonPath, boolean parseKey) booleanisOfTypeFloatNoKeyParsing(String jsonPath) booleanisOfTypeInteger(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynullor of typeInteger, without requiring any conversion.booleanisOfTypeInteger(String jsonPath, boolean parseKey) booleanisOfTypeIntegerNoKeyParsing(String jsonPath) booleanisOfTypeJsonArray(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynullor of typeJsonArray, without requiring any conversion.booleanisOfTypeJsonArray(String jsonPath, boolean parseKey) booleanisOfTypeJsonArrayNoKeyParsing(String jsonPath) booleanisOfTypeJsonObject(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynullor of typeJsonObject, without requiring any conversion.booleanisOfTypeJsonObject(String jsonPath, boolean parseKey) booleanisOfTypeJsonObjectNoKeyParsing(String jsonPath) booleanisOfTypeLong(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynullor of typeLong, without requiring any conversion.booleanisOfTypeLong(String jsonPath, boolean parseKey) booleanisOfTypeLongNoKeyParsing(String jsonPath) booleanisOfTypeString(String jsonPath) Validates that the value at the specifiedJsonPathexists and is currentlynullor of typeString, without requiring any conversion.booleanisOfTypeString(String jsonPath, boolean parseKey) booleanisOfTypeStringNoKeyParsing(String jsonPath) booleanDoes the object contain an element at theJsonPathposition (even ifnull)?protected JsonObjectOrArrayprotected abstract JsonObjectOrArraySets an element at the specifiedJsonPath.Sets an element at the specifiedJsonPath.setIfAbsent(String jsonPath, Object element) Sets an element at the specifiedJsonPathif no element exists at this path.setIfAbsent(String jsonPath, Object element, boolean clone) Sets an element at the specifiedJsonPathif no element exists at this path.TheJsonstring representation of the object.toJsonString(boolean pretty) TheJsonstring representation of the object.toString()voidtransform(String jsonPath, ElementTransformer transformer) Transforms the element at the specifiedJsonPathusing the transformer.voidtransformAll(ElementTransformer transformer) Transforms all the elements of the object, using the specified transformer.abstract voidtransformAll(ElementTransformer transformer, boolean recursive) Transforms all the elements of the object, using the specified transformer.voidTrims the element at the specifiedJsonPathif it's of typeString.voidtrimAll()Trims all the elements of the object that are of typeString.voidtrimAll(boolean recursive) Trims all the elements of the object that are of type String.booleanvalidateIsNull(String jsonPath, boolean parseKey) Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.spincast.core.json.JsonObjectOrArray
clear, remove, size
-
Field Details
-
logger
protected static final org.slf4j.Logger logger -
defaultElementValidator
-
-
Constructor Details
-
JsonObjectArrayBase
public JsonObjectArrayBase(boolean mutable, JsonManager jsonManager, SpincastUtils spincastUtils, ObjectConverter objectConverter) Constructor
-
-
Method Details
-
isMutable
public boolean isMutable()Description copied from interface:JsonObjectOrArrayIs this object/array mutable?- Specified by:
isMutablein interfaceJsonObjectOrArray
-
getJsonManager
-
getSpincastUtils
-
getObjectConverter
-
getdefaultElementValidator
-
getJsonPathCachingMap
-
getObject
Description copied from interface:JsonObjectOrArrayGets an untyped Object using the specifiedJsonPath.- Specified by:
getObjectin interfaceJsonObjectOrArray- Returns:
- the object or
nullif not found. This object will necessarily be of a type managed byJsonObjectOrArray, since an object of any other type is automatically converted when added.
-
getObject
Description copied from interface:JsonObjectOrArrayGets an untyped Object using the specifiedJsonPath.- Specified by:
getObjectin interfaceJsonObjectOrArray- Returns:
- the object or the specified
defaultElementif not found. This object will necessarily be of a type managed byJsonObjectOrArray, since an object of any other type is automatically converted when added.
-
getObjectNoKeyParsing
-
getObjectNoKeyParsing
-
getObject
-
getJsonObject
Description copied from interface:JsonObjectOrArrayGets an element asJsonObjectusing the specifiedJsonPath.- Specified by:
getJsonObjectin interfaceJsonObjectOrArray- Returns:
- the object or
nullif not found.
-
getJsonObjectOrEmpty
Description copied from interface:JsonObjectOrArrayGets an element asJsonObjectusing the specifiedJsonPath.- Specified by:
getJsonObjectOrEmptyin interfaceJsonObjectOrArray- Returns:
- the element or an empty
JsonObjectif not found or ifnull. The emptyJsonObjectwill not be added to the specified path.
-
getJsonObjectOrEmpty
Description copied from interface:JsonObjectOrArrayGets an element asJsonObjectusing the specifiedJsonPath.- Specified by:
getJsonObjectOrEmptyin interfaceJsonObjectOrArrayaddIfDoesntExist- iftrueand the element doesn't exist, the created emptyJsonObjectwill be added to the specifiedJsonPath.- Returns:
- the element or an empty
JsonObjectif not found or ifnull.
-
getJsonObject
Description copied from interface:JsonObjectOrArrayGets an element asJsonObjectusing the specifiedJsonPath.- Specified by:
getJsonObjectin interfaceJsonObjectOrArray- Returns:
- the object or the specified
defaultElementif not found.
-
getJsonObject
protected JsonObject getJsonObject(String jsonPath, boolean hasdefaultElement, JsonObject defaultElement) -
getJsonObjectNoKeyParsing
-
getJsonObjectNoKeyParsing
-
getJsonObjectOrEmptyNoKeyParsing
-
getJsonObject
protected JsonObject getJsonObject(String jsonPath, boolean hasdefaultElement, JsonObject defaultElement, boolean parseJsonPath) -
getJsonObjectFromObject
-
getJsonArray
Description copied from interface:JsonObjectOrArrayGets an element asJsonArrayusing the specifiedJsonPath.- Specified by:
getJsonArrayin interfaceJsonObjectOrArray- Returns:
- the object or
nullif not found.
-
getJsonArrayOrEmpty
Description copied from interface:JsonObjectOrArrayGets an element asJsonArrayusing the specifiedJsonPath.- Specified by:
getJsonArrayOrEmptyin interfaceJsonObjectOrArray- Returns:
- the element or an empty
JsonArrayif not found or ifnull. The emptyJsonArraywill not be added to the specified path.
-
getJsonArrayOrEmpty
Description copied from interface:JsonObjectOrArrayGets an element asJsonArrayusing the specifiedJsonPath.- Specified by:
getJsonArrayOrEmptyin interfaceJsonObjectOrArrayaddIfDoesntExist- iftrueand the element doesn't exist, the created emptyJsonArraywill be added to the specifiedJsonPath.- Returns:
- the element or an empty
JsonArrayif not found or ifnull.
-
getJsonArray
Description copied from interface:JsonObjectOrArrayGets an element asJsonArrayusing the specifiedJsonPath.- Specified by:
getJsonArrayin interfaceJsonObjectOrArray- Returns:
- the object or the specified
defaultElementif not found.
-
getJsonArrayNoKeyParsing
-
getJsonArrayNoKeyParsing
-
getJsonArrayOrEmptyNoKeyParsing
-
getJsonArray
-
getJsonArrayFromObject
-
getString
Description copied from interface:JsonObjectOrArrayGets an element asStringusing the specifiedJsonPath.- Specified by:
getStringin interfaceJsonObjectOrArray- Returns:
- the element or
nullif not found.
-
getString
Description copied from interface:JsonObjectOrArrayGets an element asStringusing the specifiedJsonPath.- Specified by:
getStringin interfaceJsonObjectOrArray- Returns:
- the element or the specified
defaultElementif not found.
-
getString
-
getStringNoKeyParsing
-
getStringNoKeyParsing
-
getString
-
getStringFromObject
-
getInteger
Description copied from interface:JsonObjectOrArrayGets an element asIntegerusing the specifiedJsonPath.- Specified by:
getIntegerin interfaceJsonObjectOrArray- Returns:
- the element or
nullif not found.
-
getInteger
Description copied from interface:JsonObjectOrArrayGets an element asIntegerusing the specifiedJsonPath.- Specified by:
getIntegerin interfaceJsonObjectOrArray- Returns:
- the element or the specified
defaultElementif not found.
-
getIntegerElement
-
getIntegerNoKeyParsing
-
getIntegerNoKeyParsing
-
getInteger
-
getIntegerFromObject
-
getLong
Description copied from interface:JsonObjectOrArrayGets an element asLongusing the specifiedJsonPath.- Specified by:
getLongin interfaceJsonObjectOrArray- Returns:
- the element or
nullif not found.
-
getLong
Description copied from interface:JsonObjectOrArrayGets an element asLongusing the specifiedJsonPath.- Specified by:
getLongin interfaceJsonObjectOrArray- Returns:
- the element or the specified
defaultElementif not found.
-
getLongElement
-
getLongNoKeyParsing
-
getLongNoKeyParsing
-
getLong
-
getLongFromObject
-
getFloat
Description copied from interface:JsonObjectOrArrayGets an element asFloatusing the specifiedJsonPath.- Specified by:
getFloatin interfaceJsonObjectOrArray- Returns:
- the element or
nullif not found.
-
getFloat
Description copied from interface:JsonObjectOrArrayGets an element asFloatusing the specifiedJsonPath.- Specified by:
getFloatin interfaceJsonObjectOrArray- Returns:
- the element or the specified
defaultElementif not found.
-
getFloatElement
-
getFloatNoKeyParsing
-
getFloatNoKeyParsing
-
getFloat
-
getFloatFromObject
-
getDouble
Description copied from interface:JsonObjectOrArrayGets an element asDoubleusing the specifiedJsonPath.- Specified by:
getDoublein interfaceJsonObjectOrArray- Returns:
- the element or
nullif not found.
-
getDouble
Description copied from interface:JsonObjectOrArrayGets an element asDoubleusing the specifiedJsonPath.- Specified by:
getDoublein interfaceJsonObjectOrArray- Returns:
- the element or the specified
defaultElementif not found.
-
getDoubleElement
-
getDoubleNoKeyParsing
-
getDoubleNoKeyParsing
-
getDouble
-
getDoubleFromObject
-
getBoolean
Description copied from interface:JsonObjectOrArrayGets an element asBooleanusing the specifiedJsonPath.- Specified by:
getBooleanin interfaceJsonObjectOrArray- Returns:
- the element or
nullif not found.
-
getBoolean
Description copied from interface:JsonObjectOrArrayGets an element asBooleanusing the specifiedJsonPath.- Specified by:
getBooleanin interfaceJsonObjectOrArray- Returns:
- the element or the specified
defaultElementif not found.
-
getBooleanElement
-
getBooleanNoKeyParsing
-
getBooleanNoKeyParsing
-
getBoolean
-
getBooleanFromObject
-
getBigDecimal
Description copied from interface:JsonObjectOrArrayGets an element asBigDecimalusing the specifiedJsonPath.- Specified by:
getBigDecimalin interfaceJsonObjectOrArray- Returns:
- the element or
nullif not found.
-
getBigDecimal
Description copied from interface:JsonObjectOrArrayGets an element asBigDecimalusing the specifiedJsonPath.- Specified by:
getBigDecimalin interfaceJsonObjectOrArray- Returns:
- the element or the specified
defaultElementif not found.
-
getBigDecimalElement
protected BigDecimal getBigDecimalElement(String jsonPath, boolean hasdefaultElement, BigDecimal defaultElement) -
getBigDecimalNoKeyParsing
-
getBigDecimalNoKeyParsing
-
getBigDecimal
protected BigDecimal getBigDecimal(String jsonPath, boolean hasdefaultElement, BigDecimal defaultElement, boolean parseJsonPath) -
getBigDecimalFromObject
-
getBytesFromBase64String
Description copied from interface:JsonObjectOrArrayGets a byte array, from a base 64 encoded element using the specifiedJsonPath.- Specified by:
getBytesFromBase64Stringin interfaceJsonObjectOrArray- Returns:
- the element or
nullif not found.
-
getBytesFromBase64String
Description copied from interface:JsonObjectOrArrayGets a byte array, from a base 64 encoded element using the specifiedJsonPath.- Specified by:
getBytesFromBase64Stringin interfaceJsonObjectOrArray- Returns:
- the element or the specified
defaultElementif not found.
-
getBytesFromBase64StringElement
protected byte[] getBytesFromBase64StringElement(String jsonPath, boolean hasdefaultElement, byte[] defaultElement) -
getBytesFromBase64StringNoKeyParsing
-
getBytesFromBase64StringNoKeyParsing
-
getBytesFromBase64String
protected byte[] getBytesFromBase64String(String jsonPath, boolean hasdefaultElement, byte[] defaultElement, boolean parseJsonPath) -
getBytesFromBase64StringValueFromObject
-
getDate
Description copied from interface:JsonObjectOrArrayGets a UTC timezoned date from aISO 8601date string element using the specifiedJsonPath.- Specified by:
getDatein interfaceJsonObjectOrArray- Returns:
- the element or
nullif not found.
-
getDate
Description copied from interface:JsonObjectOrArrayGets a UTC timezoned date from aISO 8601date string element using the specifiedJsonPath.- Specified by:
getDatein interfaceJsonObjectOrArray- Returns:
- the element or the specified
defaultElementif not found.
-
getDateElement
-
getDateFromObject
-
getDateNoKeyParsing
-
getDateNoKeyParsing
-
getDate
-
getInstant
Description copied from interface:JsonObjectOrArrayGets an Instant from aISO 8601date string element using the specifiedJsonPath.- Specified by:
getInstantin interfaceJsonObjectOrArray- Returns:
- the element or
nullif not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getInstant
Description copied from interface:JsonObjectOrArrayGets an Instant from aISO 8601date string element using the specifiedJsonPath.- Specified by:
getInstantin interfaceJsonObjectOrArray- Returns:
- the element or the specified
defaultElementif not found. - Throws:
CantConvertException- if an existing element can't be converted to the required type.
-
getInstantElement
-
getInstantFromObject
-
getInstantNoKeyParsing
-
getInstantNoKeyParsing
-
getInstant
-
getArrayFirst
protected <T> T getArrayFirst(String jsonPath, boolean parseJsonPath, boolean hasdefaultElement, T defaultElement, JsonObjectDefault.IFirstElementGetter<T> firstElementGetter) -
getArrayFirstString
Description copied from interface:JsonObjectOrArrayGets the first value (as String) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Specified by:
getArrayFirstStringin interfaceJsonObjectOrArray- Returns:
- the value of the property or
nullif the array or the first element are not found.
-
getArrayFirstString
Description copied from interface:JsonObjectOrArrayGets the first value (as String) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Specified by:
getArrayFirstStringin interfaceJsonObjectOrArray- Returns:
- the value of the property or the specified
defaultElementif the array or the first element are not found.
-
getArrayFirstStringNoKeyParsing
-
getArrayFirstStringNoKeyParsing
-
getArrayFirstString
-
toJsonString
Description copied from interface:JsonObjectOrArrayTheJsonstring representation of the object.- Specified by:
toJsonStringin interfaceJsonObjectOrArray
-
toJsonString
Description copied from interface:JsonObjectOrArrayTheJsonstring representation of the object.- Specified by:
toJsonStringin interfaceJsonObjectOrArray- Parameters:
pretty- iftrue, the generated String will be formatted.
-
toString
-
getArrayFirstJsonObject
Description copied from interface:JsonObjectOrArrayGets the first value (as JsonObject) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Specified by:
getArrayFirstJsonObjectin interfaceJsonObjectOrArray- Returns:
- the value of the property or
nullif the array or the first element are not found.
-
getArrayFirstJsonObject
Description copied from interface:JsonObjectOrArrayGets the first value (as JsonObject) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Specified by:
getArrayFirstJsonObjectin interfaceJsonObjectOrArray- Returns:
- the value of the property or the specified
defaultElementif the array or the first element are not found.
-
getArrayFirstJsonObjectNoKeyParsing
-
getArrayFirstJsonObjectNoKeyParsing
-
getArrayFirstJsonObject
protected JsonObject getArrayFirstJsonObject(String key, boolean parseJsonPath, boolean hasdefaultElement, JsonObject defaultElement) -
getArrayFirstJsonArray
Description copied from interface:JsonObjectOrArrayGets the first value (as JsonArray) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Specified by:
getArrayFirstJsonArrayin interfaceJsonObjectOrArray- Returns:
- the value of the property or
nullif the array or the first element are not found.
-
getArrayFirstJsonArray
Description copied from interface:JsonObjectOrArrayGets the first value (as JsonArray) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Specified by:
getArrayFirstJsonArrayin interfaceJsonObjectOrArray- Returns:
- the value of the property or the specified
defaultElementif the array or the first element are not found.
-
getArrayFirstJsonArrayNoKeyParsing
-
getArrayFirstJsonArrayNoKeyParsing
-
getArrayFirstJsonArray
-
getArrayFirstInteger
Description copied from interface:JsonObjectOrArrayGets the first value (as Integer) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Specified by:
getArrayFirstIntegerin interfaceJsonObjectOrArray- Returns:
- the value of the property or
nullif the array or the first element are not found.
-
getArrayFirstInteger
Description copied from interface:JsonObjectOrArrayGets the first value (as Integer) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Specified by:
getArrayFirstIntegerin interfaceJsonObjectOrArray- Returns:
- the value of the property or the specified
defaultElementif the array or the first element are not found.
-
getArrayFirstIntegerNoKeyParsing
-
getArrayFirstIntegerNoKeyParsing
-
getArrayFirstInteger
-
getArrayFirstLong
Description copied from interface:JsonObjectOrArrayGets the first value (as Long) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Specified by:
getArrayFirstLongin interfaceJsonObjectOrArray- Returns:
- the value of the property or
nullif the array or the first element are not found.
-
getArrayFirstLong
Description copied from interface:JsonObjectOrArrayGets the first value (as Long) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Specified by:
getArrayFirstLongin interfaceJsonObjectOrArray- Returns:
- the value of the property or the specified
defaultElementif the array or the first element are not found.
-
getArrayFirstLongNoKeyParsing
-
getArrayFirstLongNoKeyParsing
-
getArrayFirstLong
-
getArrayFirstDouble
Description copied from interface:JsonObjectOrArrayGets the first value (as Double) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Specified by:
getArrayFirstDoublein interfaceJsonObjectOrArray- Returns:
- the value of the property or
nullif the array or the first element are not found.
-
getArrayFirstDouble
Description copied from interface:JsonObjectOrArrayGets the first value (as Double) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Specified by:
getArrayFirstDoublein interfaceJsonObjectOrArray- Returns:
- the value of the property or the specified
defaultElementif the array or the first element are not found.
-
getArrayFirstDoubleNoKeyParsing
-
getArrayFirstDoubleNoKeyParsing
-
getArrayFirstDouble
-
getArrayFirstFloat
Description copied from interface:JsonObjectOrArrayGets the first value (as Float) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Specified by:
getArrayFirstFloatin interfaceJsonObjectOrArray- Returns:
- the value of the property or
nullif the array or the first element are not found.
-
getArrayFirstFloat
Description copied from interface:JsonObjectOrArrayGets the first value (as Float) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Specified by:
getArrayFirstFloatin interfaceJsonObjectOrArray- Returns:
- the value of the property or the specified
defaultElementif the array or the first element are not found.
-
getArrayFirstFloatNoKeyParsing
-
getArrayFirstFloatNoKeyParsing
-
getArrayFirstFloat
-
getArrayFirstBoolean
Description copied from interface:JsonObjectOrArrayGets the first value (as Boolean) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Specified by:
getArrayFirstBooleanin interfaceJsonObjectOrArray- Returns:
- the value of the property or
nullif the array or the first element are not found.
-
getArrayFirstBoolean
Description copied from interface:JsonObjectOrArrayGets the first value (as Boolean) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Specified by:
getArrayFirstBooleanin interfaceJsonObjectOrArray- Returns:
- the value of the property or the specified
defaultElementif the array or the first element are not found.
-
getArrayFirstBooleanNoKeyParsing
-
getArrayFirstBooleanNoKeyParsing
-
getArrayFirstBoolean
-
getArrayFirstBigDecimal
Description copied from interface:JsonObjectOrArrayGets the first value (as BigDecimal) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Specified by:
getArrayFirstBigDecimalin interfaceJsonObjectOrArray- Returns:
- the value of the property or
nullif the array or the first element are not found.
-
getArrayFirstBigDecimal
Description copied from interface:JsonObjectOrArrayGets the first value (as BigDecimal) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Specified by:
getArrayFirstBigDecimalin interfaceJsonObjectOrArray- Returns:
- the value of the property or the specified
defaultElementif the array or the first element are not found.
-
getArrayFirstBigDecimalNoKeyParsing
-
getArrayFirstBigDecimalNoKeyParsing
-
getArrayFirstBigDecimal
protected BigDecimal getArrayFirstBigDecimal(String key, boolean parseJsonPath, boolean hasdefaultElement, BigDecimal defaultElement) -
getArrayFirstBytesFromBase64String
Description copied from interface:JsonObjectOrArrayGets the first value (as byte[]) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Specified by:
getArrayFirstBytesFromBase64Stringin interfaceJsonObjectOrArray- Returns:
- the value of the property or
nullif the array or the first element are not found.
-
getArrayFirstBytesFromBase64String
Description copied from interface:JsonObjectOrArrayGets the first value (as byte[]) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Specified by:
getArrayFirstBytesFromBase64Stringin interfaceJsonObjectOrArray- Returns:
- the value of the property or the specified
defaultElementif the array or the first element are not found.
-
getArrayFirstBytesFromBase64StringNoKeyParsing
-
getArrayFirstBytesFromBase64StringNoKeyParsing
-
getArrayFirstBytesFromBase64String
protected byte[] getArrayFirstBytesFromBase64String(String key, boolean parseJsonPath, boolean hasdefaultElement, byte[] defaultElement) -
getArrayFirstDate
Description copied from interface:JsonObjectOrArrayGets the first value (as Date) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Specified by:
getArrayFirstDatein interfaceJsonObjectOrArray- Returns:
- the value of the property or
nullif the array or the first element are not found.
-
getArrayFirstDate
Description copied from interface:JsonObjectOrArrayGets the first value (as Date) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Specified by:
getArrayFirstDatein interfaceJsonObjectOrArray- Returns:
- the value of the property or the specified
defaultElementif the array or the first element are not found.
-
getArrayFirstDateNoKeyParsing
-
getArrayFirstDateNoKeyParsing
-
getArrayFirstDate
-
getArrayFirstInstant
Description copied from interface:JsonObjectOrArrayGets the first value (as Instant) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Specified by:
getArrayFirstInstantin interfaceJsonObjectOrArray- Returns:
- the value of the property or
nullif the array or the first element are not found.
-
getArrayFirstInstant
Description copied from interface:JsonObjectOrArrayGets the first value (as Instant) of aJsonArrayproperty of the object, using theJsonPathto find the array.- Specified by:
getArrayFirstInstantin interfaceJsonObjectOrArray- Returns:
- the value of the property or the specified
defaultElementif the array or the first element are not found.
-
getArrayFirstInstantNoKeyParsing
-
getArrayFirstInstantNoKeyParsing
-
getArrayFirstInstant
-
isCanBeConvertedToString
Description copied from interface:JsonObjectOrArrayValidates that the value at the specifiedJsonPathexists and is currentlynull, of typeString, or can be converted and retrieved as one.- Specified by:
isCanBeConvertedToStringin interfaceJsonObjectOrArray
-
isCanBeConvertedToStringNoKeyParsing
-
isCanBeConvertedToString
-
isCanBeConvertedToInteger
Description copied from interface:JsonObjectOrArrayValidates that the value at the specifiedJsonPathexists and is currentlynull, of typeInteger, or can be converted and retrieved as one.- Specified by:
isCanBeConvertedToIntegerin interfaceJsonObjectOrArray
-
isCanBeConvertedToIntegerNoKeyParsing
-
isCanBeConvertedToInteger
-
isCanBeConvertedToLong
Description copied from interface:JsonObjectOrArrayValidates that the value at the specifiedJsonPathexists and is currentlynull, of typeLong, or can be converted and retrieved as one.- Specified by:
isCanBeConvertedToLongin interfaceJsonObjectOrArray
-
isCanBeConvertedToLongNoKeyParsing
-
isCanBeConvertedToLong
-
isCanBeConvertedToFloat
Description copied from interface:JsonObjectOrArrayValidates that the value at the specifiedJsonPathexists and is currentlynull, of typeFloat, or can be converted and retrieved as one.- Specified by:
isCanBeConvertedToFloatin interfaceJsonObjectOrArray
-
isCanBeConvertedToFloatNoKeyParsing
-
isCanBeConvertedToFloat
-
isCanBeConvertedToDouble
Description copied from interface:JsonObjectOrArrayValidates that the value at the specifiedJsonPathexists and is currentlynull, of typeDouble, or can be converted and retrieved as one.- Specified by:
isCanBeConvertedToDoublein interfaceJsonObjectOrArray
-
isCanBeConvertedToDoubleNoKeyParsing
-
isCanBeConvertedToDouble
-
isCanBeConvertedToBoolean
Description copied from interface:JsonObjectOrArrayValidates that the value at the specifiedJsonPathexists and is currentlynull, of typeBoolean, or can be converted and retrieved as one.- Specified by:
isCanBeConvertedToBooleanin interfaceJsonObjectOrArray
-
isCanBeConvertedToBooleanNoKeyParsing
-
isCanBeConvertedToBoolean
-
isCanBeConvertedToBigDecimal
Description copied from interface:JsonObjectOrArrayValidates that the value at the specifiedJsonPathexists and is currentlynull, of typeBigDecimal, or can be converted and retrieved as one.- Specified by:
isCanBeConvertedToBigDecimalin interfaceJsonObjectOrArray
-
isCanBeConvertedToBigDecimalNoKeyParsing
-
isCanBeConvertedToBigDecimal
-
isCanBeConvertedToByteArray
Description copied from interface:JsonObjectOrArrayValidates that the value at the specifiedJsonPathexists and is currentlynull, of typebase 64 Stringrepresenting a byte array, or can be converted and retrieved as one.- Specified by:
isCanBeConvertedToByteArrayin interfaceJsonObjectOrArray
-
isCanBeConvertedToByteArrayNoKeyParsing
-
isCanBeConvertedToByteArray
-
isCanBeConvertedToDate
Description copied from interface:JsonObjectOrArrayValidates that the value at the specifiedJsonPathexists and is currentlynull, of typeDate, or can be converted and retrieved as one.- Specified by:
isCanBeConvertedToDatein interfaceJsonObjectOrArray
-
isCanBeConvertedToDateNoKeyParsing
-
isCanBeConvertedToDate
-
isCanBeConvertedToJsonObject
Description copied from interface:JsonObjectOrArrayValidates that the value at the specifiedJsonPathexists and is currentlynull, of typeJsonObject, or can be converted and retrieved as one.- Specified by:
isCanBeConvertedToJsonObjectin interfaceJsonObjectOrArray
-
isCanBeConvertedToJsonObjectNoKeyParsing
-
isCanBeConvertedToJsonObject
-
isCanBeConvertedToJsonArray
Description copied from interface:JsonObjectOrArrayValidates that the value at the specifiedJsonPathexists and is currentlynull, of typeJsonArray, or can be converted and retrieved as one.- Specified by:
isCanBeConvertedToJsonArrayin interfaceJsonObjectOrArray
-
isCanBeConvertedToJsonArrayNoKeyParsing
-
isCanBeConvertedToJsonArray
-
isOfTypeString
Description copied from interface:JsonObjectOrArrayValidates that the value at the specifiedJsonPathexists and is currentlynullor of typeString, without requiring any conversion.- Specified by:
isOfTypeStringin interfaceJsonObjectOrArray
-
isOfTypeStringNoKeyParsing
-
isOfTypeString
-
isOfTypeInteger
Description copied from interface:JsonObjectOrArrayValidates that the value at the specifiedJsonPathexists and is currentlynullor of typeInteger, without requiring any conversion.- Specified by:
isOfTypeIntegerin interfaceJsonObjectOrArray
-
isOfTypeIntegerNoKeyParsing
-
isOfTypeInteger
-
isOfTypeLong
Description copied from interface:JsonObjectOrArrayValidates that the value at the specifiedJsonPathexists and is currentlynullor of typeLong, without requiring any conversion.- Specified by:
isOfTypeLongin interfaceJsonObjectOrArray
-
isOfTypeLongNoKeyParsing
-
isOfTypeLong
-
isOfTypeFloat
Description copied from interface:JsonObjectOrArrayValidates that the value at the specifiedJsonPathexists and is currentlynullor of typeFloat, without requiring any conversion.- Specified by:
isOfTypeFloatin interfaceJsonObjectOrArray
-
isOfTypeFloatNoKeyParsing
-
isOfTypeFloat
-
isOfTypeDouble
Description copied from interface:JsonObjectOrArrayValidates that the value at the specifiedJsonPathexists and is currentlynullor of typeDouble, without requiring any conversion.- Specified by:
isOfTypeDoublein interfaceJsonObjectOrArray
-
isOfTypeDoubleNoKeyParsing
-
isOfTypeDouble
-
isOfTypeBoolean
Description copied from interface:JsonObjectOrArrayValidates that the value at the specifiedJsonPathexists and is currentlynullor of typeBoolean, without requiring any conversion.- Specified by:
isOfTypeBooleanin interfaceJsonObjectOrArray
-
isOfTypeBooleanNoKeyParsing
-
isOfTypeBoolean
-
isOfTypeBigDecimal
Description copied from interface:JsonObjectOrArrayValidates that the value at the specifiedJsonPathexists and is currentlynullor of typeBigDecimal, without requiring any conversion.- Specified by:
isOfTypeBigDecimalin interfaceJsonObjectOrArray
-
isOfTypeBigDecimalNoKeyParsing
-
isOfTypeeBigDecimal
-
isOfTypeByteArray
Description copied from interface:JsonObjectOrArrayValidates that the value at the specifiedJsonPathexists and is currentlynullor of typebyte[], without requiring any conversion.- Specified by:
isOfTypeByteArrayin interfaceJsonObjectOrArrayacceptBase64StringToo- iftrue, then a valid base 64 String will also be accepted.
-
isOfTypeByteArrayNoKeyParsing
-
isOfTypeByteArray
-
isOfTypeDate
Description copied from interface:JsonObjectOrArrayValidates that the value at the specifiedJsonPathexists and is currentlynullor of typeDate, without requiring any conversion.- Specified by:
isOfTypeDatein interfaceJsonObjectOrArray
-
isOfTypeDateNoKeyParsing
-
isOfTypeDate
-
isOfTypeJsonObject
Description copied from interface:JsonObjectOrArrayValidates that the value at the specifiedJsonPathexists and is currentlynullor of typeJsonObject, without requiring any conversion.- Specified by:
isOfTypeJsonObjectin interfaceJsonObjectOrArray
-
isOfTypeJsonObjectNoKeyParsing
-
isOfTypeJsonObject
-
isOfTypeJsonArray
Description copied from interface:JsonObjectOrArrayValidates that the value at the specifiedJsonPathexists and is currentlynullor of typeJsonArray, without requiring any conversion.- Specified by:
isOfTypeJsonArrayin interfaceJsonObjectOrArray
-
isOfTypeJsonArrayNoKeyParsing
-
isOfTypeJsonArray
-
isNull
Description copied from interface:JsonObjectOrArrayValidates that the value at the specifiedJsonPathexists and isnull.- Specified by:
isNullin interfaceJsonObjectOrArray
-
isNullNoKeyParsing
-
validateIsNull
-
contains
Description copied from interface:JsonObjectOrArrayDoes the object contain an element at theJsonPathposition (even ifnull)?Same as
JsonObjectOrArray.isPresent(String).- Specified by:
containsin interfaceJsonObjectOrArray
-
isPresent
Description copied from interface:JsonObjectOrArrayDoes the object contain an element at theJsonPathposition (even ifnull)?Same as
JsonObjectOrArray.contains(String).- Specified by:
isPresentin interfaceJsonObjectOrArray
-
getElement
protected Object getElement(String key, boolean hasdefaultElement, Object defaultElement, boolean parseJsonPath) Gets the element at this key/jsonPath/index. If the current object is immutable, the target element may be cached. -
clone
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
getTrimTransformer
-
trim
Description copied from interface:JsonObjectOrArrayTrims the element at the specifiedJsonPathif it's of typeString.- Specified by:
trimin interfaceJsonObjectOrArray
-
trimAll
public void trimAll()Description copied from interface:JsonObjectOrArrayTrims all the elements of the object that are of typeString. This transformation is not recursive.- Specified by:
trimAllin interfaceJsonObjectOrArray
-
trimAll
public void trimAll(boolean recursive) Description copied from interface:JsonObjectOrArrayTrims all the elements of the object that are of type String.- Specified by:
trimAllin interfaceJsonObjectOrArray- Parameters:
recursive- iftrue, then all children elements will also be trimmed, recursively.
-
transform
Description copied from interface:JsonObjectOrArrayTransforms the element at the specifiedJsonPathusing the transformer.- Specified by:
transformin interfaceJsonObjectOrArray
-
transformAll
Description copied from interface:JsonObjectOrArrayTransforms all the elements of the object, using the specified transformer. This transformation is not recursive.- Specified by:
transformAllin interfaceJsonObjectOrArray
-
set
Description copied from interface:JsonObjectOrArraySets an element at the specifiedJsonPath. Overwrites any existing element at thatJsonPath.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
JsonObjector aJsonArrayand 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 aJsonObjectusing the associated conversion method. If it implementsToJsonArrayConvertible, it will be converted to aJsonArrayusing 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 :
- A Collection
- An array
- Specified by:
setin interfaceJsonObjectOrArray
-
set
Description copied from interface:JsonObjectOrArraySets an element at the specifiedJsonPath. Overwrites any existing element at thatJsonPath.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
JsonObjector aJsonArrayand 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 aJsonObjectusing the associated conversion method. If it implementsToJsonArrayConvertible, it will be converted to aJsonArrayusing 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 :
- A Collection
- An array
- Specified by:
setin interfaceJsonObjectOrArrayclone- iftrue, and the element to add is aJsonObjectorJsonArray, 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.
-
setIfAbsent
Description copied from interface:JsonObjectOrArraySets an element at the specifiedJsonPathif no element exists at this path.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
JsonObjector aJsonArrayand 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 aJsonObjectusing the associated conversion method. If it implementsToJsonArrayConvertible, it will be converted to aJsonArrayusing 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 :
- A Collection
- An array
- Specified by:
setIfAbsentin interfaceJsonObjectOrArray
-
setIfAbsent
Description copied from interface:JsonObjectOrArraySets an element at the specifiedJsonPathif no element exists at this path.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
JsonObjector aJsonArrayand 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 aJsonObjectusing the associated conversion method. If it implementsToJsonArrayConvertible, it will be converted to aJsonArrayusing 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 :
- A Collection
- An array
- Specified by:
setIfAbsentin interfaceJsonObjectOrArrayclone- iftrue, and the element to add is aJsonObjectorJsonArray, 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.
-
put
protected JsonObjectOrArray put(String jsonPath, Object element, boolean clone, boolean parseJsonPath) -
putAsIs
-
transformAll
Description copied from interface:JsonObjectOrArrayTransforms all the elements of the object, using the specified transformer.- Specified by:
transformAllin interfaceJsonObjectOrArrayrecursive- iftrue, then all children elements will also be transformed, recursively.
-
clone
Clone the object.- Specified by:
clonein interfaceJsonObjectOrArray- Parameters:
mutable- iftruethe resulting object and all its children will be mutable, otherwise they will all be immutable.
-
getElementNoKeyParsing
protected abstract Object getElementNoKeyParsing(String key, boolean hasdefaultElement, Object defaultElement) Gets the element at this key/index, without key parsing.
-