2 * Copyright (c) 2018 Pantheon Technologies, 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.xpath.api;
10 import com.google.common.annotations.Beta;
11 import javax.annotation.concurrent.ThreadSafe;
12 import org.opendaylight.yangtools.yang.common.YangNamespaceContext;
15 * Factory for creating {@link YangXPathParser}s.
17 * @author Robert Varga
21 public interface YangXPathParserFactory {
23 * Return a {@link YangXPathParser} compliant with {@link YangXPathMathMode#IEEE754}.
25 * @param namespaceContext Prefix-to-namespace resolver
26 * @return An XPathParser
27 * @throws NullPointerException if {@code namespaceContext} is null
29 default YangXPathParser newParser(final YangNamespaceContext namespaceContext) {
30 return newParser(namespaceContext, YangXPathMathMode.IEEE754);
34 * Return a {@link YangXPathParser} compliant with {@link YangXPathMathMode}.
36 * @param namespaceContext Prefix-to-namespace resolver
37 * @param mathMode Requested XPath number compliance
38 * @return An XPathParser
39 * @throws NullPointerException if any argument is null
41 YangXPathParser newParser(YangNamespaceContext namespaceContext, YangXPathMathMode mathMode);