-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored core model classes and support for collections of model in… (
#256) # Overall - Relocated many class files and cleaned up many unneeded methods. - Improved some Javadocs. - Fixed many Spotbugs, PMD, and Java errors and warnings. - Performed some code cleanup and formatting. # Model Refactoring Refactored core model classes and support for collections of model instances. - Refactored instance class hierarchy to support grouped and ungrouped model instances, with minimal implementation. - Renamed model interfaces for greater consistency. - Refactored core model interfaces to reduce inheritance conflicts. - Adjusted the module interfaces to promote a cleaner, non-parameterized API. - Renamed many instance implementation classes to ensure consistent use of terminology. Prior the terms "property" and "instance" were used interchangeably, which could cause some confusion. - Refactored IBindingContext to move supporting interfaces to be child interfaces. - Removed the need for 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. - Cleaned up IModelPropertyInfo readItems methods, which now return the parsed value. Eliminated the need for IPropertyCollector instances. - Refactored constraint ILet statement construction to use static factory methods. - Cleaned up JSON value key naming code. - Fixed default value handling which wasn't producing empty collection for unparsed model instances. Cleaned up getDefaultValue and getEffectiveDefaultValue methods. - Refactored JSON key handling to determine the JSON key on a per item basis. This is needed for ChoiceGroups. - Refactored container handling code to reuse the core model implementation 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. - Added support for a model(node) Metapath function that gets a nodeset based on the underlying Metaschema module model for the node. # Binding Support - Refactored XML and JSON item writing to use a shared IModelInstanceCollectionInfo.IWriteHandler implementation, allowing all item writing to be implemented in the format-specific classes, i.e. MetaschemaJsonWriter, MetaschemaXmlWriter. - Implemented choice group writing for XML, JSON, and YAML. - Moved JSON reading and writing code from IItemValueHandler to MetaschemaJsonReader and MetaschemaJsonWriter using dispatch methods. This allows are IO code to be implemented withing the JSON format-specific implementation. - Moved XML reading and writing code from IItemValueHandler to MetaschemaXmlReader and MetaschemaXmlWriter using dispatch methods. This allows are IO code to be implemented withing the XML format-specific implementation. - Cleaned up XML parsing code. Fixed a bunch of bugs causing parsing to not work. - Fixed all identified bugs in XML parsing. - Added support for parsing XML fields as a root element. - Cleaned up IBoundGroupedFieldInstance implementations to use only the complex form, since a grouped item must have a bound class to determine its item type. - Aligned generated annotations with class generation, adding support for many missing annotation entries. - Added binding support for choice groups. - Added Metaschema module bindings. - 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. - Added support for Metaschema module loading that uses the Metaschema module binding instead of the XML parser. Metaschema modules in XML, JSON, and YAML can now be fully read! - Added Metaschema module loader support for entity resolution. Tested with OSCAL Metaschema modules. - Cleaned up bound module loading in DefaultBindingContext. - 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". - Improved testing of assemblies with various types of fields and flags. - Implemented new unit tests to test the model bindings. - Refactored DefaultJsonDeserializer to read a root element without the need to produce a Metapath item first. - Adjusted the class generation for grouped instances to allow for extended classes where definitions are used by reference. - Implemented subclass generation for choice group instances. - Moved Metaschema module binding classes to a subdirectory to help with change integration. - Refactored JSON schema generator. Many improvements to the indexing approach used to determine which definitions become global definitions in the JSON schema. - Improved JSON documentation to include titles and descriptions on properties. - JSON and XML schema generation for choice groups is working.
- Loading branch information
1 parent
e96faee
commit 2846899
Showing
591 changed files
with
34,980 additions
and
9,597 deletions.
There are no files selected for viewing
Submodule metaschema
updated
6 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.