public final class ListenerUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static Date |
getCurrentDateForRevision()
Returns current date and makes it in usable format for revision.
|
static String |
getPrefixInFileOfTheCurrentNode(YangNode node)
Returns the prefix of the current file.
|
static List<YangAtomicPath> |
getValidAbsoluteSchemaNodeId(String argumentString,
YangConstructType yangConstructType,
org.antlr.v4.runtime.ParserRuleContext ctx)
Checks and return valid absolute schema node id.
|
static boolean |
getValidBooleanValue(String booleanValue,
YangConstructType yangConstruct,
org.antlr.v4.runtime.ParserRuleContext ctx)
Validates boolean value.
|
static Date |
getValidDateFromString(String dateInString,
org.antlr.v4.runtime.ParserRuleContext ctx)
Returns date and makes it in usable format for revision.
|
static String |
getValidIdentifier(String identifier,
YangConstructType yangConstruct,
org.antlr.v4.runtime.ParserRuleContext ctx)
Validates identifier and returns concatenated string if string contains plus symbol.
|
static String |
getValidIdentifierForLeafref(String identifier,
YangConstructType yangConstruct,
org.antlr.v4.runtime.ParserRuleContext ctx,
YangLeafRef yangLeafRef)
Validates identifier and returns concatenated string if string contains plus symbol.
|
static int |
getValidIntegerValue(String integerValue,
YangConstructType yangConstruct,
org.antlr.v4.runtime.ParserRuleContext ctx)
Validates integer value.
|
static YangNodeIdentifier |
getValidNodeIdentifier(String nodeIdentifierString,
YangConstructType yangConstruct,
org.antlr.v4.runtime.ParserRuleContext ctx)
Checks and return valid node identifier.
|
static YangNodeIdentifier |
getValidNodeIdentifierForLeafref(String nodeIdentifierString,
YangConstructType yangConstruct,
org.antlr.v4.runtime.ParserRuleContext ctx,
YangLeafRef yangLeafRef)
Checks and return valid node identifier specific to nodes in leafref path.
|
static int |
getValidNonNegativeIntegerValue(String integerValue,
YangConstructType yangConstruct,
org.antlr.v4.runtime.ParserRuleContext ctx)
Validates non negative integer value.
|
static String |
getValidPrefix(String inputString,
YangConstructType yangConstruct,
org.antlr.v4.runtime.ParserRuleContext ctx)
Checks and return valid prefix.
|
static byte |
getValidVersion(GeneratedYangParser.YangVersionStatementContext ctx)
Validates YANG version.
|
static void |
handleUnsupportedYangConstruct(YangConstructType yangConstructType,
org.antlr.v4.runtime.ParserRuleContext ctx,
String errorInfo,
String fileName)
Throws parser exception for unsupported YANG constructs.
|
static boolean |
isDateValid(String dateToValidate)
Validates the revision date.
|
static String |
removeQuotesAndHandleConcat(String yangStringData)
Removes doubles quotes and concatenates if string has plus symbol.
|
static void |
validatePathArgument(String pathString,
YangConstructType yangConstruct,
org.antlr.v4.runtime.ParserRuleContext ctx,
YangLeafRef yangLeafRef)
Validates the path argument.
|
static void |
validateUniqueInList(YangList yangList,
org.antlr.v4.runtime.ParserRuleContext ctx)
Validates unique field from the list.
|
public static String removeQuotesAndHandleConcat(String yangStringData)
yangStringData - string from yang filepublic static String getValidIdentifier(String identifier, YangConstructType yangConstruct, org.antlr.v4.runtime.ParserRuleContext ctx)
identifier - string from yang fileyangConstruct - yang construct for creating error messagectx - yang construct's context to get the line number and character positionpublic static String getValidIdentifierForLeafref(String identifier, YangConstructType yangConstruct, org.antlr.v4.runtime.ParserRuleContext ctx, YangLeafRef yangLeafRef)
identifier - string from yang fileyangConstruct - yang construct for creating error messagectx - yang construct's context to get the line number and character positionyangLeafRef - instance of leafref where the path argument has to be setpublic static boolean isDateValid(String dateToValidate)
dateToValidate - input revision datepublic static byte getValidVersion(GeneratedYangParser.YangVersionStatementContext ctx)
ctx - version context object of the grammar rulepublic static int getValidNonNegativeIntegerValue(String integerValue, YangConstructType yangConstruct, org.antlr.v4.runtime.ParserRuleContext ctx)
integerValue - integer to be validatedyangConstruct - yang construct for creating error messagectx - context object of the grammar rulepublic static int getValidIntegerValue(String integerValue, YangConstructType yangConstruct, org.antlr.v4.runtime.ParserRuleContext ctx)
integerValue - integer to be validatedyangConstruct - yang construct for creating error messagectx - context object of the grammar rulepublic static boolean getValidBooleanValue(String booleanValue, YangConstructType yangConstruct, org.antlr.v4.runtime.ParserRuleContext ctx)
booleanValue - value to be validatedyangConstruct - yang construct for creating error messagectx - context object of the grammar rulepublic static Date getCurrentDateForRevision()
public static YangNodeIdentifier getValidNodeIdentifier(String nodeIdentifierString, YangConstructType yangConstruct, org.antlr.v4.runtime.ParserRuleContext ctx)
nodeIdentifierString - string from yang fileyangConstruct - yang construct for creating error messagectx - yang construct's context to get the line number and character positionpublic static YangNodeIdentifier getValidNodeIdentifierForLeafref(String nodeIdentifierString, YangConstructType yangConstruct, org.antlr.v4.runtime.ParserRuleContext ctx, YangLeafRef yangLeafRef)
nodeIdentifierString - string from yang fileyangConstruct - yang construct for creating error messagectx - yang construct's context to get the line number and character positionyangLeafRef - instance of leafref where the path argument has to be setpublic static void validatePathArgument(String pathString, YangConstructType yangConstruct, org.antlr.v4.runtime.ParserRuleContext ctx, YangLeafRef yangLeafRef)
pathString - the path string from the path typeyangConstruct - yang construct for creating error messagectx - yang construct's context to get the line number and character positionyangLeafRef - instance of leafref where the path argument has to be setpublic static void validateUniqueInList(YangList yangList, org.antlr.v4.runtime.ParserRuleContext ctx)
yangList - instance of YANG listctx - yang construct's context to get the line number and character positionpublic static String getPrefixInFileOfTheCurrentNode(YangNode node)
node - node where it needs to find the root nodepublic static List<YangAtomicPath> getValidAbsoluteSchemaNodeId(String argumentString, YangConstructType yangConstructType, org.antlr.v4.runtime.ParserRuleContext ctx)
argumentString - string from yang fileyangConstructType - yang construct for creating error messagectx - yang construct's context to get the line number and character positionpublic static void handleUnsupportedYangConstruct(YangConstructType yangConstructType, org.antlr.v4.runtime.ParserRuleContext ctx, String errorInfo, String fileName)
yangConstructType - yang construct for creating error messagectx - yang construct's context to get the line number and character positionerrorInfo - error informationfileName - YANG file namepublic static Date getValidDateFromString(String dateInString, org.antlr.v4.runtime.ParserRuleContext ctx)
dateInString - date argument string from yang filectx - yang construct's context to get the line number and character positionpublic static String getValidPrefix(String inputString, YangConstructType yangConstruct, org.antlr.v4.runtime.ParserRuleContext ctx)
inputString - string from yang fileyangConstruct - yang construct for creating error messagectx - yang construct's context to get the line number and character positionCopyright © 2016. All rights reserved.