Class NegatedExpressionReader
java.lang.Object
ch.andre601.expressionparser.parsers.ValueReader
ch.andre601.expressionparser.parsers.NegatedExpressionReader
ValueReader
creating a negated ExpressionTemplate
when the first token is the provided one.-
Constructor Summary
ConstructorDescriptionNegatedExpressionReader
(Token negationToken) Sets theToken
that this ValueReader should look for. -
Method Summary
Modifier and TypeMethodDescriptionread
(ExpressionTemplateParser parser, List<Token> tokens, ParseWarnCollector collector) Takes the first entry of thelist of Tokens
and returns anegated ExpressionTemplate
if the retrieved token is the set negation Token, elsenull
.
-
Constructor Details
-
NegatedExpressionReader
Sets theToken
that this ValueReader should look for.- Parameters:
negationToken
- Token this ValueReader should look for.
-
-
Method Details
-
read
public ExpressionTemplate read(ExpressionTemplateParser parser, List<Token> tokens, ParseWarnCollector collector) Takes the first entry of thelist of Tokens
and returns anegated ExpressionTemplate
if the retrieved token is the set negation Token, elsenull
.- Specified by:
read
in classValueReader
- Parameters:
parser
- ExpressionTemplateParser instance to use. The default ExpressionTemplateParser provides itself here.tokens
- List of tokens to parse into an ExpressionTemplate.collector
-ParseWarnCollector
instance to use.- Returns:
- Possibly-null, negated
ExpressionTemplate
.
-