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.yangtools.yang.parser.impl;
10 import com.google.common.base.Preconditions;
11 import java.util.Deque;
12 import java.util.LinkedList;
13 import org.opendaylight.yangtools.yang.common.QName;
14 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
17 * @deprecated Pre-Beryllium implementation, scheduled for removal.
20 final class SchemaPathStack {
21 private final Deque<SchemaPath> paths = new LinkedList<>();
23 SchemaPath addNodeToPath(final QName name) {
24 SchemaPath sp = paths.pop();
25 sp = sp.createChild(name);
30 QName removeNodeFromPath() {
31 SchemaPath sp = paths.pop();
32 QName ret = sp.getLastComponent();
33 paths.push(Preconditions.checkNotNull(sp.getParent(), "Attempted to remove too many nodes from schemapath at stack %s", paths));
37 SchemaPath currentSchemaPath() {
46 paths.push(SchemaPath.ROOT);