@Beta public final class BindingGeneratorUtil extends Object
Modifier and Type | Method and Description |
---|---|
static long |
computeDefaultSUID(GeneratedTypeBuilderBase<?> to) |
static String |
encodeAngleBrackets(String description)
Encodes angle brackets in yang statement description.
|
static Restrictions |
getRestrictions(org.opendaylight.yangtools.yang.model.api.TypeDefinition<?> type) |
static String |
packageNameForAugmentedGeneratedType(String parentAugmentPackageName,
org.opendaylight.yangtools.yang.model.api.AugmentationSchemaNode augmentationSchema)
Creates package name from
parentAugmentPackageName (package
name for direct parent augmentation) and augmentationSchema . |
static String |
packageNameForAugmentedGeneratedType(String basePackageName,
org.opendaylight.yangtools.yang.model.api.SchemaPath schemaPath)
Creates package name from specified
basePackageName (package
name for module) and schemaPath which crosses an augmentation. |
static String |
packageNameForGeneratedType(String basePackageName,
org.opendaylight.yangtools.yang.model.api.SchemaPath schemaPath,
BindingNamespaceType namespaceType)
Creates package name from specified
basePackageName (package
name for module) and schemaPath . |
static String |
packageNameForSubGeneratedType(String basePackageName,
org.opendaylight.yangtools.yang.model.api.SchemaNode node,
BindingNamespaceType namespaceType) |
static String |
packageNameWithNamespacePrefix(String basePackageName,
BindingNamespaceType namespaceType)
Creates package name from specified
basePackageName (package
name for module) and namespaceType . |
static String |
replaceAllIllegalChars(CharSequence stringBuilder) |
static String |
replacePackageTopNamespace(String basePackageName,
String toReplacePackageName,
BindingNamespaceType toReplaceNameSpace,
BindingNamespaceType replacedNameSpace) |
public static String encodeAngleBrackets(String description)
description
- description of a yang statement which is used to generate javadoc commentspublic static long computeDefaultSUID(GeneratedTypeBuilderBase<?> to)
public static String packageNameForGeneratedType(String basePackageName, org.opendaylight.yangtools.yang.model.api.SchemaPath schemaPath, BindingNamespaceType namespaceType)
basePackageName
(package
name for module) and schemaPath
.
Resulting package name is concatenation of basePackageName
and all local names of YANG nodes which are parents of some node for
which schemaPath
is specified.
Based on type of node, there is also possible suffix added in order to prevent package name conflicts.
basePackageName
- string with package name of the module, MUST be normalized,
otherwise this method may return an invalid string.schemaPath
- list of names of YANG nodes which are parents of some node +
name of this nodeNullPointerException
- if any of the arguments are nullpublic static String packageNameWithNamespacePrefix(String basePackageName, BindingNamespaceType namespaceType)
basePackageName
(package
name for module) and namespaceType
.
Resulting package name is concatenation of basePackageName
and prefix of namespaceType
.
basePackageName
- string with package name of the module, MUST be normalized,
otherwise this method may return an invalid string.namespaceType
- the namespace to which the module belongsNullPointerException
- if any of the arguments are nullpublic static Restrictions getRestrictions(org.opendaylight.yangtools.yang.model.api.TypeDefinition<?> type)
public static String packageNameForAugmentedGeneratedType(String basePackageName, org.opendaylight.yangtools.yang.model.api.SchemaPath schemaPath)
basePackageName
(package
name for module) and schemaPath
which crosses an augmentation.
Resulting package name is concatenation of basePackageName
and all local names of YANG nodes which are parents of some node for
which schemaPath
is specified.
Based on type of node, there is also possible suffix added in order to prevent package name conflicts.
basePackageName
- string with package name of the module, MUST be normalized,
otherwise this method may return an invalid string.schemaPath
- list of names of YANG nodes which are parents of some node +
name of this nodeNullPointerException
- if any of the arguments are nullpublic static String packageNameForAugmentedGeneratedType(String parentAugmentPackageName, org.opendaylight.yangtools.yang.model.api.AugmentationSchemaNode augmentationSchema)
parentAugmentPackageName
(package
name for direct parent augmentation) and augmentationSchema
.
Resulting package name is concatenation of parentAugmentPackageName
and the local name of schemaPath
.
Based on type of node, there is also possible suffix added in order to prevent package name conflicts.
parentAugmentPackageName
- string with package name of direct parent augmentation, MUST be normalized,
otherwise this method may return an invalid string.augmentationSchema
- augmentation schema which is direct son of parent augmentation.NullPointerException
- if any of the arguments are nullpublic static String packageNameForSubGeneratedType(String basePackageName, org.opendaylight.yangtools.yang.model.api.SchemaNode node, BindingNamespaceType namespaceType)
public static String replacePackageTopNamespace(String basePackageName, String toReplacePackageName, BindingNamespaceType toReplaceNameSpace, BindingNamespaceType replacedNameSpace)
public static String replaceAllIllegalChars(CharSequence stringBuilder)
Copyright © 2019 OpenDaylight. All rights reserved.