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.Collections;
12 import java.util.Date;
13 import java.util.List;
15 import org.opendaylight.controller.yang.common.QName;
16 import org.opendaylight.controller.yang.model.api.RevisionAwareXPath;
17 import org.opendaylight.controller.yang.model.api.SchemaPath;
18 import org.opendaylight.controller.yang.model.api.Status;
19 import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;
20 import org.opendaylight.controller.yang.model.api.type.InstanceIdentifierTypeDefinition;
23 * The <code>default</code> implementation of Instance Identifier Type Definition interface.
25 * @see InstanceIdentifierTypeDefinition
27 public class InstanceIdentifier implements InstanceIdentifierTypeDefinition {
29 private static final QName name = BaseTypes
30 .constructQName("instance-identifier");
31 private static final String description = "The instance-identifier built-in type is used to " +
32 "uniquely identify a particular instance node in the data tree.";
33 private static final String reference = "https://tools.ietf.org/html/rfc6020#section-9.13";
35 private final transient SchemaPath path;
36 private final RevisionAwareXPath xpath;
37 private final String units = "";
38 private final InstanceIdentifierTypeDefinition baseType;
39 private final boolean requireInstance;
41 private InstanceIdentifier(RevisionAwareXPath xpath, boolean requireInstance) {
43 path = BaseTypes.schemaPath(name);
45 this.requireInstance = requireInstance;
49 public InstanceIdentifier(final List<String> actualPath, final URI namespace,
50 final Date revision, RevisionAwareXPath xpath, boolean requireInstance) {
52 path = BaseTypes.schemaPath(actualPath, namespace, revision);
54 this.requireInstance = requireInstance;
55 this.baseType = new InstanceIdentifier(xpath, requireInstance);
61 * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()
64 public InstanceIdentifierTypeDefinition getBaseType() {
71 * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getUnits()
74 public String getUnits() {
81 * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()
84 public Object getDefaultValue() {
91 * @see org.opendaylight.controller.yang.model.api.SchemaNode#getQName()
94 public QName getQName() {
101 * @see org.opendaylight.controller.yang.model.api.SchemaNode#getPath()
104 public SchemaPath getPath() {
111 * @see org.opendaylight.controller.yang.model.api.SchemaNode#getDescription()
114 public String getDescription() {
121 * @see org.opendaylight.controller.yang.model.api.SchemaNode#getReference()
124 public String getReference() {
131 * @see org.opendaylight.controller.yang.model.api.SchemaNode#getStatus()
134 public Status getStatus() {
135 return Status.CURRENT;
141 * @see org.opendaylight.controller.yang.model.api.SchemaNode#getExtensionSchemaNodes()
144 public List<UnknownSchemaNode> getUnknownSchemaNodes() {
145 return Collections.emptyList();
151 * @see org.opendaylight.controller.yang.model.api.type.InstanceIdentifierTypeDefinition#
155 public RevisionAwareXPath getPathStatement() {
162 * @see org.opendaylight.controller.yang.model.api.type.InstanceIdentifierTypeDefinition#
166 public boolean requireInstance() {
167 return requireInstance;