Promote yang-xpath to stable features
[yangtools.git] / yang / yang-data-api / src / main / java / org / opendaylight / yangtools / yang / data / api / schema / xpath / RelocatableXPathExpression.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.yang.data.api.schema.xpath;
9
10 import com.google.common.annotations.Beta;
11 import javax.annotation.Nonnull;
12 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
13
14 /**
15  * Interface implemented by {@link XPathExpression}s which can be recompiled to execute more efficiently at a
16  * at a different {@link SchemaPath} than they were originally compiled at. This can result in the expression being
17  * moved either up or down in a SchemaPath tree, usually closer to their {@link #getApexPath()}.
18  */
19 @Beta
20 public interface RelocatableXPathExpression extends XPathExpression {
21     /**
22      * Return a new XPathExpression relocated to a SchemaPath of the implementation's choosing. Note that
23      * {@link #getApexPath()} must not change during this operation.
24      *
25      * @return A new XPathExpression instance.
26      */
27     @Nonnull XPathExpression relocateExpression();
28 }