xpertss.json.schema.processors.data.SchemaDigest 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.processors.data;
import com.fasterxml.jackson.databind.JsonNode;
import xpertss.json.schema.core.report.MessageProvider;
import xpertss.json.schema.core.report.ProcessingMessage;
import xpertss.json.schema.processors.build.ValidatorBuilder;
import xpertss.json.schema.processors.digest.SchemaDigester;
import com.google.common.collect.ImmutableMap;
import java.util.Map;
/**
* Output of {@link SchemaDigester} and input of {@link ValidatorBuilder}
*
* It bundles a {@link SchemaContext} and a map of digested nodes for keyword
* construction.
*/
public final class SchemaDigest implements MessageProvider {
private final SchemaContext context;
private final Map digested;
public SchemaDigest(SchemaContext context, Map map)
{
this.context = context;
digested = ImmutableMap.copyOf(map);
}
public SchemaContext getContext()
{
return context;
}
public Map getDigests()
{
return digested;
}
@Override
public ProcessingMessage newMessage()
{
return context.newMessage();
}
}