Skip to content
develop
Switch branches/tags
Code
This branch is up to date with develop.
Contribute

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 

SDLang (Simple Declarative Language) for Java

Java CI Build Status Maven Central Javadocs Coverage Status

SDLang is a simple and concise way to textually represent data. It has an XML-like structure – tags, values and attributes – which makes it a versatile choice for data serialization, configuration files, or declarative languages. Its syntax was inspired by the C family of languages (C/C++, C#, D, Java, …).

sdlang.org

Adding the dependency to your project

Releases for v2 are available from Maven Central under the com.singingbush groupid (as v2 was [singingbush]'s fork of v1):

    <dependency>
        <groupId>com.singingbush</groupId>
        <artifactId>sdlang</artifactId>
        <version>2.1.0</version>
    </dependency>

The v2 repo has been transferred to the sdlang-dev github organisation so that continued development and a planned v3 can be worked on as a joint effort. For now v2 releases will continue with the same groupId and artifactId. The next major release will likely be under a new groupId.

Usage

To parse an SDL file simply create an InputStreamReader and pass it into the constructor of Parser:

final InputStream inputStream = new FileInputStream("c:\\data\\myfile.sdl");
final Reader inputStreamReader = new InputStreamReader(inputStream, "UTF-8");
final List<Tag> tags = new Parser(inputStreamReader).parse();

To write SDL from Java objects:

final Tag tag = SDL.tag("thing")
    .withNamespace("my")
    .withComment("This text will precede the 'my:thing' when serialised")
    .withValue(SDL.value('g'))
    .withChild(SDL.tag("child")
        .withComment("child tags can also have comments")
        .withValues(SDL.value(ZonedDateTime.now()), SDL.value("some text"))
        .build()
    )
    .withAttribute("flt", SDL.value(0.0f))
    .withAttribute("lng", SDL.value(1_000L))
    .build();

Forked from ikayzo/SDL:

This code was originally dumped in github in May 2011 with a single commit message stating that it was migrated from svn.

Since then there's been no activity in that repository and it seems that issues are ignored. Even the URL for documentation is broken.

As the project appears to be abandoned I've forked it with the goal of

  • Adding more unit tests
  • Enabling continuous integration using travis-ci.org
  • Reporting on Test Coverage using coveralls.io
  • Fixing existing bugs
  • Overhaul the project and start rewriting the codebase
  • Publish build artifacts to maven central

Daniel Leuck, the original author, licensed the source as LGPL v2.1

About

SDL (Simple Declarative Language) for java

Topics

Resources

Packages

No packages published

Languages