Example usage for com.fasterxml.jackson.core JsonPointer compile

List of usage examples for com.fasterxml.jackson.core JsonPointer compile

Introduction

In this page you can find the example usage for com.fasterxml.jackson.core JsonPointer compile.

Prototype

public static JsonPointer compile(String input) throws IllegalArgumentException 

Source Link

Document

Factory method that parses given input and construct matching pointer instance, if it represents a valid JSON Pointer: if not, a IllegalArgumentException is thrown.

Usage

From source file:com.reprezen.swagedit.model.Model.java

/**
 * Returns the model's root node.
 * 
 * @return node
 */
public AbstractNode getRoot() {
    return nodes.get(JsonPointer.compile(""));
}

From source file:com.reprezen.swagedit.model.Model.java

/**
 * Returns the pointer for the node whose content is at the position specified by a line and column.
 * /*from  www  .  j  a v a 2  s  .  c  o m*/
 * @param line
 * @param column
 * @return
 */
public JsonPointer getPath(int line, int column) {
    AbstractNode node = getNode(line, column);
    if (node != null) {
        return node.getPointer();
    }
    return JsonPointer.compile("");
}

From source file:com.reprezen.swagedit.schema.SwaggerSchema.java

protected JsonPointer pointer(String href) {
    if (href.startsWith("#")) {
        return JsonPointer.compile(href.substring(1));
    } else if (href.startsWith("/")) {
        return JsonPointer.compile(href);
    } else {//  w  w w .  j av a2s  .c o m
        String[] split = href.split("#");
        return split.length > 1 ? JsonPointer.compile(split[1]) : null;
    }
}