xpertss.json.schema.keyword.digest.helpers.IdentityDigester Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of json-schema Show documentation
Show all versions of json-schema Show documentation
A Java implementation of the JSON Schema specification.
The newest version!
package xpertss.json.schema.keyword.digest.helpers;
import com.fasterxml.jackson.databind.JsonNode;
import com.github.fge.jackson.NodeType;
import xpertss.json.schema.keyword.digest.AbstractDigester;
/**
* A "no-op" digester
*
* This is the most simple of digesters, which will return its input as the
* digested forms. If you choose to use it, you will therefore only have to
* provide the list of types supported by your keyword.
*/
public final class IdentityDigester extends AbstractDigester {
/**
* Constructor
*
* @param keyword the name for this keyword
* @param first the first supported type
* @param other other supported types, if any
*/
public IdentityDigester(String keyword, NodeType first, NodeType... other)
{
super(keyword, first, other);
}
@Override
public JsonNode digest(JsonNode schema)
{
return schema;
}
}