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. *
14 ***********************************************************@
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
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()";
28 @if(augment.getDescription().isPresent()) {
29 description "@augment.getDescription().get()";
31 @if(augment.getReference().isPresent()) {
32 reference "@augment.getReference().get()";
34 @if(augment.getStatus() != Status.CURRENT) {
35 status "@augment.getStatus()";
37 @if(augment.getChildNodes() != null && !augment.getChildNodes().isEmpty()) {
38 @yangTemplateWriteDataSchemaNodes(augment.getChildNodes(), module)
40 @if(augment.getUses() != null && !augment.getUses().isEmpty()) {
41 @yangTemplateWriteUsesNodes(augment.getUses(), module)
43 @if(augment.getActions() != null && !augment.getActions().isEmpty()) {
44 @yangTemplateWriteActions(augment.getActions(), module)