<modelVersion>4.0.0</modelVersion>
<artifactId>binding-generator-impl</artifactId>
+ <packaging>bundle</packaging>
<dependencies>
<dependency>
<build>
<plugins>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
org.opendaylight.yangtools.sal.binding.generator.impl.*,
org.opendaylight.yangtools.sal.binding.generator.util.*
</Export-Package>
+ <Embed-Dependency>
+ org.eclipse.xtend.lib;inline=true,
+ org.eclipse.xtend.lib.macro;inline=true,
+ org.eclipse.xtext.xbase.lib;inline=true,
+ </Embed-Dependency>
+ <Embed-Transitive>true</Embed-Transitive>
</instructions>
</configuration>
</plugin>
package org.opendaylight.yangtools.sal.binding.generator.impl
import com.google.common.base.Joiner
+import com.google.common.base.Supplier
import java.io.File
import java.security.ProtectionDomain
import java.util.AbstractMap.SimpleEntry
if (cl === null) {
cl = Thread.currentThread.contextClassLoader
}
- ClassLoaderUtils.withClassLoader(cl,
- [ |
- if (!(node instanceof DataNodeContainer)) {
- return null
- }
- var InstanceIdentifier<?> bindingId = getBindingIdentifierByPath(node.path)
- if (bindingId != null) {
- return null
- }
- val ref = Types.typeForClass(inputType)
- var typeSpecBuilder = getDefinition(ref)
- if (typeSpecBuilder == null) {
- typeSpecBuilder = getTypeBuilder(node.path);
- }
- checkState(typeSpecBuilder !== null, "Could not find type definition for %s, $s", inputType.name, node);
- val typeSpec = typeSpecBuilder.toInstance();
- var InstanceIdentifier<?> parent
- if (parentId == null) {
- bindingId = InstanceIdentifier.create(inputType as Class)
- parent = bindingId
- putPathToBindingIdentifier(node.path, bindingId)
- } else {
- parent = putPathToBindingIdentifier(node.path, parentId, inputType)
- }
- val Map<String, Type> properties = typeSpec.allProperties
- if (node instanceof DataNodeContainer) {
- mappingForNodes((node as DataNodeContainer).childNodes, properties, parent)
- } else if (node instanceof ChoiceNode) {
- mappingForNodes((node as ChoiceNode).cases, properties, parent)
- }
- return null;
- ])
+
+ val Supplier<?> sup = [ |
+ if (!(node instanceof DataNodeContainer)) {
+ return null
+ }
+ var InstanceIdentifier<?> bindingId = getBindingIdentifierByPath(node.path)
+ if (bindingId != null) {
+ return null
+ }
+ val ref = Types.typeForClass(inputType)
+ var typeSpecBuilder = getDefinition(ref)
+ if (typeSpecBuilder == null) {
+ typeSpecBuilder = getTypeBuilder(node.path);
+ }
+ checkState(typeSpecBuilder !== null, "Could not find type definition for %s, $s", inputType.name, node);
+ val typeSpec = typeSpecBuilder.toInstance();
+ var InstanceIdentifier<?> parent
+ if (parentId == null) {
+ bindingId = InstanceIdentifier.create(inputType as Class)
+ parent = bindingId
+ putPathToBindingIdentifier(node.path, bindingId)
+ } else {
+ parent = putPathToBindingIdentifier(node.path, parentId, inputType)
+ }
+ val Map<String, Type> properties = typeSpec.allProperties
+ if (node instanceof DataNodeContainer) {
+ mappingForNodes((node as DataNodeContainer).childNodes, properties, parent)
+ } else if (node instanceof ChoiceNode) {
+ mappingForNodes((node as ChoiceNode).cases, properties, parent)
+ }
+ return null ]
+ ClassLoaderUtils.withClassLoader(cl, sup)
}
private def void mappingForNodes(Collection<? extends DataSchemaNode> childNodes, Map<String, Type> properties,
<artifactId>antlr4-runtime-osgi-nohead</artifactId>
<version>4.0</version>
</dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools.thirdparty</groupId>
- <artifactId>xtend-lib-osgi</artifactId>
- <version>2.4.3</version>
- </dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>concepts</artifactId>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>binding-data-codec</artifactId>
</dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools.thirdparty</groupId>
- <artifactId>xtend-lib-osgi</artifactId>
- <scope>compile</scope>
- </dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<bundle>mvn:org.opendaylight.yangtools/binding-model-api/{{VERSION}}</bundle>
<bundle>mvn:org.opendaylight.yangtools/binding-type-provider/{{VERSION}}</bundle>
<bundle>mvn:org.opendaylight.yangtools/binding-data-codec/{{VERSION}}</bundle>
- <bundle>mvn:org.opendaylight.yangtools.thirdparty/xtend-lib-osgi/{{VERSION}}</bundle>
<bundle>mvn:org.opendaylight.yangtools/yang-model-api/{{VERSION}}</bundle>
<bundle>mvn:org.opendaylight.yangtools/yang-model-util/{{VERSION}}</bundle>
<bundle>mvn:org.opendaylight.yangtools/yang-parser-api/{{VERSION}}</bundle>
<dependency>
<groupId>org.eclipse.xtend</groupId>
<artifactId>org.eclipse.xtend.lib</artifactId>
- <version>2.4.3</version>
+ <version>2.7.3</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<plugin>
<groupId>org.eclipse.xtend</groupId>
<artifactId>xtend-maven-plugin</artifactId>
- <version>${xtend.version}</version>
+ <version>2.7.3</version>
<executions>
<execution>
<goals>
<artifactId>antlr4-runtime-osgi-nohead</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools.thirdparty</groupId>
- <artifactId>xtend-lib-osgi</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
<build>
options.add(mavenBundle("org.apache.commons", "commons-lang3").versionAsInProject());
options.add(mavenBundle("org.opendaylight.yangtools.thirdparty", "antlr4-runtime-osgi-nohead")
.versionAsInProject());
- options.add(mavenBundle("org.opendaylight.yangtools.thirdparty", "xtend-lib-osgi").versionAsInProject());
options.add(mavenBundle("org.javassist", "javassist").versionAsInProject());
options.add(mavenBundle(GROUP, "concepts").versionAsInProject());
<packaging>pom</packaging>
<modules>
- <module>xtend-lib-osgi</module>
<module>antlr4-runtime-osgi</module>
</modules>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: -->
-<!--
- Copyright (c) 2013 Cisco Systems, Inc. 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
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>third-party-parent</artifactId>
- <version>0.7.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>xtend-lib-osgi</artifactId>
- <version>2.4.3</version>
- <packaging>bundle</packaging>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-Name>Xtend Runtime Library</Bundle-Name>
- <Bundle-SymbolicName>org.eclipse.xtend.lib</Bundle-SymbolicName>
- <Import-Package>
- com.google.common.base;version="[10.0.1,16)",
- com.google.common.collect;version="[10.0.1,16)",
- com.google.common.primitives;version="[10.0.1,16)"
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>org.eclipse.xtend</groupId>
- <artifactId>org.eclipse.xtend.lib</artifactId>
- <version>2.4.3</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.xtext</groupId>
- <artifactId>org.eclipse.xtext.xbase.lib</artifactId>
- <version>2.4.3</version>
- </dependency>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- <version>[10.0.1,15.0)</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-</project>