@Beta public final class JavaIdentifierNormalizer extends Object
type enumeration { enum foo; enum Foo; }
Modifier and Type | Field and Description |
---|---|
static Set<String> |
SPECIAL_RESERVED_PATHS |
Modifier and Type | Method and Description |
---|---|
static String |
normalizeEnumValueIdentifier(String name,
List<Enumeration.Pair> values)
According to YANG RFC 7950,
all assigned names in an enumeration MUST be unique.
|
static String |
normalizeFullPackageName(String fullPackageName)
Normalizing full package name by non java chars and reserved keywords.
|
static String |
normalizeSpecificIdentifier(String identifier,
JavaIdentifier javaIdentifier)
Find and convert non Java chars in identifiers of generated transfer objects, initially
derived from corresponding YANG.
|
public static String normalizeEnumValueIdentifier(String name, List<Enumeration.Pair> values)
According to YANG RFC 7950,
all assigned names in an enumeration MUST be unique. Created names are contained in the list
of Enumeration.Pair
. This method adds actual index with underscore behind name of new
enum value only if this name already exists in one of the list of Enumeration.Pair
.
Then, the name will be converted to java chars according to JavaIdentifier.ENUM_VALUE
and returned.
type enumeration { enum foo; enum Foo; }YANG enum values will be mapped to 'FOO' and 'FOO_1' Java enum values.
name
- - name of new enum valuevalues
- - list of all actual enum valuespublic static String normalizeFullPackageName(String fullPackageName)
fullPackageName
- - full package namepublic static String normalizeSpecificIdentifier(String identifier, JavaIdentifier javaIdentifier)
identifier
- - name of identifierjavaIdentifier
- - java type of identifierCopyright © 2019 OpenDaylight. All rights reserved.