2 * Copyright (c) 2019 PANTHEON.tech, s.r.o. 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.rfc7950.stmt.path;
10 import static java.util.Objects.requireNonNull;
12 import com.google.common.base.MoreObjects.ToStringHelper;
13 import org.opendaylight.yangtools.yang.model.util.AbstractPathExpression;
14 import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.ArgumentUtils;
16 final class UnparsedPathExpression extends AbstractPathExpression {
17 private final RuntimeException cause;
18 private final boolean absolute;
20 UnparsedPathExpression(final String originalString, final RuntimeException cause) {
21 super(originalString);
22 this.cause = requireNonNull(cause);
23 absolute = ArgumentUtils.isAbsoluteXPath(originalString);
27 public boolean isAbsolute() {
32 public Steps getSteps() {
33 throw new UnsupportedOperationException("Expression '" + getOriginalString() + "' was not parsed", cause);
37 protected ToStringHelper addToStringAttributes(final ToStringHelper helper) {
38 return super.addToStringAttributes(helper.add("absolute", absolute)).add("cause", cause);