Metaschema Java Tools
This project provides a Java implementation of the Metaschema framework that supports format-agnostic information modeling and processing.
This project supports the following features:
- Allows developers to generate Java classes from Metaschema definitions. Using a given Metaschema definition, a developer can quickly generate Java classes for a Metaschema-based model, which can be used to create, parse, modify, and write XML, JSON, and YAML representations of that model using bound Java objects. This allows a developer to quickly start programming business logic instead of spending hours writing parsing code. This approach is similar to the binding frameworks provided by Jakarta XML Binding (JAXB), XMLBeans, Java API for JSON Binding (JSON-B), and other class-to-object binding approaches. The OSCAL Java Library is an example of applying this approach to generate Java programming APIs for a set of Metaschema-defined models.
- Supports generating Metaschema-based Java code during Maven builds. An Apache Maven Metaschema code generation plugin is provided that supports Java class generation for a Metaschema definition during Maven builds.
- Enables validation of data aligned with a set of Metaschema definitions using constraints defined within the Metaschema definitions. Using this framework, format-agnostic validation rules, defined in a Metaschema, can be enforced over data loaded into bound objects.
- Allows execution of Metapath queries against data aligned with a Metaschema-based model. Metapath is an XPath-like expression language that can be used to query XML, JSON, or YAML data aligned with a Metaschema definition. This allows data to be queried irrespective of the format it is stored in.
This project contains the following sub-modules:
- Metaschema Java Code Generator: A Java code generator Java API that generates Java classes for a Metaschema definition. These generated classes can be used to read and write XML, JSON, and YAML content that is valid to the associated Metaschema model.
- Metaschema Java API: Provides a Java API for interacting with Metaschema definitions and executing Metapath expressions in Java programs.
- Metaschema Java Binding (META-B): A Java API that uses Java code generated by the Metaschema Java Code Generator to read and write XML, JSON, and YAML content that is valid to the associated Metaschema model. This library is a dependency for all generated Java code.
- Metaschema Maven Plugin: A Maven build plugin that automates generation on Java classes for a set of Metaschema definitions as part of a Maven build.
- Metaschema Java Binding Annotations:
- Metaschema XML Model: Supports loading Metaschema definitions expressed in XML files.
Please refer to each sub-module for usage instructions.