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

xpertss.json.schema.keyword.digest.helpers.NullDigester Maven / Gradle / Ivy

The newest version!
package xpertss.json.schema.keyword.digest.helpers;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.NullNode;
import com.github.fge.jackson.NodeType;
import xpertss.json.schema.keyword.digest.AbstractDigester;

/**
 * A digester returning a {@link NullNode} for any input
 *
 * 

This is actually useful for keywords like {@code anyOf}, {@code allOf} and * {@code oneOf}, which only roles are to validate subschemas: they do not need * a digested form at all, they just have to peek at the schema.

* *

A net result of all keywords using this digester is that only one instance * will ever be built.

*/ public final class NullDigester extends AbstractDigester { public NullDigester(String keyword, NodeType first, NodeType... other) { super(keyword, first, other); } @Override public JsonNode digest(JsonNode schema) { return FACTORY.nullNode(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy