public final class ListenerValidation extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
checkStackIsEmpty(TreeWalkListener listener,
ListenerErrorType errorType,
YangConstructType yangConstructType,
String parsableDataTypeName,
ListenerErrorLocation errorLocation)
Checks parsed data stack is empty.
|
static void |
checkStackIsNotEmpty(TreeWalkListener listener,
ListenerErrorType errorType,
YangConstructType yangConstructType,
String parsableDataTypeName,
ListenerErrorLocation errorLocation)
Checks parsed data stack is not empty.
|
static boolean |
getParentNodeConfig(TreeWalkListener listener)
Returns parent node config value, if top node does not specify a config
statement then default value true is returned.
|
static void |
validateCardinalityEitherOne(List<?> child1Context,
YangConstructType yangChild1Construct,
List<?> child2Context,
YangConstructType yangChild2Construct,
YangConstructType yangParentConstruct,
String parentName,
org.antlr.v4.runtime.ParserRuleContext parentContext)
Checks if a either of one construct occurrence.
|
static void |
validateCardinalityEqualsOne(List<?> childContext,
YangConstructType yangChildConstruct,
YangConstructType yangParentConstruct,
String parentName,
org.antlr.v4.runtime.ParserRuleContext parentContext)
Checks if a rule occurrences is exactly 1.
|
static void |
validateCardinalityMaxOne(List<?> childContext,
YangConstructType yangChildConstruct,
YangConstructType yangParentConstruct,
String parentName)
Checks if a rule occurrences is as per the expected YANG grammar's
cardinality.
|
static void |
validateCardinalityNonZero(List<?> childContext,
YangConstructType yangChildConstruct,
YangConstructType yangParentConstruct,
String parentName,
org.antlr.v4.runtime.ParserRuleContext parentContext)
Checks if a rule occurrences is minimum 1.
|
public static void checkStackIsNotEmpty(TreeWalkListener listener, ListenerErrorType errorType, YangConstructType yangConstructType, String parsableDataTypeName, ListenerErrorLocation errorLocation)
listener - Listener's objecterrorType - error type needs to be set in error messageyangConstructType - type of parsable data in which error occurredparsableDataTypeName - name of parsable data type in which error
occurrederrorLocation - location where error occurredpublic static void checkStackIsEmpty(TreeWalkListener listener, ListenerErrorType errorType, YangConstructType yangConstructType, String parsableDataTypeName, ListenerErrorLocation errorLocation)
listener - Listener's objecterrorType - error type needs to be set in error messageyangConstructType - type of parsable data in which error occurredparsableDataTypeName - name of parsable data type in which error
occurrederrorLocation - location where error occurredpublic static boolean getParentNodeConfig(TreeWalkListener listener)
listener - listener's objectpublic static void validateCardinalityMaxOne(List<?> childContext, YangConstructType yangChildConstruct, YangConstructType yangParentConstruct, String parentName) throws ParserException
childContext - child's contextyangChildConstruct - child construct for whom cardinality is to be
validatedyangParentConstruct - parent constructparentName - parent nameParserException - exception if cardinality check failspublic static void validateCardinalityEqualsOne(List<?> childContext, YangConstructType yangChildConstruct, YangConstructType yangParentConstruct, String parentName, org.antlr.v4.runtime.ParserRuleContext parentContext) throws ParserException
childContext - child's contextyangChildConstruct - child construct for whom cardinality is to be
validatedyangParentConstruct - parent constructparentName - parent nameparentContext - parents's contextParserException - exception if cardinality check failspublic static void validateCardinalityNonZero(List<?> childContext, YangConstructType yangChildConstruct, YangConstructType yangParentConstruct, String parentName, org.antlr.v4.runtime.ParserRuleContext parentContext) throws ParserException
childContext - child's contextyangChildConstruct - child construct for whom cardinality is to be
validatedyangParentConstruct - parent constructparentName - parent nameparentContext - parents's contextParserException - exception if cardinality check failspublic static void validateCardinalityEitherOne(List<?> child1Context, YangConstructType yangChild1Construct, List<?> child2Context, YangConstructType yangChild2Construct, YangConstructType yangParentConstruct, String parentName, org.antlr.v4.runtime.ParserRuleContext parentContext) throws ParserException
child1Context - first optional child's contextyangChild1Construct - first child construct for whom cardinality is
to be validatedchild2Context - second optional child's contextyangChild2Construct - second child construct for whom cardinality is
to be validatedyangParentConstruct - parent constructparentName - parent nameparentContext - parents's contextParserException - exception if cardinality check failsCopyright © 2016. All rights reserved.