2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 @**********************************************************
10 * Twirl YangTemplate for generating yang snippets. *
11 * Twirl is transformed to Scala and compiled. Then, *
12 * it can be called from Java with particular input *
13 * parameters to render desired output code. *
15 * Note: we should introduce our own format instead of txt *
16 ***********************************************************@
18 @import org.opendaylight.mdsal.binding2.generator.impl.util.YangTextTemplate
19 @import org.opendaylight.yangtools.yang.model.api.AugmentationSchema
21 @(augments: Set[_ <: AugmentationSchema])
22 @for(augment <- augments) {
23 @if(augment != null) {
24 augment @{YangTextTemplate.formatToAugmentPath(augment.getTargetPath().getPathFromRoot())} {
25 @if(augment.getWhenCondition() != null && !augment.getWhenCondition().toString().isEmpty()) {
26 when "@augment.getWhenCondition().toString()";
28 @if(augment.getDescription() != null && !augment.getDescription().isEmpty()) {
29 description "@augment.getDescription().toString()";
31 @if(augment.getReference() != null && !augment.getReference().isEmpty()) {
32 reference "@augment.getReference().toString()";
34 @if(augment.getStatus() != null) {
35 status "@augment.getStatus()";
37 @if(augment.getChildNodes() != null && !augment.getChildNodes().isEmpty()) {
38 @yangTemplateWriteDataSchemaNodes(augment.getChildNodes())
40 @if(augment.getUses() != null && !augment.getUses().isEmpty()) {
41 @yangTemplateWriteUsesNodes(augment.getUses())