3395e93cf941f840ecd94fb46ef770c7dbc3c27c
[yangtools.git] / yang / yang-xpath-api / src / main / java / org / opendaylight / yangtools / yang / xpath / api / YangXPathParser.java
1 /*
2  * Copyright (c) 2018 Pantheon Technologies, s.r.o.  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.xpath.api;
9
10 import com.google.common.annotations.Beta;
11 import javax.xml.xpath.XPathExpressionException;
12
13 /**
14  * Interface for converting a String into a {@link YangXPathExpression}. Implementations of this interface are expected
15  * to be NOT thread-safe.
16  *
17  * @author Robert Varga
18  */
19 @Beta
20 public interface YangXPathParser {
21     /**
22      * Parse a string containing an XPath expression.
23      *
24      * @param xpath XPath expression string
25      * @return A parsed {@link YangXPathExpression}
26      * @throws NullPointerException if {@code xpath} is null
27      * @throws XPathExpressionException when the expression cannot be parsed
28      */
29     YangXPathExpression parseExpression(String xpath) throws XPathExpressionException;
30 }