public abstract class AbstractSyntaxChecker extends Object implements SyntaxChecker
All other syntax checkers inherit from this class. Its only purpose is to
check whether the type of the keyword's value is of the expected type(s).
More advanced syntax checkers will override checkValue(
Message.Builder, List, JsonNode) to further check the anatomy of this value.
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractSyntaxChecker(String keyword,
NodeType type,
NodeType... types) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkSyntax(Message.Builder msg,
List<Message> messages,
JsonNode schema)
Check the syntax for this keyword
|
abstract void |
checkValue(Message.Builder msg,
List<Message> messages,
JsonNode schema) |
protected final String keyword
public final void checkSyntax(Message.Builder msg, List<Message> messages, JsonNode schema)
SyntaxCheckerWhen entering this function, the message template passed as an
argument will have already been filled with the matching validation
domain (here, Domain.SYNTAX) and the keyword.
checkSyntax in interface SyntaxCheckermsg - the validation message templatemessages - message list to fill in the event of a failureschema - schema to analyzeMessagepublic abstract void checkValue(Message.Builder msg, List<Message> messages, JsonNode schema)
Copyright © 2013. All Rights Reserved.