-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactored core model classes and support for collections of model in… #256
Refactored core model classes and support for collections of model in… #256
Conversation
And so it begins! I look forward to see this PR progress and reach it's final state. 😎 |
Using this code I was able to produce an example Metaschema module in YAML. This module describes a Metaschema module, so it is self describing! |
dfc8c7f
to
269e746
Compare
8797d64
to
ccf2772
Compare
7379ff8
to
1f716ce
Compare
cd8ce6f
to
1c2517a
Compare
Support for Metapath using choice groups is partially implemented, but not tested. I am going to work on this in a new PR, so this one can be merged as-is. |
…interfaces. Removed the need to instances of IDataTypeHandler. Now IClassDataTypeHandler functionality is provided by IFeatureComplexItemValueHandler and JavaTypeAdapterDataTypeHandler is provided by IFeatureScalarItemValueHandler. Refactored bound class hierarchy to be more consistent with needed methods. - Moved Java field handling to IFeatureJavaField from IBoundNamedModelInstance - Moved JSON key and item handling to IBoundModelInstance. - Reworked XML and JSON reading and writing. - Added IBoundChoiceGroupInstance interface for choice groups.
Cleaned up IModelPropertyInfo and implementations, relocating supporting classes as child classes. Implemented a IModelInstance item parsing as IModelPropertyInfo.IReadHandler, allowing all item parsing to be implemented in the format-specific parsing classes, i.e. MetaschemaJsonReader, MetaschemaXmlReader.
… parsed value. Eliminated the need for IPropertyCollector instances.
… of terminology. Prior the terms "property" and "instance" were used interchangeably, which could cause some confusion.
…llectionInfo.IWriteHandler implementation, allowing all item writing to be implemented in the format-specific classes, i.e. MetaschemaJsonWriter, MetaschemaXmlWriter.
Aligned annotations with class generation, adding support for many missing annotation entries.
…for unparsed model instances. Refactored JSON key handling to determine the JSON key on a per item basis. This is needed for ChoiceGroups. Fixed IBindingMatcher to use the correct class type.
Fixed some PMD errors.
…emaJsonReader and MetaschemaJsonWriter using dispatch methods. This allows are IO code to be implemented withing the JSON format-specific implementation.
…maXmlReader and MetaschemaXmlWriter using dispatch methods. This allows are IO code to be implemented withing the XML format-specific implementation.
…model instances, with minimal implementation. Cleaned up getDefaultValue and getEffectiveDefaultValue methods. Implemented choice group writing for XML, JSON, and YAML. Initial commit of the Metaschema module bindings.
… complex form, since a grouped item must have a bound class to determine its item type. Cleaned up JSON value key naming code. Adjusted the name used during code generation to use the value key name if available. This provides a more sensible name for Java property get and set methods created during code generation. Added support for deprecated on allowed value enumerations.
Fixed the compile error in SimpleFieldInstance by creating the ISimpleScalarItemValueJavaField interface to combine the interfaces used and point the getValue and setValue methods to the correct implementation.
…elated "bound" interfaces and classes.
Added support for parsing XML fields as a root element.
…ill. Fixed miscellaneous compile errors in other modules.
Fixed compile errors for other modules to align with recent changes.
Fixed some compile issues. Fixed remaining unit tests.
…h change integration. Started work on Metaschema module wrappers for bound objects.
… module binding instead of the XML parser. Metaschema modules in XML, JSON, and YAML can now be fully read!
…with OSCAL Metaschema modules.
…tion where possible. Refactored group-as namespace handling to allow for no namespace situations. Implemented getEffectiveGroupAsNamespace to handle the default case of using the module namespace where no group-as support is provided. Relocated the IModulePostProcessor interface to the new IModuleLoader interface. Refactored flag and field name handling for a cleaner implementation. This new approach uses "name" as the binding annotation value for flags, instead of "useName". Completed binding support. All current JUnit tests run without error. Added support for a model(node) Metapath function that gets a nodeset based on the underlying Metaschema module model for the node.
Fixed remaining JUnit and schema generation bugs.
Refactored JSON schema generator. Many improvements to the indexing approach used to determine which definitions become global definitions in the JSON schema. Fixed missing properties in choice group items. Improved JSON documentation to include titles and descriptions on properties. JSON and XML schema generation for choice groups is working.
…end up as null. Fixed a bug causing empty annotation documentation in XML for enumerated values with no description.
1c2517a
to
2da5a5d
Compare
Committer Notes
This PR does two things:
This involves adding support for usnistgov/metaschema#228, which means this PR depends on usnistgov/metaschema#470, which addresses this issue.
To full support the features of usnistgov/metaschema#228, the following needs to be completed.
choice-group
choice-group
choice-group
choice-group
choice-group
choice-group
As a stretch goal, it would be nice to add support for binding customization of the item type used for
choice-group
, to allow a base class or interface to be used instead ofObject
as the item item. This base class or interface would need to be implemented by each member of thechoice-group
.choice-group
binding customizationAll Submissions:
Changes to Core Features: