/** * Converts individual grouping to GeneratedType. Firstly generated type * builder is created and every child node of grouping is resolved to the * method. * * @param basePackageName * string contains the module package name * @param grouping * GroupingDefinition which contains data about grouping * @param module * current module * @return GeneratedType which is generated from grouping (object of type * <code>GroupingDefinition</code>) */ private void groupingToGenType(final String basePackageName, final GroupingDefinition grouping, final Module module) { final String packageName = packageNameForGeneratedType(basePackageName, grouping.getPath()); final GeneratedTypeBuilder genType = addDefaultInterfaceDefinition(packageName, grouping, module); genCtx.get(module).addGroupingType(grouping.getPath(), genType); resolveDataSchemaNodes(module, basePackageName, genType, genType, grouping.getChildNodes()); groupingsToGenTypes(module, grouping.getGroupings()); processUsesAugments(grouping, module); }
/** * Converts all <b>groupings</b> of the module to the list of * <code>Type</code> objects. Firstly are groupings sorted according mutual * dependencies. At least dependent (independent) groupings are in the list * saved at first positions. For every grouping the record is added to map * {@link ModuleContext#groupings allGroupings} * * @param module * current module * @param groupings * collection of groupings from which types will be generated * */ private void groupingsToGenTypes(final ModuleContext context, final Collection<GroupingDefinition> groupings) { for (final GroupingDefinition grouping : new GroupingDefinitionDependencySort().sort(groupings)) { // Converts individual grouping to GeneratedType. Firstly generated type builder is created and every child // node of grouping is resolved to the method. final GeneratedTypeBuilder genType = addDefaultInterfaceDefinition(context, grouping); annotateDeprecatedIfNecessary(grouping.getStatus(), genType); context.addGroupingType(grouping, genType); resolveDataSchemaNodes(context, genType, genType, grouping.getChildNodes()); groupingsToGenTypes(context, grouping.getGroupings()); processUsesAugments(grouping, context); actionsToGenType(context, genType, grouping, null); } }
_builder.newLineIfNotEmpty(); Set<GroupingDefinition> _groupings = groupingDef.getGroupings(); boolean _isNullOrEmpty = IterableExtensions.isNullOrEmpty(_groupings); boolean _not = (!_isNullOrEmpty); if (_not) { _builder.append(" "); Set<GroupingDefinition> _groupings_1 = groupingDef.getGroupings(); CharSequence _writeGroupingDefs = YangTemplate.writeGroupingDefs(_groupings_1); _builder.append(_writeGroupingDefs, " ");