Skip to content

Commit

Permalink
Completed initial refactor of model classes. Still need to cleanup co…
Browse files Browse the repository at this point in the history
…ntainer classes.
  • Loading branch information
david-waltermire committed May 6, 2024
1 parent c33018d commit 5f0f87b
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,17 +209,17 @@ public Exports(@NonNull List<? extends M> importedModules) {
// as an imported one
Map<QName, FL> exportedFlagDefinitions = flags.collect(
CustomCollectors.toMap(
IFlagDefinition::getXmlQName,
IFlagDefinition::getDefinitionQName,
CustomCollectors.identity(),
AbstractModule::handleShadowedDefinitions));
Map<QName, FI> exportedFieldDefinitions = fields.collect(
CustomCollectors.toMap(
IFieldDefinition::getXmlQName,
IFieldDefinition::getDefinitionQName,
CustomCollectors.identity(),
AbstractModule::handleShadowedDefinitions));
Map<QName, A> exportedAssemblyDefinitions = assemblies.collect(
CustomCollectors.toMap(
IAssemblyDefinition::getXmlQName,
IAssemblyDefinition::getDefinitionQName,
CustomCollectors.identity(),
AbstractModule::handleShadowedDefinitions));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ public abstract class AbstractNamedInstance<
* Construct a new instance.
*
* @param parent
* the parent containing the instance.
* the parent containing the instance
* @param initializer
* used to generate the instance qualified name
*/
protected AbstractNamedInstance(@NonNull PARENT parent, @NonNull NameInitializer initializer) {
super(parent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ default boolean hasChildren() {
*
* @return the flag instance if a JSON key is configured, or {@code null}
* otherwise
* @see #hasJsonKey()
*/
// TODO: remove once moved to the instance side
// TODO: Reconsider using toFlagName in favor of getReferencedDefinitionQName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
* can be accessed using {@link #getImportedModules()}.
* <p>
* Global scoped Metaschema definitions can be accessed using
* {@link #getScopedAssemblyDefinitionByName(String)},
* {@link #getScopedFieldDefinitionByName(String)}, and
* {@link #getScopedFlagDefinitionByName(String)}. These methods take into
* {@link #getScopedAssemblyDefinitionByName(QName)},
* {@link #getScopedFieldDefinitionByName(QName)}, and
* {@link #getScopedFlagDefinitionByName(QName)}. These methods take into
* consideration the import order to provide the global definitions that are in
* scope within the given Metschema module.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ public interface INamedModelInstance extends IModelInstance, INamedInstance {
* cases, the flag will not appear in the object. This is only allowed if the
* flag is required, as determined by a {@code true} result from
* {@link IFlagInstance#isRequired()}. The {@link IFlagInstance} can be
* retrieved using {@link #getJsonKeyFlagInstance()}.
* retrieved using {@link #getEffectiveJsonKey()}.
*
* @return {@code true} if the flag's value can be used as a property name, or
* {@code false} otherwise
* @see #getJsonKeyFlagInstance()
* @see #getEffectiveJsonKey()
*/
// TODO: remove once moved to the instance side
default boolean hasJsonKey() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void testExamineAssemblyDefinitionByName() throws MetaschemaException, IOExcepti
IMetaschemaModule module = loader.load(moduleUri);

IAssemblyDefinition definition = module.getScopedAssemblyDefinitionByName(
new QName("http://csrc.nist.gov/ns/oscal/1.0", "prop"));
new QName("http://csrc.nist.gov/ns/oscal/1.0", "property"));
assertNotNull(definition, "definition not found");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ public Object readItemField(Object parentItem, IBoundInstanceModelFieldComplex i
parentItem,
instance.getDefinition(),
instance.getJsonProperties(),
instance.getJsonKey(),
instance.getEffectiveJsonKey(),
getProblemHandler());
}

Expand Down

0 comments on commit 5f0f87b

Please sign in to comment.