/** * Get the value referenced by the provided JSON Pointer in the JsonStructure. * * @param jsonPointer the JSON Pointer * @return the {@code JsonValue} at the referenced location * @throws JsonException if the JSON Pointer is malformed, or if it references * a non-existing member or value. * * @since 1.1 */ default public JsonValue getValue(String jsonPointer) { return Json.createPointer(jsonPointer).getValue(this); } }
case COPY: from = getPointer(operation, "from"); return pointer.add(target, from.getValue(target)); case MOVE: return pointer.add(from.remove(target), from.getValue(target)); case TEST: if (! getValue(operation).equals(pointer.getValue(target))) { throw new JsonException(JsonMessages.PATCH_TEST_FAILED(operation.getString("path"), getValue(operation).toString()));
case COPY: from = getPointer(operation, "from"); return pointer.add(target, from.getValue(target)); case MOVE: return pointer.add(from.remove(target), from.getValue(target)); case TEST: if (! getValue(operation).equals(pointer.getValue(target))) { throw new JsonException(JsonMessages.PATCH_TEST_FAILED(operation.getString("path"), getValue(operation).toString()));
/** * Get the value referenced by the provided JSON Pointer in the JsonStructure. * * @param jsonPointer the JSON Pointer * @return the {@code JsonValue} at the referenced location * @throws JsonException if the JSON Pointer is malformed, or if it references * a non-existing member or value. * * @since 1.1 */ default public JsonValue getValue(String jsonPointer) { return Json.createPointer(jsonPointer).getValue(this); } }
private Object extractValue(final JsonObject payload) { if (!pointer.containsValue(payload)) { return null; } return ofNullable(pointer.getValue(payload)).map(this::mapValue).orElse(null); }
/** * Get the value referenced by the provided JSON Pointer in the JsonStructure. * * @param jsonPointer the JSON Pointer * @return the {@code JsonValue} at the referenced location * @throws JsonException if the JSON Pointer is malformed, or if it references * a non-existing member or value. * * @since 1.1 */ default public JsonValue getValue(String jsonPointer) { return Json.createPointer(jsonPointer).getValue(this); } }
/** * Get the value referenced by the provided JSON Pointer in the JsonStructure. * * @param jsonPointer the JSON Pointer * @return the {@code JsonValue} at the referenced location * @throws JsonException if the JSON Pointer is malformed, or if it references * a non-existing member or value. * * @since 1.1 */ default public JsonValue getValue(String jsonPointer) { return Json.createPointer(jsonPointer).getValue(this); } }
/** * Get the value referenced by the provided JSON Pointer in the JsonStructure. * * @param jsonPointer the JSON Pointer * @return the {@code JsonValue} at the referenced location * @throws JsonException if the JSON Pointer is malformed, or if it references * a non-existing member or value. * * @since 1.1 */ default public JsonValue getValue(String jsonPointer) { return Json.createPointer(jsonPointer).getValue(this); } }
/** * Get the value referenced by the provided JSON Pointer in the JsonStructure. * * @param jsonPointer the JSON Pointer * @return the {@code JsonValue} at the referenced location * @throws JsonException if the JSON Pointer is malformed, or if it references * a non-existing member or value. * * @since 1.1 */ default public JsonValue getValue(String jsonPointer) { return Json.createPointer(jsonPointer).getValue(this); } }
/** * Get the value referenced by the provided JSON Pointer in the JsonStructure. * * @param jsonPointer the JSON Pointer * @return the {@code JsonValue} at the referenced location * @throws JsonException if the JSON Pointer is malformed, or if it references * a non-existing member or value. * * @since 1.1 */ default public JsonValue getValue(String jsonPointer) { return Json.createPointer(jsonPointer).getValue(this); } }
/** * Get the value referenced by the provided JSON Pointer in the JsonStructure. * * @param jsonPointer the JSON Pointer * @return the {@code JsonValue} at the referenced location * @throws JsonException if the JSON Pointer is malformed, or if it references * a non-existing member or value. * * @since 1.1 */ default public JsonValue getValue(String jsonPointer) { return Json.createPointer(jsonPointer).getValue(this); } }
/** * Get the value referenced by the provided JSON Pointer in the JsonStructure. * * @param jsonPointer the JSON Pointer * @return the {@code JsonValue} at the referenced location * @throws JsonException if the JSON Pointer is malformed, or if it references * a non-existing member or value. * * @since 1.1 */ default public JsonValue getValue(String jsonPointer) { return Json.createPointer(jsonPointer).getValue(this); } }
/** * Get the value referenced by the provided JSON Pointer in the JsonStructure. * * @param jsonPointer the JSON Pointer * @return the {@code JsonValue} at the referenced location * @throws JsonException if the JSON Pointer is malformed, or if it references * a non-existing member or value. * * @since 1.1 */ default public JsonValue getValue(String jsonPointer) { return Json.createPointer(jsonPointer).getValue(this); } }
public Optional<String> findEnclosedFormId(final String type, final String lang, final JsonObject payload) { return doEnrich(type, lang, patch -> ofNullable(patch.getTypePointer()) .map(it -> it.getValue(payload)) .filter(it -> it.getValueType() == STRING) .map(it -> JsonString.class.cast(it).getString()) .orElseThrow(() -> new IllegalArgumentException( "No form identifier available, check your server configuration."))); }
default JsonValue getValue(String jsonPointer) { return JsonProvider.provider().createPointer(jsonPointer).getValue(this); } }
default JsonValue getValue(String jsonPointer) { return JsonProvider.provider().createPointer(jsonPointer).getValue(this); } }
default JsonValue getValue(String jsonPointer) { return JsonProvider.provider().createPointer(jsonPointer).getValue(this); } }
case COPY: from = getPointer(operation, "from"); return pointer.add(target, from.getValue(target)); case MOVE: return pointer.add(from.remove(target), from.getValue(target)); case TEST: if (! getValue(operation).equals(pointer.getValue(target))) { throw new JsonException(JsonMessages.PATCH_TEST_FAILED(operation.getString("path"), getValue(operation).toString()));
case COPY: from = getPointer(operation, "from"); return pointer.add(target, from.getValue(target)); case MOVE: return pointer.add(from.remove(target), from.getValue(target)); case TEST: if (! getValue(operation).equals(pointer.getValue(target))) { throw new JsonException(JsonMessages.PATCH_TEST_FAILED(operation.getString("path"), getValue(operation).toString()));
case COPY: from = getPointer(operation, "from"); return pointer.add(target, from.getValue(target)); case MOVE: return pointer.add(from.remove(target), from.getValue(target)); case TEST: if (! getValue(operation).equals(pointer.getValue(target))) { throw new JsonException(JsonMessages.PATCH_TEST_FAILED(operation.getString("path"), getValue(operation).toString()));