Bug 1459-1 - Re-organize mdsal-binding2-spec
[mdsal.git] / binding2 / mdsal-binding2-java-api-generator / src / main / twirl / org / opendaylight / mdsal / binding2 / classTemplateInitBlock.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 @import org.opendaylight.mdsal.binding2.util.BindingMapping.MEMBER_PATTERN_LIST
10 @import org.opendaylight.mdsal.binding2.util.BindingMapping.PATTERN_CONSTANT_NAME
11
12 @(patterName: String)
13 static {
14     final @{patterName} a[] = new @{patterName}[@{PATTERN_CONSTANT_NAME}.size()];
15     int i = 0;
16     for (String regEx : @{PATTERN_CONSTANT_NAME}) {
17         a[i++] = Pattern.compile(regEx);
18     }
19
20     @{MEMBER_PATTERN_LIST} = a;
21 }