Bug 1411-4: MDSAL Binding2 Generator Impl
[mdsal.git] / binding2 / mdsal-binding2-generator-impl / src / main / twirl / org / opendaylight / mdsal / binding2 / yangTemplateWriteAugments.scala.txt
1 @*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  *@
8
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.               *
14 *                                                         *
15 * Note: we should introduce our own format instead of txt *
16 ***********************************************************@
17
18 @import org.opendaylight.mdsal.binding2.generator.impl.util.YangTextTemplate
19 @import org.opendaylight.yangtools.yang.model.api.AugmentationSchema
20
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()";
27             }
28             @if(augment.getDescription() != null && !augment.getDescription().isEmpty()) {
29                 description "@augment.getDescription().toString()";
30             }
31             @if(augment.getReference() != null && !augment.getReference().isEmpty()) {
32                 reference "@augment.getReference().toString()";
33             }
34             @if(augment.getStatus() != null) {
35                 status "@augment.getStatus()";
36             }
37             @if(augment.getChildNodes() != null && !augment.getChildNodes().isEmpty()) {
38                 @yangTemplateWriteDataSchemaNodes(augment.getChildNodes())
39             }
40             @if(augment.getUses() != null && !augment.getUses().isEmpty()) {
41                 @yangTemplateWriteUsesNodes(augment.getUses())
42             }
43         }
44     }
45 }