@Override public JsonRef apply(final SchemaContext input) { return input.getSchema().getDollarSchema(); } };
@Override protected int doHash(final SchemaContext t) { return t.getSchema().hashCode() ^ t.getInstanceType().hashCode(); } }
@Override public SchemaDigest process(final ProcessingReport report, final SchemaContext input) throws ProcessingException { final JsonNode schema = input.getSchema().getNode(); final NodeType type = input.getInstanceType(); final Map<String, JsonNode> map = Maps.newHashMap(buildDigests(schema)); map.keySet().retainAll(typeMap.get(type)); return new SchemaDigest(input, map); }
@Override public ValidatorList process(final ProcessingReport report, final ValidatorList input) throws ProcessingException { final SchemaContext context = input.getContext(); final JsonNode node = context.getSchema().getNode().get("format"); if (node == null) return input; final String fmt = node.textValue(); final FormatAttribute attr = attributes.get(fmt); if (attr == null) { report.warn(input.newMessage().put("domain", "validation") .put("keyword", "format") .setMessage(bundle.getMessage("warn.format.notSupported")) .putArgument("attribute", fmt)); return input; } final NodeType type = context.getInstanceType(); if (!attr.supportedTypes().contains(type)) return input; final List<KeywordValidator> validators = Lists.newArrayList(input); validators.add(formatValidator(attr)); return new ValidatorList(context, validators); }
@Override public ValidatorList process(final ProcessingReport report, final SchemaContext input) throws ProcessingException { final ValueHolder<SchemaTree> in = ValueHolder.hold("schema", input.getSchema()); /* * We have to go through an intermediate report. If we re-enter this * function with a report already telling there is an error, we don't * want to wrongly report that the schema is invalid. */ final ProcessingReport r = new ListProcessingReport(report); final ValueHolder<SchemaTree> out = resolver.process(r, in); report.mergeWith(r); if (!r.isSuccess()) return null; final SchemaContext output = new SchemaContext(out.getValue(), input.getInstanceType()); return builder.process(report, output); }
final FullData data = new FullData(newContext.getSchema(), input.getInstance(), input.isDeepCheck());