MarSik / adif

ADIF library for java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ADIF parser and generator

Build Status

This library is meant to be used for reading and writing of ADIF data (ADI format only for now, although the XML based ADIX is almost the same).

The current format I am targeting is ADIF 3.1.0 as described at the ADIF site.

This code is released under the Apache License 2.0

Adding this library to your project

Please use Jitpack.io by configuring a repository and dependency in the following way:

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>
<dependency>
    <groupId>com.github.MarSik</groupId>
    <artifactId>adif</artifactId>
    <version>v1.2.1</version>
</dependency>

Reading ADIF files

import org.marsik.ham.adif.Adif3
import org.marsik.ham.adif.AdiReader

AdiReader reader = new AdiReader();
BufferedReader buffInput = ...; // get buffered reader from stream or file
Optional<Adif3> adif = reader.read(buffInput);

Note: For reading Logbook of the World adi files enable the quirks mode with reader.setQuirksMode(true);. The quirks mode accepts submodes (i.e PSK31) in the modes fields and translates them to the appropriate mode (i.e. PSK).

Writing ADIF files

import org.marsik.ham.adif.Adif3Record
import org.marsik.ham.adif.AdifHeader
import org.marsik.ham.adif.AdiWriter

AdiWriter writer = new AdiWriter();
writer.append(/* AdifHeader */)
for Adif3Record record: /* some data source */ {
  writer.append(record);
}
writer.toString() // -> to some output

About

ADIF library for java


Languages

Language:Java 100.0%