c9ca4a10a50b23c1f6bf65fe48b6e0dae8e6f199
[mdsal.git] / binding2 / mdsal-binding2-generator-impl / src / main / twirl / org / opendaylight / mdsal / binding / javav2 / generator / impl / yangTemplateWriteNotification.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.yangtools.yang.model.api.NotificationDefinition
17 @import org.opendaylight.yangtools.yang.model.api.Module
18 @import org.opendaylight.yangtools.yang.model.api.Status
19
20 @(notification: NotificationDefinition, module: Module)
21 notification @{notification.getQName().getLocalName()} {
22     @if(notification.getDescription() != null && !notification.getDescription().isEmpty()) {
23         description "@{notification.getDescription()}";
24     }
25     @if(notification.getChildNodes() != null && !notification.getChildNodes().isEmpty()) {
26         @yangTemplateWriteDataSchemaNodes(notification.getChildNodes(), module)
27     }
28     @if(notification.getAvailableAugmentations() != null && !notification.getAvailableAugmentations().isEmpty()) {
29         @yangTemplateWriteAugments(notification.getAvailableAugmentations(), module)
30     }
31     @if(notification.getGroupings() != null && !notification.getGroupings().isEmpty()) {
32         @yangTemplateWriteGroupingDefs(notification.getGroupings(), module)
33     }
34     @if(notification.getUses() != null && !notification.getUses().isEmpty()) {
35         @yangTemplateWriteUsesNodes(notification.getUses(), module)
36     }
37     @if(notification.getReference() != null && !notification.getReference().isEmpty()) {
38         reference "@{notification.getReference()}";
39     }
40     @if(notification.getStatus() != Status.CURRENT) {
41         status @{notification.getStatus()};
42     }
43 }