/** * 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; }
/** * 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; }
/** * 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); } }
/** * 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); } }
for (AugmentationSchema augmentation : currentModule.getAugmentations()) { Collection<DataSchemaNode> childNodes = augmentation.getChildNodes(); if (areAllChildrenChoiceCaseNodes(childNodes)) {
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()); }
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, " ");