本文整理了Java中org.opendaylight.yangtools.yang.model.api.Module.getAugmentations()
方法的一些代码示例,展示了Module.getAugmentations()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Module.getAugmentations()
方法的具体详情如下:
包路径:org.opendaylight.yangtools.yang.model.api.Module
类名称:Module
方法名:getAugmentations
[英]Returns AugmentationSchema
instances which contain data from augment statements defined in the module.
[中]返回AugmentationSchema
个实例,这些实例包含模块中定义的增强语句中的数据。
代码示例来源:origin: org.opendaylight.mdsal/mdsal-binding-generator-impl
/**
* Returns list of <code>AugmentationSchema</code> objects. The objects are
* sorted according to the length of their target path from the shortest to
* the longest.
*
* @param module
* module from which is obtained list of all augmentation objects
* @return list of sorted <code>AugmentationSchema</code> objects obtained
* from <code>module</code>
* @throws IllegalArgumentException
* if module is null
* @throws IllegalStateException
* if set of module augmentations is null
*/
private static List<AugmentationSchemaNode> resolveAugmentations(final Module module) {
checkArgument(module != null, "Module reference cannot be NULL.");
checkState(module.getAugmentations() != null, "Augmentations Set cannot be NULL.");
final Set<AugmentationSchemaNode> augmentations = module.getAugmentations();
final List<AugmentationSchemaNode> sortedAugmentations = new ArrayList<>(augmentations);
sortedAugmentations.sort(AUGMENT_COMP);
return sortedAugmentations;
}
代码示例来源:origin: org.opendaylight.yangtools/binding-generator-impl
/**
* Returns list of <code>AugmentationSchema</code> objects. The objects are
* sorted according to the length of their target path from the shortest to
* the longest.
*
* @param module
* module from which is obtained list of all augmentation objects
* @return list of sorted <code>AugmentationSchema</code> objects obtained
* from <code>module</code>
* @throws IllegalArgumentException
* if module is null
* @throws IllegalStateException
* if set of module augmentations is null
*/
private List<AugmentationSchema> resolveAugmentations(final Module module) {
checkArgument(module != null, "Module reference cannot be NULL.");
checkState(module.getAugmentations() != null, "Augmentations Set cannot be NULL.");
final Set<AugmentationSchema> augmentations = module.getAugmentations();
final List<AugmentationSchema> sortedAugmentations = new ArrayList<>(augmentations);
Collections.sort(sortedAugmentations, Comparators.AUGMENT_COMP);
return sortedAugmentations;
}
代码示例来源:origin: org.opendaylight.mdsal/mdsal-binding-generator-impl
/**
* Converts all <b>augmentation</b> of the module to the list
* <code>Type</code> objects.
*
* @param module
* module from which is obtained list of all augmentation objects
* to iterate over them
* @throws IllegalArgumentException
* <ul>
* <li>if the module is null</li>
* <li>if the name of module is null</li>
* </ul>
* @throws IllegalStateException
* if set of augmentations from module is null
*/
private void allAugmentsToGenTypes(final ModuleContext context) {
final Module module = context.module();
checkArgument(module != null, "Module reference cannot be NULL.");
checkArgument(module.getName() != null, "Module name cannot be NULL.");
checkState(module.getAugmentations() != null, "Augmentations Set cannot be NULL.");
for (final AugmentationSchemaNode augment : resolveAugmentations(module)) {
augmentationToGenTypes(context, augment);
}
}
代码示例来源:origin: org.opendaylight.yangtools/binding-generator-impl
/**
* Converts all <b>augmentation</b> of the module to the list
* <code>Type</code> objects.
*
* @param module
* module from which is obtained list of all augmentation objects
* to iterate over them
* @throws IllegalArgumentException
* <ul>
* <li>if the module is null</li>
* <li>if the name of module is null</li>
* </ul>
* @throws IllegalStateException
* if set of augmentations from module is null
*/
private void allAugmentsToGenTypes(final Module module) {
checkArgument(module != null, "Module reference cannot be NULL.");
checkArgument(module.getName() != null, "Module name cannot be NULL.");
checkState(module.getAugmentations() != null, "Augmentations Set cannot be NULL.");
final String basePackageName = BindingMapping.getRootPackageName(module.getQNameModule());
final List<AugmentationSchema> augmentations = resolveAugmentations(module);
for (final AugmentationSchema augment : augmentations) {
augmentationToGenTypes(basePackageName, augment, module);
}
}
代码示例来源:origin: org.opendaylight.controller/yang-jmx-generator
for (AugmentationSchema augmentation : currentModule.getAugmentations()) {
Collection<DataSchemaNode> childNodes = augmentation.getChildNodes();
if (areAllChildrenChoiceCaseNodes(childNodes)) {
代码示例来源:origin: org.opendaylight.yangtools/yang-model-export
private void emitBodyNodes(final Module input) {
for (final ExtensionDefinition extension : input.getExtensionSchemaNodes()) {
emitExtension(extension);
}
for (final FeatureDefinition definition : input.getFeatures()) {
emitFeature(definition);
}
for (final IdentitySchemaNode identity : input.getIdentities()) {
emitIdentity(identity);
}
for (final Deviation deviation : input.getDeviations()) {
emitDeviation(deviation);
}
emitDataNodeContainer(input);
for (final AugmentationSchemaNode augmentation : input.getAugmentations()) {
emitAugment(augmentation);
}
for (final RpcDefinition rpc : input.getRpcs()) {
emitRpc(rpc);
}
emitNotifications(input.getNotifications());
}
代码示例来源:origin: org.opendaylight.yangtools/binding-generator-impl
Set<AugmentationSchema> _augmentations = module.getAugmentations();
boolean _isNullOrEmpty_3 = IterableExtensions.isNullOrEmpty(_augmentations);
boolean _not_3 = (!_isNullOrEmpty_3);
_builder.newLine();
_builder.append(" ");
Set<AugmentationSchema> _augmentations_1 = module.getAugmentations();
CharSequence _writeAugments = YangTemplate.writeAugments(_augmentations_1);
_builder.append(_writeAugments, " ");
内容来源于网络,如有侵权,请联系作者删除!