public class ObjectRule extends Rule
| Constructor and Description |
|---|
ObjectRule() |
ObjectRule(boolean strict) |
| 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. |
String |
getDescription() |
protected Node |
getResult(Node node) |
List<Suggestion> |
getSuggestions(List<Node> pathToRoot,
RamlParsingContext context)
Returns the list of suggestions after navigating through the path
|
List<Suggestion> |
getSuggestions(Node node,
RamlParsingContext context)
Returns the suggestions of this specific rule
|
boolean |
matches(Node node)
Check if the current rule matches the specified node
|
ObjectRule |
merge(ObjectRule objectRule) |
void |
setAllowsAdditionalProperties(boolean allowsAdditionalProperties) |
void |
setStrict(boolean strict) |
ObjectRule |
then(Class<? extends Node> clazz) |
ObjectRule |
then(NodeFactory factory) |
ObjectRule |
with(ConditionalRules conditional) |
ObjectRule |
with(KeyValueRule field) |
createNodeUsingFactory@Nonnull public List<Suggestion> getSuggestions(Node node, RamlParsingContext context)
RulegetSuggestions in class Rulenode - The nodecontext - The parse contextpublic boolean matches(@Nonnull Node node)
Rulepublic Node apply(@Nonnull Node node)
RuleObjectRule, ArrayRule, KeyValueRule) replace child nodes.public ObjectRule then(Class<? extends Node> clazz)
public ObjectRule then(NodeFactory factory)
public ObjectRule with(KeyValueRule field)
public List<Suggestion> getSuggestions(List<Node> pathToRoot, RamlParsingContext context)
RulegetSuggestions in class RulepathToRoot - The path of nodes to get of the node from where we want the suggestionscontext - The parse contextpublic String getDescription()
getDescription in class Rulepublic void setStrict(boolean strict)
public void setAllowsAdditionalProperties(boolean allowsAdditionalProperties)
public ObjectRule with(ConditionalRules conditional)
public ObjectRule merge(ObjectRule objectRule)
Copyright © 2016. All rights reserved.