A compiler for data. DNAL is a JSON-like language that includes types and data validation rules.
The DNAL compiler validates and transforms your DNAL source into other data formats.
Latest version: 0.2.2 (requires Java 8+)
- views have been added (inputview and outputview)
- syntax change. comma delimiter in struct members, rules, and views.
- compile from stream,
- validation options,
- improved date format support,
- prototype of views feature
- 'unique' keyword,
- reflection-based loader,
- many fixes
User's Guide describes the syntax and Java API.
DNAL is available in maven-central.
Add the following fragment to your <dependencies>
section:
<dependency>
<groupId>org.dnal-lang</groupId>
<artifactId>dnal</artifactId>
<packaging>jar</packaging>
<version>0.2.2</version>
</dependency>
DNAL is a language for data. It supports types, relations, and validation rules. Here is a sample:
//define a type
type Person struct {
firstName string,
lastName string,
birthDate date
}
!empty(firstName),
!empty(lastName)
end
//define some values
let customer Person = { 'Gillian', 'Smith', '1965-12-31' }
let people list<Person> = [
{ 'Simone', 'Tremblay', '1965-12-31' },
{ 'Jason', 'Ackerman', '1991-01-15' }
]
The dnalc compiler converts DNAL into other formats. Use it to create JSON, XML, or to do code generation of bean or DTO classes. The compiler is extensible; add your own output generators.
The DNAL API is a Java API for loading and querying DNAL data.
- all the normal scalar types (int, boolean, string, etc)
- lists and structs
- package and import
- type inheritance
- producing valid configuration files (JSON, XML, SQL, etc).
- used as configuration directly by a program
- used for validating data received by a program.
- code generation for creating bean and DTO classes.