cbb5122a2dd79a2f7255eeb1a1288896679e0175
[mdsal.git] / binding2 / mdsal-binding2-java-api-generator / src / main / twirl / org / opendaylight / mdsal / binding / javav2 / java / api / yang / yangTemplateWriteTypeDef.scala.txt
1 @*
2  * Copyright (c) 2017 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.TypeDefinition
17
18 @(typeDefinition: TypeDefinition[_])
19 typedef @(typeDefinition.getQName().getLocalName()) {
20     @yangTemplateWriteType(typeDefinition)
21     @if(typeDefinition.getDefaultValue() != null) {
22         default "@(typeDefinition.getDefaultValue())";
23     }
24     @if(typeDefinition.getDescription() != null) {
25         default "@(typeDefinition.getDescription())";
26     }
27     @if(typeDefinition.getReference() != null) {
28         default "@(typeDefinition.getReference())";
29     }
30 }