/** * Create a new schema tree with a given loading URI and JSON Schema * * @param ref the location * @param node the schema * @return a new tree */ public SchemaTree newTree(final JsonRef ref, final JsonNode node) { return newTree(SchemaKey.forJsonRef(ref), node); }
/** * Create a new schema tree with a given loading URI and JSON Schema * * @param ref the location * @param node the schema * @return a new tree */ public SchemaTree newTree(final JsonRef ref, final JsonNode node) { return newTree(SchemaKey.forJsonRef(ref), node); }
/** * Create a new schema tree with a given loading URI and JSON Schema * * @param ref the location * @param node the schema * @return a new tree */ public SchemaTree newTree(final JsonRef ref, final JsonNode node) { return newTree(SchemaKey.forJsonRef(ref), node); }
protected abstract SchemaTree newTree(SchemaKey key, JsonNode node);
protected abstract SchemaTree newTree(SchemaKey key, JsonNode node);
protected abstract SchemaTree newTree(SchemaKey key, JsonNode node);
/** * Create a new tree from a schema * * <p>Note that it will always create an "anonymous" tree, that is a tree * with an empty loading URI.</p> * * @param schema the schema * @return a new tree * @see Dereferencing#newTree(JsonNode) * @throws NullPointerException schema is null */ public SchemaTree load(final JsonNode schema) { BUNDLE.checkNotNull(schema, "loadingCfg.nullSchema"); return dereferencing.newTree(schema); }
/** * Create a new tree from a schema * * <p>Note that it will always create an "anonymous" tree, that is a tree * with an empty loading URI.</p> * * @param schema the schema * @return a new tree * @see Dereferencing#newTree(JsonNode) * @throws NullPointerException schema is null */ public SchemaTree load(final JsonNode schema) { BUNDLE.checkNotNull(schema, "loadingCfg.nullSchema"); return dereferencing.newTree(schema); }
/** * Create a new tree from a schema * * <p>Note that it will always create an "anonymous" tree, that is a tree * with an empty loading URI.</p> * * @param schema the schema * @return a new tree * @see Dereferencing#newTree(JsonNode) * @throws NullPointerException schema is null */ public SchemaTree load(final JsonNode schema) { BUNDLE.checkNotNull(schema, "loadingCfg.nullSchema"); return dereferencing.newTree(schema); }
/** * Get a schema tree from the given URI * * <p>Note that if the URI is relative, it will be resolved against this * registry's namespace, if any.</p> * * @param uri the URI * @return a schema tree * @throws ProcessingException URI is not an absolute JSON reference, or * failed to dereference this URI * @throws NullPointerException URI is null */ public SchemaTree get(final URI uri) throws ProcessingException { final JsonRef ref = JsonRef.fromURI(translator.translate(uri)); if (!ref.isAbsolute()) throw new ProcessingException(new ProcessingMessage() .setMessage(BUNDLE.getMessage("refProcessing.uriNotAbsolute")) .putArgument("uri", ref)); final URI realURI = ref.toURI(); try { JsonNode node = preloadedSchemas.get(realURI); if (node == null) node = cache.get(realURI); return dereferencing.newTree(ref, node); } catch (ExecutionException e) { throw (ProcessingException) e.getCause(); } }
/** * Get a schema tree from the given URI * * <p>Note that if the URI is relative, it will be resolved against this * registry's namespace, if any.</p> * * @param uri the URI * @return a schema tree * @throws ProcessingException URI is not an absolute JSON reference, or * failed to dereference this URI * @throws NullPointerException URI is null */ public SchemaTree get(final URI uri) throws ProcessingException { final JsonRef ref = JsonRef.fromURI(translator.translate(uri)); if (!ref.isAbsolute()) throw new ProcessingException(new ProcessingMessage() .setMessage(BUNDLE.getMessage("refProcessing.uriNotAbsolute")) .putArgument("uri", ref)); final URI realURI = ref.toURI(); try { JsonNode node = preloadedSchemas.get(realURI); if (node == null) node = cache.get(realURI); return dereferencing.newTree(ref, node); } catch (ExecutionException e) { throw (ProcessingException) e.getCause(); } }
/** * Get a schema tree from the given URI * * <p>Note that if the URI is relative, it will be resolved against this * registry's namespace, if any.</p> * * @param uri the URI * @return a schema tree * @throws ProcessingException URI is not an absolute JSON reference, or * failed to dereference this URI * @throws NullPointerException URI is null */ public SchemaTree get(final URI uri) throws ProcessingException { final JsonRef ref = JsonRef.fromURI(translator.translate(uri)); if (!ref.isAbsolute()) throw new ProcessingException(new ProcessingMessage() .setMessage(BUNDLE.getMessage("refProcessing.uriNotAbsolute")) .putArgument("uri", ref)); final URI realURI = ref.toURI(); try { JsonNode node = preloadedSchemas.get(realURI); if (node == null) node = cache.get(realURI); return dereferencing.newTree(ref, node); } catch (ExecutionException e) { throw (ProcessingException) e.getCause(); } }