@Override protected boolean _includeScalar() { // should only occur for root-level scalars, path "/" return _pathToMatch.matches(); }
private boolean matchesPath(JsonOverlay<?> child, JsonPointer path) { JsonPointer childPath = getPointer(child); while (!childPath.matches()) { if (!childPath.matchesProperty(path.getMatchingProperty())) { return false; } else { path = path.tail(); childPath = childPath.tail(); } } return true; }
@Override protected boolean _includeScalar() { // should only occur for root-level scalars, path "/" return _pathToMatch.matches(); }
@Override public JsonOverlay<?> _findInternal(JsonPointer path) { if (path.matchesProperty("additionalProperties")) { return path.tail().matches() ? _getOverlay("additionalProperties", BooleanOverlay.class) : _get("additionalPropertiesSchema", SchemaImpl.class)._findInternal(path.tail()); } else { return super._findInternal(path); } }
@Override public TokenFilter includeElement(int index) { JsonPointer next = _pathToMatch.matchElement(index); if (next == null) { return null; } if (next.matches()) { return TokenFilter.INCLUDE_ALL; } return new JsonPointerBasedFilter(next); }
@Override public JsonOverlay<?> _findInternal(JsonPointer path) { if (path.matchesProperty("additionalProperties")) { return path.tail().matches() ? _getOverlay("additionalProperties", BooleanOverlay.class) : _get("additionalPropertiesSchema", SchemaImpl.class)._findInternal(path.tail()); } else { return super._findInternal(path); } }
@Override public TokenFilter includeProperty(String name) { JsonPointer next = _pathToMatch.matchProperty(name); if (next == null) { return null; } if (next.matches()) { return TokenFilter.INCLUDE_ALL; } return new JsonPointerBasedFilter(next); }
@Override public JsonOverlay<?> _findInternal(JsonPointer path) { if (path.matchesProperty("additionalProperties")) { return path.tail().matches() ? _getOverlay("additionalProperties", BooleanOverlay.class) : _get("additionalPropertiesSchema", SchemaImpl.class)._findInternal(path.tail()); } else { return super._findInternal(path); } }
@Override public TokenFilter includeElement(int index) { JsonPointer next = _pathToMatch.matchElement(index); if (next == null) { return null; } if (next.matches()) { return TokenFilter.INCLUDE_ALL; } return new JsonPointerBasedFilter(next); }
@Override public TokenFilter includeProperty(String name) { JsonPointer next = _pathToMatch.matchProperty(name); if (next == null) { return null; } if (next.matches()) { return TokenFilter.INCLUDE_ALL; } return new JsonPointerBasedFilter(next); }
/** * Method for locating node specified by given JSON pointer instances. * Method will never return null; if no matching node exists, * will return a node for which {@link #isMissingNode()} returns true. * * @return Node that matches given JSON Pointer: if no match exists, * will return a node for which {@link #isMissingNode()} returns true. * * @since 2.3 */ @Override public final JsonNode at(JsonPointer ptr) { // Basically: value nodes only match if we have "empty" path left if (ptr.matches()) { return this; } JsonNode n = _at(ptr); if (n == null) { return MissingNode.getInstance(); } return n.at(ptr.tail()); }
@Override protected boolean _includeScalar() { // should only occur for root-level scalars, path "/" return _pathToMatch.matches(); }
@Override protected boolean _includeScalar() { // should only occur for root-level scalars, path "/" return !_pathToMatch.matches(); }
@Override public TokenFilter includeProperty(final String name) { final JsonPointer next = _pathToMatch.matchProperty(name); if (next == null) { return TokenFilter.INCLUDE_ALL; } if (next.matches()) { return null; } return new JsonPointerNotMatchedFilter(next); }
@Override public TokenFilter includeElement(int index) { JsonPointer next = _pathToMatch.matchElement(index); if (next == null) { return null; } if (next.matches()) { return TokenFilter.INCLUDE_ALL; } return new JsonPointerBasedFilter(next); }
@Override public TokenFilter includeElement(final int index) { final JsonPointer next = _pathToMatch.matchElement(index); if (next == null) { return TokenFilter.INCLUDE_ALL; } if (next.matches()) { return null; } return new JsonPointerNotMatchedFilter(next); }
@Override public TokenFilter includeElement(int index) { JsonPointer next = _pathToMatch.matchElement(index); if (next == null) { return null; } if (next.matches()) { return TokenFilter.INCLUDE_ALL; } return new JsonPointerBasedFilter(next); }
@Override public TokenFilter includeProperty(String name) { JsonPointer next = _pathToMatch.matchProperty(name); if (next == null) { return null; } if (next.matches()) { return TokenFilter.INCLUDE_ALL; } return new JsonPointerBasedFilter(next); }
@Override public TokenFilter includeProperty(String name) { JsonPointer next = _pathToMatch.matchProperty(name); if (next == null) { return null; } if (next.matches()) { return TokenFilter.INCLUDE_ALL; } return new JsonPointerBasedFilter(next); }
private JsonPointer tailPath(JsonOverlay<?> child, JsonPointer path) { JsonPointer childPath = getPointer(child); while (!childPath.matches()) { path = path.tail(); childPath = childPath.tail(); } return path; }