xpertss.json.schema.format.FormatAttribute 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.format;
import com.github.fge.jackson.NodeType;
import xpertss.json.schema.core.exceptions.ProcessingException;
import xpertss.json.schema.core.report.ProcessingReport;
import xpertss.json.schema.processors.data.FullData;
import com.github.fge.msgsimple.bundle.MessageBundle;
import java.util.EnumSet;
/**
* Interface for a format attribute validator
*/
public interface FormatAttribute {
/**
* Return the set of JSON Schema types this format attribute applies to
*
* It is important that this method be implemented correctly. Remind
* that validation for a given format attribute and an instance which type
* is not supported always succeeds.
*
* @return the set of supported types
*/
EnumSet supportedTypes();
/**
* Validate the instance against this format attribute
*
* @param report the report to use
* @param bundle the message bundle to use
* @param data the validation data
* @throws ProcessingException an exception occurs (normally, never for a
* format attribute)
*/
void validate(ProcessingReport report, MessageBundle bundle, FullData data)
throws ProcessingException;
}