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.IdentitySchemaNode
20 @(identity: IdentitySchemaNode)
21 identity @{identity.getQName().getLocalName()} {
22 @if(identity.getBaseIdentity() != null) {
23 base "(@writeIdentityNs(identity.getBaseIdentity()))@{identity.getBaseIdentity()}";
25 @if(identity.getDescription() != null && !identity.getDescription().isEmpty()) {
26 description "@{identity.getDescription()}";
28 @if(identity.getReference() != null && !identity.getReference().isEmpty()) {
29 reference "@{identity.getReference()}";
31 @if(identity.getStatus() != null) {
32 status @{identity.getStatus()};
36 @writeIdentityNs(identity: IdentitySchemaNode) = {
37 @if(identity.getQName().getNamespace() != null) {
38 @{identity.getQName().getNamespace()}: