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;
10 import java.util.Collections;
11 import java.util.List;
13 import org.opendaylight.controller.yang.common.QName;
14 import org.opendaylight.controller.yang.model.api.RevisionAwareXPath;
15 import org.opendaylight.controller.yang.model.api.SchemaPath;
16 import org.opendaylight.controller.yang.model.api.Status;
17 import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;
18 import org.opendaylight.controller.yang.model.api.type.InstanceIdentifierTypeDefinition;
21 * The <code>default</code> implementation of Instance Identifier Type Definition interface.
23 * @see InstanceIdentifierTypeDefinition
25 public final class InstanceIdentifier implements InstanceIdentifierTypeDefinition {
27 private static final QName name = BaseTypes
28 .constructQName("instance-identifier");
29 private static final String description = "The instance-identifier built-in type is used to " +
30 "uniquely identify a particular instance node in the data tree.";
31 private static final String reference = "https://tools.ietf.org/html/rfc6020#section-9.13";
33 private final transient SchemaPath path;
34 private final RevisionAwareXPath xpath;
35 private final String units = "";
36 private final InstanceIdentifierTypeDefinition baseType;
37 private final boolean requireInstance;
39 private InstanceIdentifier(RevisionAwareXPath xpath, boolean requireInstance) {
41 path = BaseTypes.schemaPath(name);
43 this.requireInstance = requireInstance;
47 public InstanceIdentifier(final SchemaPath path, RevisionAwareXPath xpath, boolean requireInstance) {
51 this.requireInstance = requireInstance;
52 this.baseType = new InstanceIdentifier(xpath, requireInstance);
58 * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()
61 public InstanceIdentifierTypeDefinition getBaseType() {
68 * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getUnits()
71 public String getUnits() {
78 * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()
81 public Object getDefaultValue() {
88 * @see org.opendaylight.controller.yang.model.api.SchemaNode#getQName()
91 public QName getQName() {
98 * @see org.opendaylight.controller.yang.model.api.SchemaNode#getPath()
101 public SchemaPath getPath() {
108 * @see org.opendaylight.controller.yang.model.api.SchemaNode#getDescription()
111 public String getDescription() {
118 * @see org.opendaylight.controller.yang.model.api.SchemaNode#getReference()
121 public String getReference() {
128 * @see org.opendaylight.controller.yang.model.api.SchemaNode#getStatus()
131 public Status getStatus() {
132 return Status.CURRENT;
138 * @see org.opendaylight.controller.yang.model.api.SchemaNode#getExtensionSchemaNodes()
141 public List<UnknownSchemaNode> getUnknownSchemaNodes() {
142 return Collections.emptyList();
148 * @see org.opendaylight.controller.yang.model.api.type.InstanceIdentifierTypeDefinition#
152 public RevisionAwareXPath getPathStatement() {
159 * @see org.opendaylight.controller.yang.model.api.type.InstanceIdentifierTypeDefinition#
163 public boolean requireInstance() {
164 return requireInstance;