Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion json-path/src/main/java/com/jayway/jsonpath/JsonPath.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private JsonPath(String jsonPath, Predicate[] filters) {
notNull(jsonPath, "path can not be null");
this.path = PathCompiler.compile(jsonPath, filters);
}

/**
* Returns the string representation of this JsonPath
*
Expand All @@ -105,6 +105,14 @@ private JsonPath(String jsonPath, Predicate[] filters) {
public String getPath() {
return this.path.toString();
}

/**
* Gets the internal path implementation. For advanced use cases.
* @return the path implementation
*/
public Path getPathImpl() {
return path;
}

/**
* @see JsonPath#isDefinite()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
*/
package com.jayway.jsonpath.internal.path;

import com.jayway.jsonpath.internal.PathRef;
import java.util.List;

import static java.lang.String.format;
import com.jayway.jsonpath.internal.PathRef;

public class ArrayIndexToken extends ArrayPathToken {

Expand Down Expand Up @@ -48,5 +48,8 @@ public String getPathFragment() {
public boolean isTokenDefinite() {
return arrayIndexOperation.isSingleIndexOperation();
}


public List<Integer> getIndexes() {
return arrayIndexOperation.indexes();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public void invoke(PathFunction pathFunction, String currentPath, PathRef parent

public abstract boolean isTokenDefinite();

protected abstract String getPathFragment();
public abstract String getPathFragment();

public void setNext(final PathToken next) {
this.next = next;
Expand All @@ -231,4 +231,8 @@ public void setNext(final PathToken next) {
public PathToken getNext() {
return this.next;
}

public PathToken getPrevious() {
return this.prev;
}
}