JsonPointerPosition (@NotNull String pointer) { final List<String> chain = split(normalizeSlashes(normalizeId(pointer))); List<JsonPointerPosition.Step> steps = new ArrayList<>(chain.size()); for (String s: chain) { try { steps.add(JsonPointerPosition.Step.createArrayElementStep(Integer.parseInt(s))); } catch (NumberFormatException e) { steps.add(JsonPointerPosition.Step.createPropertyStep(unescapeJsonPointerPart(s))); } } return new JsonPointerPosition(steps); }