org.raml.parser.rule
Class DefaultTupleRule<K extends Node,V extends Node>
java.lang.Object
org.raml.parser.rule.DefaultTupleRule<K,V>
- All Implemented Interfaces:
- NodeRule<V>, TupleRule<K,V>
- Direct Known Subclasses:
- ImplicitMapEntryRule, MapTupleRule, PojoTupleRule, SequenceTupleRule, SimpleRule, UnknownTupleRule, UriParametersRule
public class DefaultTupleRule<K extends Node,V extends Node>
- extends Object
- implements TupleRule<K,V>
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
rules
protected Map<String,TupleRule<?,?>> rules
DefaultTupleRule
public DefaultTupleRule(String name,
TupleHandler handler,
NodeRuleFactory nodeRuleFactory)
DefaultTupleRule
public DefaultTupleRule(String name,
TupleHandler handler)
getMissingRuleMessage
public static String getMissingRuleMessage(String ruleName)
isRequired
public boolean isRequired()
setRequired
public void setRequired(boolean required)
- Specified by:
setRequired in interface TupleRule<K extends Node,V extends Node>
setNodeRuleFactory
public void setNodeRuleFactory(NodeRuleFactory nodeRuleFactory)
- Specified by:
setNodeRuleFactory in interface TupleRule<K extends Node,V extends Node>
setNestedRules
public void setNestedRules(Map<String,TupleRule<?,?>> rules)
- Specified by:
setNestedRules in interface TupleRule<K extends Node,V extends Node>
setHandler
public void setHandler(TupleHandler tupleHandler)
- Specified by:
setHandler in interface TupleRule<K extends Node,V extends Node>
getHandler
public TupleHandler getHandler()
- Specified by:
getHandler in interface TupleRule<K extends Node,V extends Node>
validateKey
public List<ValidationResult> validateKey(K key)
- Specified by:
validateKey in interface TupleRule<K extends Node,V extends Node>
validateValue
public List<ValidationResult> validateValue(V key)
- Description copied from interface:
NodeRule
- Validates the given value
- Specified by:
validateValue in interface NodeRule<V extends Node>
- Parameters:
key - The value to validate
- Returns:
onRuleEnd
public List<ValidationResult> onRuleEnd()
- Description copied from interface:
NodeRule
- Called when the ruled was ended to verify all mandatory fields are present
- Specified by:
onRuleEnd in interface NodeRule<V extends Node>
- Returns:
getKey
public K getKey()
- Specified by:
getKey in interface TupleRule<K extends Node,V extends Node>
addRulesFor
public void addRulesFor(Class<?> pojoClass)
getNodeRuleFactory
public NodeRuleFactory getNodeRuleFactory()
getRuleForTuple
public TupleRule<?,?> getRuleForTuple(NodeTuple nodeTuple)
- Specified by:
getRuleForTuple in interface TupleRule<K extends Node,V extends Node>
setParentTupleRule
public void setParentTupleRule(TupleRule<?,?> parent)
- Specified by:
setParentTupleRule in interface TupleRule<K extends Node,V extends Node>
getName
public String getName()
- Specified by:
getName in interface TupleRule<K extends Node,V extends Node>
getRuleByFieldName
public TupleRule<?,?> getRuleByFieldName(String fieldName)
- Specified by:
getRuleByFieldName in interface TupleRule<K extends Node,V extends Node>
getParentTupleRule
public TupleRule<?,?> getParentTupleRule()
- Specified by:
getParentTupleRule in interface TupleRule<K extends Node,V extends Node>
Copyright © 2013. All rights reserved.