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.model.api;
10 import com.google.common.annotations.Beta;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.opendaylight.yangtools.concepts.Immutable;
13 import org.opendaylight.yangtools.yang.xpath.api.YangBinaryOperator;
14 import org.opendaylight.yangtools.yang.xpath.api.YangFunction;
15 import org.opendaylight.yangtools.yang.xpath.api.YangLocationPath;
16 import org.opendaylight.yangtools.yang.xpath.api.YangLocationPath.QNameStep;
17 import org.opendaylight.yangtools.yang.xpath.api.YangXPathAxis;
18 import org.opendaylight.yangtools.yang.xpath.api.YangXPathExpression;
21 * An expression as defined in <a href="https://tools.ietf.org/html/rfc7950#section-9.9.2">RFC7950 Section 9.9.2</a>,
22 * i.e. the argument of a {@code path} statement.
25 * Semantically a {@link PathExpression} is similar to a {@link YangXPathExpression} with guarantees around what
26 * subexpressions it can contain:
28 * <li>the root expression must be a {@link YangLocationPath}</li>
29 * <li>it can contain steps only along {@link YangXPathAxis#DESCENDANT} and {@link YangXPathAxis#PARENT} axis</li>
30 * <li>all steps along {@link YangXPathAxis#DESCENDANT} axis are {@link QNameStep}</li>
31 * <li>the only function invocation is {@link YangFunction#CURRENT}</li>
32 * <li>only {@link YangBinaryOperator#EQUALS} is allowed</li>
33 * <li>no literals nor numbers are allowed</li>
36 * @author Robert Varga
39 public interface PathExpression extends Immutable {
41 * Return the {@link YangLocationPath} of this expression.
43 * @return The location path
45 @NonNull YangLocationPath getLocation();