public class RegexValueRule extends Rule
| Constructor and Description |
|---|
RegexValueRule(Pattern value) |
| Modifier and Type | Method and Description |
|---|---|
Node |
apply(Node node)
Applies the rule to the node using the following criteria
- if rule does not match returns an ErrorNode and stops processing
- if rule matches, applies rules to children
- if rule contains a NodeFactory, returns the result of it
- else returns node
Only structure rules (
ObjectRule, ArrayRule, KeyValueRule) replace child nodes. |
RegexValueRule |
description(String description) |
RegexValueRule |
fullMatch(boolean fullMatch) |
String |
getDescription()
Returns a description of this rule
|
List<Suggestion> |
getSuggestions(Node node,
ParsingContext context)
Returns the suggestions of this specific rule
|
RegexValueRule |
label(String value) |
boolean |
matches(Node node)
Check if the current rule matches the specified node
|
RegexValueRule |
suggest(String value) |
cleanFactory, createNodeUsingFactory, getChildren, getFactory, getSuggestions, named, ruleName, then, then, toStringpublic RegexValueRule(Pattern value)
@Nonnull public List<Suggestion> getSuggestions(Node node, ParsingContext context)
RulegetSuggestions in class Rulenode - The nodecontext - The parse contextpublic boolean matches(@Nonnull Node node)
Rulepublic RegexValueRule label(String value)
public RegexValueRule suggest(String value)
public RegexValueRule description(String description)
public RegexValueRule fullMatch(boolean fullMatch)
public Node apply(@Nonnull Node node)
RuleObjectRule, ArrayRule, KeyValueRule) replace child nodes.public String getDescription()
RulegetDescription in class RuleCopyright © 2017. All rights reserved.