|
|
@ -42,7 +42,8 @@ public class PathCompiler { |
|
|
|
path = "$." + path; |
|
|
|
path = "$." + path; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Path p = cache.get(path + filterList.toString()); |
|
|
|
String cacheKey = path + filterList.toString(); |
|
|
|
|
|
|
|
Path p = cache.get(cacheKey); |
|
|
|
if(p != null){ |
|
|
|
if(p != null){ |
|
|
|
return p; |
|
|
|
return p; |
|
|
|
} |
|
|
|
} |
|
|
@ -110,7 +111,7 @@ public class PathCompiler { |
|
|
|
|
|
|
|
|
|
|
|
Path pa = new CompiledPath(root); |
|
|
|
Path pa = new CompiledPath(root); |
|
|
|
|
|
|
|
|
|
|
|
cache.put(path, pa); |
|
|
|
cache.put(cacheKey, pa); |
|
|
|
|
|
|
|
|
|
|
|
return pa; |
|
|
|
return pa; |
|
|
|
} |
|
|
|
} |
|
|
@ -344,6 +345,7 @@ public class PathCompiler { |
|
|
|
StringBuilder buffer = new StringBuilder(); |
|
|
|
StringBuilder buffer = new StringBuilder(); |
|
|
|
|
|
|
|
|
|
|
|
boolean propertyIsOpen = false; |
|
|
|
boolean propertyIsOpen = false; |
|
|
|
|
|
|
|
boolean propertyDone = false; |
|
|
|
|
|
|
|
|
|
|
|
while (current != ']') { |
|
|
|
while (current != ']') { |
|
|
|
switch (current) { |
|
|
|
switch (current) { |
|
|
@ -351,12 +353,17 @@ public class PathCompiler { |
|
|
|
if (propertyIsOpen) { |
|
|
|
if (propertyIsOpen) { |
|
|
|
property = buffer.toString(); |
|
|
|
property = buffer.toString(); |
|
|
|
propertyIsOpen = false; |
|
|
|
propertyIsOpen = false; |
|
|
|
|
|
|
|
propertyDone = true; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
propertyIsOpen = true; |
|
|
|
propertyIsOpen = true; |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
if (propertyIsOpen) { |
|
|
|
if (propertyIsOpen) { |
|
|
|
|
|
|
|
if(propertyDone){ |
|
|
|
|
|
|
|
//Don't understand how to create a "Normalized path expressions" for this type of query
|
|
|
|
|
|
|
|
throw new InvalidPathException("Only single properties are supported."); |
|
|
|
|
|
|
|
} |
|
|
|
buffer.append(current); |
|
|
|
buffer.append(current); |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|