Skip to content

v1.0.0-M1

Pre-release
Pre-release
Compare
Choose a tag to compare
@github-actions github-actions released this 26 Sep 20:46
· 5 commits to main since this release

New and Notable

This pre-release represents a major refactoring of this library, with a focus on stabalizing APIs and laying the groundwork for ongoing maintenance and extension.

As part of this release, a number of existing modules have been retired, with the code migrated and merged into two new modules.

  • Relocated metaschema-model-common to metaschema-core in folder core.
  • Relocated metaschema-model to metaschema-core in folder core.
  • Relocated metaschema-java-binding to metaschema-databind in folder databind.
  • Relocated metaschema-java-codegen to metaschema-databind in folder databind.
  • Moved metaschema-schema-generator from the folder metaschema-schema-generator to schemagen.
  • Setup JPMS module-info for the metaschema-core, metaschema-databind, and metaschema-schema-generator modules. This provides a means to isolate APIs from implementation.

The APIs have also migrated to different package names. The primary packages are now:

While imports have changed, most class names have remained stable. Some exceptions are:

Overall code and repo improvements:

  • Cleaned up some unused/unneeded classes and methods.
    • Cleaned up some unneeded generics in the implementation.
  • Added many Javadoc comments.
  • Relocated unit tests to match new package structure.
  • Added a new mock model builder (MockedModelTestSupport) to facilitate creation of unit tests around using a mocked Metaschema model.
  • Some Maven dependency cleanup, including removing unused dependencies.
    • Removed dependency on JAXB.
    • Updating to latest oss-maven release.
  • Removed aggregate javadoc.
  • Eliminated a significant number of compile, PMD, CPD duplications, and Spotbugs warnings.
  • Improved some logging messages.
  • Use treeless Git clones on GHA builds

The following changes were made to the metaschema-core module:

  • Metapath:
    • Added true() and false() Metapath functions.
    • Added support for function namespaces.
    • Refactored Metapath focus to allow for Metapath evaluations against no focus, as well as cases where the focus is not a node item.
    • Refactored error handling for step-related Metapath expressions to ensure the provided context node item is non-null and a document. This allows null node contexts in Metapath expressions that do not require a focused node.
    • Added new String initializer for IAnyAtomicItem.
    • Refactored node item implementation to provide better interface segregation and to limit class responsibility.
      • Refactored INodeItem handling to implement the following correct behaviors:
        • IDocumentNodeItem instances will never have a value (i.e. getValue == null)
        • Root metapaths (i.e. /) must be executed against an IDocumentNodeItem or an error should be raised.
    • Improved memory footprint for Axis expressions, which now use static objects for evaluation. Refactored the Step and ParentItem ASTs to use the new Axis support.
  • Metaschema Model
    • Removed collapsible per usnistgov/metaschema#354.
    • Moved property info factory to static method on IModelPropertyInfo.
    • Adjusted IDataTypeHandler creation to avoid extra method callbacks.
    • Removed the need for specific root assembly model interfaces and classes.
  • Reduced unnecessary overridden methods.
  • For index constraints, enhanced index key miss error reporting to include the key data that missed.

The following changes were made to the metaschema-databind module:

  • Refactored JSON parsing, extracting JSON parsing logic into the MetaschemaJsonParser class. This resulted in a cleaner set of bound definition/property classes that no contain no parsing code.
    • Implemented the JSON problem handler. Resolved #131.
    • Refactored JSON parser tests.
    • Refactored JSON reader and writer to use common instance logic. The collection of instances are now lazy generated and cached, improving read and write performance for commonly accessed Metaschema-based JSON objects.
  • Adjusted YAML parser configuration to set a higher default codepoint limit.
  • Refactored XML parsing, extracting XML parsing logic into the MetaschemaXmlReader class. This resulted in a cleaner set of bound definition/property classes.
    • Also optimized deserialization to return the Object value directly, instead of first creating an unneeded node item.
    • Implemented XML problem handler for parsing. Further code cleanup and refactoring of XML parsing code.
  • Adjusted all problem handlers to use interface defaults and a common implementation of default handling for missing instances.
  • Refactored input stream handling. Input streams should now be properly closed.
  • Refactored binding context to allow for dynamic class generation, compilation, and loading. Removed DynamicBindingContext.java, which is no longer needed.
    • Refactored code generation, moving code generation methods into a dedicated class.
    • Refactored code generation production classes to simplify and reduce the number of classes.

The following changes were made to the metaschema-schema-generator module:

  • Refactored XML and JSON generation by moving generation code into format specific classes (i.e. MetaschemaJsonWriter, MetaschemaXmlWriter).
  • Improved XML schema generation testing.

The following changes were made to the metaschema-maven-plugin module:

  • Adjusted generate sources mojo default phase to a more reasonable value (generate-sources).

Changes to the Website:

  • Cleaned up website reports.
  • Ensured generated resources are included for site generation.

What's Changed

Full Changelog: v0.12.2...v1.0.0-M1

Download

This release is on Maven Central.