org.archive.format.json.JSONPathSpecFactory Maven / Gradle / Ivy
The newest version!
package org.archive.format.json;
import java.util.ArrayList;
public class JSONPathSpecFactory {
public static JSONPathSpec get(String spec) {
if(spec.contains("|")) {
// compound OR:
String parts[] = spec.split("\\|");
ArrayList subs = new ArrayList(parts.length);
for(String part : parts) {
subs.add(new SimpleJSONPathSpec(part));
}
return new CompoundORJSONPathSpec(subs);
} else {
// assume "simple":
return new SimpleJSONPathSpec(spec);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy