<artifactId>yang-xpath-antlr</artifactId>
</dependency>
- <dependency>
- <groupId>javax.inject</groupId>
- <artifactId>javax.inject</artifactId>
- <optional>true</optional>
- </dependency>
<dependency>
<groupId>org.kohsuke.metainf-services</groupId>
<artifactId>metainf-services</artifactId>
</dependency>
+ <dependency>
+ <groupId>com.guicedee.services</groupId>
+ <artifactId>javax.inject</artifactId>
+ <version>1.0.19.9</version>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>osgi.cmpn</artifactId>
+ <artifactId>org.osgi.service.component.annotations</artifactId>
+ <version>1.3.0</version>
+ <scope>provided</scope>
</dependency>
</dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Automatic-Module-Name>org.opendaylight.yangtools.yang.xpath.impl</Automatic-Module-Name>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
--- /dev/null
+/*
+ * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+import org.opendaylight.yangtools.yang.xpath.api.YangXPathParserFactory;
+import org.opendaylight.yangtools.yang.xpath.impl.AntlrXPathParserFactory;
+
+module org.opendaylight.yangtools.yang.xpath.impl {
+ exports org.opendaylight.yangtools.yang.xpath.impl.di;
+
+ provides YangXPathParserFactory with AntlrXPathParserFactory;
+
+ requires org.opendaylight.yangtools.yang.xpath.api;
+ requires org.opendaylight.yangtools.yang.xpath.antlr;
+ requires org.slf4j;
+
+ // Annotations
+ requires static javax.inject;
+ requires static metainf.services;
+ requires static org.osgi.service.component.annotations;
+}
*/
package org.opendaylight.yangtools.yang.xpath.impl;
-import javax.inject.Singleton;
import org.kohsuke.MetaInfServices;
import org.opendaylight.yangtools.yang.common.QNameModule;
import org.opendaylight.yangtools.yang.common.YangNamespaceContext;
import org.slf4j.LoggerFactory;
@MetaInfServices
-@Singleton
@Component(immediate = true)
-public final class AntlrXPathParserFactory implements YangXPathParserFactory {
+public class AntlrXPathParserFactory implements YangXPathParserFactory {
private static final Logger LOG = LoggerFactory.getLogger(AntlrXPathParserFactory.class);
@Override
- public YangXPathParser newParser(final YangXPathMathMode mathMode) {
+ public final YangXPathParser newParser(final YangXPathMathMode mathMode) {
return new AntlrXPathParser.Base(mathMode);
}
@Override
- public QualifiedBound newParser(final YangXPathMathMode mathMode, final YangNamespaceContext namespaceContext) {
+ public final QualifiedBound newParser(final YangXPathMathMode mathMode,
+ final YangNamespaceContext namespaceContext) {
return new AntlrXPathParser.Qualified(mathMode, namespaceContext);
}
@Override
- public UnqualifiedBound newParser(final YangXPathMathMode mathMode, final YangNamespaceContext namespaceContext,
- final QNameModule defaultNamespace) {
+ public final UnqualifiedBound newParser(final YangXPathMathMode mathMode,
+ final YangNamespaceContext namespaceContext, final QNameModule defaultNamespace) {
return new AntlrXPathParser.Unqualified(mathMode, namespaceContext, defaultNamespace);
}
--- /dev/null
+/*
+ * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.xpath.impl.di;
+
+import javax.inject.Inject;
+import javax.inject.Singleton;
+import org.opendaylight.yangtools.yang.xpath.impl.AntlrXPathParserFactory;
+
+@Singleton
+public final class DefaultXPathParserFactory extends AntlrXPathParserFactory {
+ @Inject
+ public DefaultXPathParserFactory() {
+ // Noop
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+/**
+ * Package exposing {@link org.opendaylight.yangtools.yang.xpath.api.YangXPathParserFactory} component to various
+ * dependency injection frameworks, so they can locate them.
+ */
+package org.opendaylight.yangtools.yang.xpath.impl.di;
\ No newline at end of file