
org.everit.json.schema.loader.JsonValue Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.everit.json.schema Show documentation
Show all versions of org.everit.json.schema Show documentation
This is a fork of the implementation of the JSON Schema Core Draft v4 specification built with the org.json API which also supports internationalization
The newest version!
package org.everit.json.schema.loader;
import static org.everit.json.schema.loader.OrgJsonUtil.toList;
import static org.everit.json.schema.loader.OrgJsonUtil.toMap;
import static org.everit.json.schema.loader.SpecificationVersion.DRAFT_4;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Consumer;
import java.util.function.Function;
import org.everit.json.schema.SchemaException;
import org.json.JSONArray;
import org.json.JSONObject;
/**
* @author erosb
*/
class JsonValue {
class Multiplexer {
protected Map, Function, R>> actions = new HashMap<>();
Multiplexer(Class> expectedType, Function, R> mapper) {
actions.put(expectedType, mapper);
}
Multiplexer orMappedTo(Class expectedType, Function mapper) {
actions.put(expectedType, mapper);
return this;
}
R requireAny() {
if (typeOfValue() == null) {
throw multiplexFailure();
}
Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy