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.restconf.nb.rfc8040.services.simple.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
25 final class FakeLeafSchemaNode implements LeafSchemaNode {
27 private final SchemaPath path;
30 * Base values for fake leaf schema node.
35 FakeLeafSchemaNode(final QName qname) {
36 this.path = FakeContainerSchemaNode.PATH.createChild(qname);
40 public boolean isAugmenting() {
45 public boolean isAddedByUses() {
50 public boolean isConfiguration() {
55 public ConstraintDefinition getConstraints() {
56 throw new UnsupportedOperationException("Not supported.");
60 public QName getQName() {
61 return path.getLastComponent();
65 public SchemaPath getPath() {
70 public List<UnknownSchemaNode> getUnknownSchemaNodes() {
71 throw new UnsupportedOperationException("Not supported.");
75 public String getDescription() {
76 throw new UnsupportedOperationException("Not supported operations.");
80 public String getReference() {
81 throw new UnsupportedOperationException("Not supported.");
85 public Status getStatus() {
86 throw new UnsupportedOperationException("Not supported.");
90 public TypeDefinition<?> getType() {
91 return BaseTypes.emptyType();
95 public String getDefault() {
96 throw new UnsupportedOperationException("Not supported.");
100 public String getUnits() {
101 throw new UnsupportedOperationException("Not supported.");