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.slf4j.Logger;
22 import org.slf4j.LoggerFactory;
25 @Component(immediate = true)
26 public final class AntlrXPathParserFactory implements YangXPathParserFactory {
27 private static final Logger LOG = LoggerFactory.getLogger(AntlrXPathParserFactory.class);
30 public YangXPathParser newParser(final YangXPathMathMode mathMode) {
31 return new AntlrXPathParser.Base(mathMode);
35 public QualifiedBound newParser(final YangXPathMathMode mathMode, final YangNamespaceContext namespaceContext) {
36 return new AntlrXPathParser.Qualified(mathMode, namespaceContext);
40 public UnqualifiedBound newParser(final YangXPathMathMode mathMode, final YangNamespaceContext namespaceContext,
41 final QNameModule defaultNamespace) {
42 return new AntlrXPathParser.Unqualified(mathMode, namespaceContext, defaultNamespace);
46 @SuppressWarnings("static-method")
48 LOG.info("XPath Parser activated");
52 @SuppressWarnings("static-method")
54 LOG.info("XPath Parser deactivated");