public final class KeywordBuilder extends Object implements Thawed<Keyword>
Keyword
Note that you may only supply a SyntaxChecker
for a keyword, but
if you supply a validator class, the digester must also be present.
Modifier and Type | Method and Description |
---|---|
Keyword |
freeze()
Build a frozen version of this builder
|
KeywordBuilder |
withDigester(Digester digester)
Add a digester to this builder
|
KeywordBuilder |
withIdentityDigester(NodeType first,
NodeType... other)
Set this keyword's digester to be an
IdentityDigester |
KeywordBuilder |
withSimpleDigester(NodeType first,
NodeType... other)
Set this keyword's digester to be a
SimpleDigester |
KeywordBuilder |
withSyntaxChecker(SyntaxChecker syntaxChecker)
Add a syntax checker to this builder
|
KeywordBuilder |
withValidatorClass(Class<? extends KeywordValidator> c)
Set the validator class for this keyword
|
KeywordBuilder |
withValidatorFactory(KeywordValidatorFactory factory)
Set the validator factory for this keyword
|
public KeywordBuilder withSyntaxChecker(SyntaxChecker syntaxChecker)
syntaxChecker
- the syntax checkerNullPointerException
- syntax checker is nullpublic KeywordBuilder withDigester(Digester digester)
digester
- the digesterNullPointerException
- digester is nullpublic KeywordBuilder withIdentityDigester(NodeType first, NodeType... other)
IdentityDigester
first
- the first instance type supported by this keywordother
- other instance types supported by this keywordNullPointerException
- one or more type(s) are nullpublic KeywordBuilder withSimpleDigester(NodeType first, NodeType... other)
SimpleDigester
first
- the first instance type supported by this keywordother
- other instance types supported by this keywordNullPointerException
- one or more type(s) are nullpublic KeywordBuilder withValidatorClass(Class<? extends KeywordValidator> c)
c
- the classNullPointerException
- class is nullIllegalArgumentException
- failed to find an appropriate
constructorpublic KeywordBuilder withValidatorFactory(KeywordValidatorFactory factory)
factory
- the factorypublic Keyword freeze()
freeze
in interface Thawed<Keyword>
Keyword
IllegalArgumentException
- no syntax checker; or a constructor has
been supplied without a digesterKeyword.Keyword(KeywordBuilder)