v1.0.0-M1
Pre-releaseNew 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
tometaschema-core
in foldercore
. - Relocated
metaschema-model
tometaschema-core
in foldercore
. - Relocated
metaschema-java-binding
tometaschema-databind
in folderdatabind
. - Relocated
metaschema-java-codegen
tometaschema-databind
in folderdatabind
. - Moved
metaschema-schema-generator
from the foldermetaschema-schema-generator
toschemagen
. - Setup JPMS module-info for the
metaschema-core
,metaschema-databind
, andmetaschema-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:
- core: gov.nist.secauto.metaschema.core
- databind: gov.nist.secauto.metaschema.databind
- schemagen: gov.nist.secauto.metaschema.schemagen
While imports have changed, most class names have remained stable. Some exceptions are:
- Renamed
gov.nist.secauto.metaschema.model.common.IMetaschema
togov.nist.secauto.metaschema.core.model.IModule
to be more consistent with terminology. - Removed remove the
gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValue*
interfaces. Use thegov.nist.secauto.metaschema.core.metapath.item.node.I*
interfaces instead.
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()
andfalse()
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.
- Refactored INodeItem handling to implement the following correct behaviors:
- 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.
- Added
- 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
- Bump actions/setup-java from 3.11.0 to 3.13.0 by @dependabot in #220
- Bump github/codeql-action from 2.21.7 to 2.21.8 by @dependabot in #219
- Bump actions/checkout from 4.0.0 to 4.1.0 by @dependabot in #221
- Code refactoring and cleanup for 1.0.0 release by @david-waltermire-nist in #204
Full Changelog: v0.12.2...v1.0.0-M1
Download
This release is on Maven Central.