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.yangtools.yang.model.api.NotificationDefinition
19 @import org.opendaylight.yangtools.yang.model.api.Status
21 @(notification: NotificationDefinition)
22 notification @{notification.getQName().getLocalName()} {
23 @if(notification.getDescription() != null && !notification.getDescription().isEmpty()) {
24 description "@{notification.getDescription()}";
26 @if(notification.getChildNodes() != null && !notification.getChildNodes().isEmpty()) {
27 @yangTemplateWriteDataSchemaNodes(notification.getChildNodes())
29 @if(notification.getAvailableAugmentations() != null && !notification.getAvailableAugmentations().isEmpty()) {
30 @yangTemplateWriteAugments(notification.getAvailableAugmentations())
32 @if(notification.getGroupings() != null && !notification.getGroupings().isEmpty()) {
33 @yangTemplateWriteGroupingDefs(notification.getGroupings())
35 @if(notification.getUses() != null && !notification.getUses().isEmpty()) {
36 @yangTemplateWriteUsesNodes(notification.getUses())
38 @if(notification.getReference() != null && !notification.getReference().isEmpty()) {
39 reference "@{notification.getReference()}";
41 @if(notification.getStatus() != Status.CURRENT) {
42 status @{notification.getStatus()};