2 * Copyright (c) 2016 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.netconf.sal.restconf.impl;
10 import java.util.List;
11 import org.opendaylight.yangtools.yang.common.QName;
12 import org.opendaylight.yangtools.yang.model.api.ConstraintDefinition;
13 import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode;
14 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
15 import org.opendaylight.yangtools.yang.model.api.Status;
16 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
17 import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
18 import org.opendaylight.yangtools.yang.model.util.type.BaseTypes;
21 * Special case only use by GET restconf/operations (since moment of old Yang
22 * parser and old yang model API removal) to build and use fake leaf like child
26 class LeafSchemaNodeImpl implements LeafSchemaNode {
28 private final SchemaPath path;
29 private final QName qname;
32 * Base values for fake leaf schema node
39 LeafSchemaNodeImpl(final SchemaPath basePath, final QName qname) {
40 this.path = basePath.createChild(qname);
45 public boolean isAugmenting() {
50 public boolean isAddedByUses() {
55 public boolean isConfiguration() {
60 public ConstraintDefinition getConstraints() {
61 throw new UnsupportedOperationException("Not supported.");
65 public QName getQName() {
70 public SchemaPath getPath() {
75 public List<UnknownSchemaNode> getUnknownSchemaNodes() {
76 throw new UnsupportedOperationException("Not supported.");
80 public String getDescription() {
81 throw new UnsupportedOperationException("Not supported operations.");
85 public String getReference() {
86 throw new UnsupportedOperationException("Not supported.");
90 public Status getStatus() {
91 throw new UnsupportedOperationException("Not supported.");
95 public TypeDefinition<?> getType() {
96 return BaseTypes.emptyType();
100 public String getDefault() {
101 throw new UnsupportedOperationException("Not supported.");
105 public String getUnits() {
106 throw new UnsupportedOperationException("Not supported.");