public abstract class AbstractFormatAttribute extends Object implements FormatAttribute
You should really use this class instead of implementing FormatAttribute
directly. Its main, but important, helping role is to
build the list of supported types for you.
Modifier | Constructor and Description |
---|---|
protected |
AbstractFormatAttribute(String fmt,
com.github.fge.jsonschema.util.NodeType first,
com.github.fge.jsonschema.util.NodeType... other)
Protected constructor
|
Modifier and Type | Method and Description |
---|---|
protected <T> com.github.fge.jsonschema.report.ProcessingMessage |
newMsg(FullData data,
T message)
Return a new message for this format attribute
|
EnumSet<com.github.fge.jsonschema.util.NodeType> |
supportedTypes()
Return the set of JSON Schema types this format attribute applies to
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
validate
protected AbstractFormatAttribute(String fmt, com.github.fge.jsonschema.util.NodeType first, com.github.fge.jsonschema.util.NodeType... other)
fmt
- the name for this format attributefirst
- first supported typeother
- other supported types, if anysupportedTypes()
public final EnumSet<com.github.fge.jsonschema.util.NodeType> supportedTypes()
FormatAttribute
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.
supportedTypes
in interface FormatAttribute
protected final <T> com.github.fge.jsonschema.report.ProcessingMessage newMsg(FullData data, T message)
T
- the type of the messagedata
- the validation contextmessage
- the messageFormatMessages
Copyright © 2014. All Rights Reserved.