yang-java


License

License

Categories

Categories

Java Languages Net
GroupId

GroupId

com.airlenet.yang
ArtifactId

ArtifactId

yang-java
Last Version

Last Version

2.0.0
Release Date

Release Date

Type

Type

pom
Description

Description

yang-java
yang-java
Project URL

Project URL

https://github.com/airlenet/yang-java
Project Organization

Project Organization

airlenet
Source Code Management

Source Code Management

https://github.com/airlenet/yang-java

Download yang-java

Filename Size
yang-java-2.0.0.pom 10 KB
Browse

How to add to project

<!-- https://jarcasting.com/artifacts/com.airlenet.yang/yang-java/ -->
<dependency>
    <groupId>com.airlenet.yang</groupId>
    <artifactId>yang-java</artifactId>
    <version>2.0.0</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/com.airlenet.yang/yang-java/
implementation 'com.airlenet.yang:yang-java:2.0.0'
// https://jarcasting.com/artifacts/com.airlenet.yang/yang-java/
implementation ("com.airlenet.yang:yang-java:2.0.0")
'com.airlenet.yang:yang-java:pom:2.0.0'
<dependency org="com.airlenet.yang" name="yang-java" rev="2.0.0">
  <artifact name="yang-java" type="pom" />
</dependency>
@Grapes(
@Grab(group='com.airlenet.yang', module='yang-java', version='2.0.0')
)
libraryDependencies += "com.airlenet.yang" % "yang-java" % "2.0.0"
[com.airlenet.yang/yang-java "2.0.0"]

Dependencies

compile (1)

Group / Artifact Type Version
com.google.guava : guava jar 22.0

test (3)

Group / Artifact Type Version
junit : junit jar 4.12
org.hamcrest : hamcrest-all jar 1.3
org.slf4j : slf4j-jdk14 jar 1.7.21

Project Modules

  • yang-compiler
  • yang-jnc
  • yang-model
  • yang-maven-plugin
  • yang-example

yang-java

Yang file is parsed by Java antlr4; Yang file is parsed by java code and JNC code is generated. Its principle is based on JNC and onos-yang-tools

Reference JNC pyang antlr onos-yang-tools

yang-jnc

Modify based on JNC

yang-maven-plugin

Download

Download the latest JAR or grab via Maven:

<dependency>
  <groupId>com.airlenet.yang</groupId>
  <artifactId>yang-maven-plugin</artifactId>
  <version>LATEST</version>
</dependency>

Snapshots of the development version are available in Sonatype's snapshots repository.

Usage

<plugins>
    <plugin>
        <groupId>com.airlenet.yang</groupId>
        <artifactId>yang-maven-plugin</artifactId>
        <version>2.0.0-SNAPSHOT</version>
        <configuration>
            <yangFilesDir>src/main/yang</yangFilesDir>
            <packageName>com.test.yang.model.gen</packageName>
            <classFileDir>src/main/java</classFileDir>
        </configuration>
        <executions>
            <execution>
                <id>default</id>
                <goals>
                    <goal>yang2java</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.7</version>
        <executions>
            <execution>
                <id>add-source</id>
                <phase>generate-sources</phase>
                <goals>
                    <goal>add-source</goal>
                </goals>
                <configuration>
                    <sources>
                        <source>target/generated-sources/java</source>
                    </sources>
                </configuration>
            </execution>
            <execution>
                <id>add-resource</id>
                <phase>generate-resources</phase>
                <goals>
                    <goal>add-resource</goal>
                </goals>
                <configuration>
                    <resources>
                        <resource>
                            <directory>target/generated-sources/java</directory>
                        </resource>
                    </resources>
                </configuration>
            </execution>
        </executions>
    </plugin>
</plugins>
mvn package                 # generator java class from yang model,compile,package

yang-example

License

See License File.

Versions

Version
2.0.0