public final class KeywordBundle extends Object
You can either create a new, completely empty, keyword bundle, or use one of the default bundles and extend it. For instance:
final KeywordBundle bundle = KeywordBundles.defaultBundle();
final Keyword k1 = ...;
final Keyword k2 = ...;
bundle.registerKeyword(k1);
bundle.registerKeyword(k2);
Keyword,
KeywordBundles,
JsonSchemaFactory| Modifier and Type | Field and Description |
|---|---|
private Map<String,SyntaxChecker> |
syntaxCheckers |
private Map<String,Class<? extends KeywordValidator>> |
validators |
| Constructor and Description |
|---|
KeywordBundle() |
| Modifier and Type | Method and Description |
|---|---|
(package private) KeywordBundle |
copy()
Package-private method to generate a full copy of this bundle
|
Map<String,SyntaxChecker> |
getSyntaxCheckers()
Get the list of syntax checkers for this bundle
|
Map<String,Class<? extends KeywordValidator>> |
getValidators()
Get the list of keyword validators for this bundle
|
void |
mergeWith(KeywordBundle other)
Merge with another keyword bundle
|
void |
registerKeyword(Keyword keyword)
Register a keyword for this bundle
|
void |
unregisterKeyword(String name)
Unregister a keyword
|
private final Map<String,SyntaxChecker> syntaxCheckers
private final Map<String,Class<? extends KeywordValidator>> validators
KeywordBundle copy()
public void registerKeyword(Keyword keyword)
Note that if a keyword by the same name already exists, its syntax
validator and keyword validator will be reset to the new values (and
unregistered if any of these is null).
keyword - the keyword to registerKeyword.Builder,
Keywordpublic void unregisterKeyword(String name)
name - the name of the keyword to unregisterpublic void mergeWith(KeywordBundle other)
Note: this operation is potentially dangerous if you are not careful. This method blindingly replaces the existing bundle's syntax checkers and keyword validators with those of the other bundle. Use with care!
other - the other bundlepublic Map<String,SyntaxChecker> getSyntaxCheckers()
public Map<String,Class<? extends KeywordValidator>> getValidators()
Copyright © 2012. All Rights Reserved.