bug fixed for jsonpath

This commit is contained in:
高铁
2015-08-26 13:17:01 +08:00
parent 2e6632accc
commit 74e8fd2fa8
@@ -318,6 +318,14 @@ public class JSONPath implements ObjectSerializer {
}
Segement readSegement() {
if (level == 0 && path.length() == 1) {
if (isDigitFirst(ch)) {
int index = ch - '0';
return new ArrayAccessSegement(index);
} else if ((ch >= 'a' && ch <= 'z') || ((ch >= 'A' && ch <= 'Z'))) {
return new PropertySegement(Character.toString(ch));
}
}
while (!isEOF()) {
skipWhitespace();