Eliminate XtendHelper and SchemaLock
[mdsal.git] / binding2 / mdsal-binding2-java-api-generator / src / main / twirl / org / opendaylight / mdsal / binding / javav2 / java / api / yang / 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
16 @import org.opendaylight.mdsal.binding.javav2.generator.util.FormattingUtils
17 @import org.opendaylight.yangtools.yang.model.api.AugmentationSchemaNode
18 @import org.opendaylight.yangtools.yang.model.api.Module
19 @import org.opendaylight.yangtools.yang.model.api.Status
20
21 @(augments: Set[_ <: AugmentationSchemaNode], module: Module)
22 @for(augment <- augments) {
23     @if(augment != null) {
24         augment "@{FormattingUtils.formatToAugmentPath(augment.getTargetPath().getPathFromRoot())}" {
25             @if(augment.getWhenCondition() != null && !augment.getWhenCondition().toString().isEmpty()) {
26                 when "@augment.getWhenCondition().toString()";
27             }
28             @if(augment.getDescription().isPresent()) {
29                 description "@augment.getDescription().get()";
30             }
31             @if(augment.getReference().isPresent()) {
32                 reference "@augment.getReference().get()";
33             }
34             @if(augment.getStatus() != Status.CURRENT) {
35                 status "@augment.getStatus()";
36             }
37             @if(augment.getChildNodes() != null && !augment.getChildNodes().isEmpty()) {
38                 @yangTemplateWriteDataSchemaNodes(augment.getChildNodes(), module)
39             }
40             @if(augment.getUses() != null && !augment.getUses().isEmpty()) {
41                 @yangTemplateWriteUsesNodes(augment.getUses(), module)
42             }
43             @if(augment.getActions() != null && !augment.getActions().isEmpty()) {
44                 @yangTemplateWriteActions(augment.getActions(), module)
45             }
46         }
47     }
48 }