2 * Copyright (c) 2013 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
8 package org.opendaylight.controller.yang.model.util;
11 import java.util.ArrayList;
12 import java.util.List;
14 import org.opendaylight.controller.yang.common.QName;
15 import org.opendaylight.controller.yang.model.api.SchemaPath;
17 public final class BaseTypes {
19 private BaseTypes() {}
21 public static final URI BaseTypesNamespace = URI
22 .create("urn:ietf:params:xml:ns:yang:1");
25 * Construct QName for Built-in base Yang type. The namespace for
26 * built-in base yang types is defined as: urn:ietf:params:xml:ns:yang:1
28 * @param typeName yang type name
29 * @return built-in base yang type QName.
31 public static final QName constructQName(final String typeName) {
32 return new QName(BaseTypesNamespace, typeName);
36 * Creates Schema Path from Qname.
38 * @param typeName yang type QName
39 * @return Schema Path from Qname.
41 public static final SchemaPath schemaPath(final QName typeName) {
42 final List<QName> pathList = new ArrayList<QName>();
43 pathList.add(typeName);
44 return new SchemaPath(pathList, true);