Class YangNames
java.lang.Object
org.opendaylight.yangtools.yang.common.YangNames
Utility class for handling various naming conventions mentioned in YANG and related specifications.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final @NonNull com.google.common.base.CharMatcherACharMatchermatching the first character of a YANGidentifierABNF production,(ALPHA / "_").static final @NonNull com.google.common.base.CharMatcherACharMatcherNOT matching second and later characters of a YANGidentifierABNF production,(ALPHA / DIGIT / "_" / "-" / "."). -
Method Summary
Modifier and TypeMethodDescriptionparseFilename(String baseName) Parse a file name according to rules outlined in https://www.rfc-editor.org/rfc/rfc6020#section-5.2.
-
Field Details
-
IDENTIFIER_START
public static final @NonNull com.google.common.base.CharMatcher IDENTIFIER_STARTACharMatchermatching the first character of a YANGidentifierABNF production,(ALPHA / "_"). -
NOT_IDENTIFIER_PART
public static final @NonNull com.google.common.base.CharMatcher NOT_IDENTIFIER_PARTACharMatcherNOT matching second and later characters of a YANGidentifierABNF production,(ALPHA / DIGIT / "_" / "-" / ".").
-
-
Method Details
-
parseFilename
Parse a file name according to rules outlined in https://www.rfc-editor.org/rfc/rfc6020#section-5.2. Input string should be the base path with file extension stripped.- Parameters:
baseName- file base name- Returns:
- A tuple containing the module name and parsed revision, if present.
- Throws:
NullPointerException- ifbaseNameis null
-