All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.archive.format.json.JSONPathSpecFactory Maven / Gradle / Ivy

There is a newer version: 1.1.9
Show 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