/** * The main constructor * * @param input the input string * @throws JsonPointerException malformed JSON Pointer * @throws NullPointerException null input */ public JsonPointer(final String input) throws JsonPointerException { this(fromTokens(tokensFromInput(input))); }
/** * The main constructor * * @param input the input string * @throws JsonPointerException malformed JSON Pointer * @throws NullPointerException null input */ public JsonPointer(final String input) throws JsonPointerException { this(fromTokens(tokensFromInput(input))); }
/** * Build a JSON Pointer out of a series of reference tokens * * <p>These tokens can be everything; be sure however that they implement * {@link Object#toString()} correctly!</p> * * <p>Each of these tokens are treated as <b>raw</b> tokens (ie, not * encoded).</p> * * @param first the first token * @param other other tokens * @return a JSON Pointer * @throws NullPointerException one input token is null */ public static JsonPointer of(final Object first, final Object... other) { final List<ReferenceToken> tokens = Lists.newArrayList(); tokens.add(ReferenceToken.fromRaw(first.toString())); for (final Object o: other) tokens.add(ReferenceToken.fromRaw(o.toString())); return new JsonPointer(fromTokens(tokens)); }
/** * Build a JSON Pointer out of a series of reference tokens * * <p>These tokens can be everything; be sure however that they implement * {@link Object#toString()} correctly!</p> * * <p>Each of these tokens are treated as <b>raw</b> tokens (ie, not * encoded).</p> * * @param first the first token * @param other other tokens * @return a JSON Pointer * @throws NullPointerException one input token is null */ public static JsonPointer of(final Object first, final Object... other) { final List<ReferenceToken> tokens = Lists.newArrayList(); tokens.add(ReferenceToken.fromRaw(first.toString())); for (final Object o: other) tokens.add(ReferenceToken.fromRaw(o.toString())); return new JsonPointer(fromTokens(tokens)); }