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.impl;
10 import org.kohsuke.MetaInfServices;
11 import org.opendaylight.yangtools.yang.common.QNameModule;
12 import org.opendaylight.yangtools.yang.common.YangNamespaceContext;
13 import org.opendaylight.yangtools.yang.xpath.api.YangXPathMathMode;
14 import org.opendaylight.yangtools.yang.xpath.api.YangXPathParser;
15 import org.opendaylight.yangtools.yang.xpath.api.YangXPathParser.QualifiedBound;
16 import org.opendaylight.yangtools.yang.xpath.api.YangXPathParser.UnqualifiedBound;
17 import org.opendaylight.yangtools.yang.xpath.api.YangXPathParserFactory;
18 import org.osgi.service.component.annotations.Activate;
19 import org.osgi.service.component.annotations.Component;
20 import org.osgi.service.component.annotations.Deactivate;
21 import org.osgi.service.component.annotations.RequireServiceComponentRuntime;
22 import org.slf4j.Logger;
23 import org.slf4j.LoggerFactory;
27 @RequireServiceComponentRuntime
28 public final class AntlrXPathParserFactory implements YangXPathParserFactory {
29 private static final Logger LOG = LoggerFactory.getLogger(AntlrXPathParserFactory.class);
32 public YangXPathParser newParser(final YangXPathMathMode mathMode) {
33 return new AntlrXPathParser.Base(mathMode);
37 public QualifiedBound newParser(final YangXPathMathMode mathMode, final YangNamespaceContext namespaceContext) {
38 return new AntlrXPathParser.Qualified(mathMode, namespaceContext);
42 public UnqualifiedBound newParser(final YangXPathMathMode mathMode, final YangNamespaceContext namespaceContext,
43 final QNameModule defaultNamespace) {
44 return new AntlrXPathParser.Unqualified(mathMode, namespaceContext, defaultNamespace);
48 @SuppressWarnings("static-method")
50 LOG.debug("XPath Parser activated");
54 @SuppressWarnings("static-method")
56 LOG.debug("XPath Parser deactivated");