com.github.fge.jsonschema.format.helpers
Class HexStringFormatAttribute
java.lang.Object
com.github.fge.jsonschema.format.AbstractFormatAttribute
com.github.fge.jsonschema.format.helpers.HexStringFormatAttribute
- All Implemented Interfaces:
- FormatAttribute
- Direct Known Subclasses:
- MD5FormatAttribute, SHA1FormatAttribute, SHA256FormatAttribute, SHA512FormatAttribute
public abstract class HexStringFormatAttribute
- extends AbstractFormatAttribute
Base class for hexadecimal string-based representations
This class is particularly useful to validate hexadecimal-based string
data. The only two constructor arguments you have to specify are a short
description of the validated string and its expected length.
In this package, it is used for validating MD5, SHA1, SHA256 and SHA512
checksums, which are very commonly represented in form of hexadecimal strings
of fixed length.
Field Summary |
protected int |
length
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
length
protected final int length
HexStringFormatAttribute
protected HexStringFormatAttribute(String fmt,
int length)
validate
public final void validate(ProcessingReport report,
MessageBundle bundle,
FullData data)
throws ProcessingException
- Description copied from interface:
FormatAttribute
- Validate the instance against this format attribute
- Parameters:
report
- the report to usebundle
- the message bundle to usedata
- the validation data
- Throws:
ProcessingException
- an exception occurs (normally, never for a
format attribute)