From 7496fad21f800df03fab16607c787404dab5053a Mon Sep 17 00:00:00 2001 From: David Waltermire Date: Sun, 5 May 2024 12:57:07 -0400 Subject: [PATCH] interim commit --- .../core/model/AbstractDefinition.java | 65 +++++++++++ .../core/model/AbstractGlobalDefinition.java | 32 +----- .../core/model/AbstractNamedInstance.java | 2 +- .../model/IBoundDefinitionModelComplex.java | 103 ++++++++++++++++++ .../AbstractBoundDefinitionModelComplex.java | 102 +++++------------ .../model/impl/DefinitionAssembly.java | 17 +-- .../model/impl/FlagContainerSupport.java | 10 +- .../binding/AssemblyConstraints.java | 4 +- .../metaschema/binding/AssemblyModel.java | 22 ++-- .../metaschema/binding/AssemblyReference.java | 10 +- .../metaschema/binding/FieldConstraints.java | 4 +- .../metaschema/binding/FieldReference.java | 10 +- .../metaschema/binding/FlagAllowedValues.java | 4 +- .../metaschema/binding/FlagConstraints.java | 4 +- .../model/metaschema/binding/FlagExpect.java | 2 +- .../metaschema/binding/FlagIndexHasKey.java | 4 +- .../model/metaschema/binding/FlagMatches.java | 2 +- .../metaschema/binding/FlagReference.java | 10 +- .../binding/InlineDefineAssembly.java | 15 ++- .../metaschema/binding/InlineDefineField.java | 15 ++- .../metaschema/binding/InlineDefineFlag.java | 12 +- .../model/metaschema/binding/METASCHEMA.java | 29 +++-- .../metaschema/binding/MetapathContext.java | 4 +- .../binding/MetaschemaMetaConstraints.java | 4 +- .../binding/MetaschemaModuleConstraints.java | 12 +- .../TargetedAllowedValuesConstraint.java | 4 +- .../binding/TargetedExpectConstraint.java | 2 +- .../TargetedHasCardinalityConstraint.java | 2 +- .../binding/TargetedIndexConstraint.java | 4 +- .../TargetedIndexHasKeyConstraint.java | 4 +- .../binding/TargetedIsUniqueConstraint.java | 4 +- .../binding/TargetedMatchesConstraint.java | 2 +- .../impl/DefinitionAssemblyGlobal.java | 29 +++-- .../impl/DefinitionFieldGlobal.java | 18 ++- .../metaschema/impl/DefinitionFlagGlobal.java | 41 ++----- .../model/metaschema/impl/GroupAsImpl.java | 22 ++-- 36 files changed, 350 insertions(+), 280 deletions(-) create mode 100644 core/src/main/java/gov/nist/secauto/metaschema/core/model/AbstractDefinition.java diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/AbstractDefinition.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/AbstractDefinition.java new file mode 100644 index 000000000..4d974917f --- /dev/null +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/AbstractDefinition.java @@ -0,0 +1,65 @@ +/* + * Portions of this software was developed by employees of the National Institute + * of Standards and Technology (NIST), an agency of the Federal Government and is + * being made available as a public service. Pursuant to title 17 United States + * Code Section 105, works of NIST employees are not subject to copyright + * protection in the United States. This software may be subject to foreign + * copyright. Permission in the United States and in foreign countries, to the + * extent that NIST may hold copyright, to use, copy, modify, create derivative + * works, and distribute this software and its documentation without fee is hereby + * granted on a non-exclusive basis, provided that this notice and disclaimer + * of warranty appears in all copies. + * + * THE SOFTWARE IS PROVIDED 'AS IS' WITHOUT ANY WARRANTY OF ANY KIND, EITHER + * EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY + * THAT THE SOFTWARE WILL CONFORM TO SPECIFICATIONS, ANY IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND FREEDOM FROM + * INFRINGEMENT, AND ANY WARRANTY THAT THE DOCUMENTATION WILL CONFORM TO THE + * SOFTWARE, OR ANY WARRANTY THAT THE SOFTWARE WILL BE ERROR FREE. IN NO EVENT + * SHALL NIST BE LIABLE FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO, DIRECT, + * INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF, RESULTING FROM, + * OR IN ANY WAY CONNECTED WITH THIS SOFTWARE, WHETHER OR NOT BASED UPON WARRANTY, + * CONTRACT, TORT, OR OTHERWISE, WHETHER OR NOT INJURY WAS SUSTAINED BY PERSONS OR + * PROPERTY OR OTHERWISE, AND WHETHER OR NOT LOSS WAS SUSTAINED FROM, OR AROSE OUT + * OF THE RESULTS OF, OR USE OF, THE SOFTWARE OR SERVICES PROVIDED HEREUNDER. + */ + +package gov.nist.secauto.metaschema.core.model; + +import gov.nist.secauto.metaschema.core.util.ObjectUtils; + +import javax.xml.namespace.QName; + +import edu.umd.cs.findbugs.annotations.NonNull; +import nl.talsmasoftware.lazy4j.Lazy; + +public abstract class AbstractDefinition + implements IDefinition { + @NonNull + private final Lazy qname; + @NonNull + private final Lazy definitionQName; + + protected AbstractDefinition(@NonNull NameInitializer initializer) { + this.qname = ObjectUtils.notNull(Lazy.lazy(() -> initializer.apply(getEffectiveName()))); + this.definitionQName = ObjectUtils.notNull(Lazy.lazy(() -> initializer.apply(getName()))); + } + + @SuppressWarnings("null") + @Override + public final QName getXmlQName() { + return qname.get(); + } + + @SuppressWarnings("null") + @Override + public final QName getDefinitionQName() { + return definitionQName.get(); + } + + @FunctionalInterface + public interface NameInitializer { + @NonNull + QName apply(@NonNull String name); + } +} diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/AbstractGlobalDefinition.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/AbstractGlobalDefinition.java index c7e0efaf0..aec1bc70c 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/AbstractGlobalDefinition.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/AbstractGlobalDefinition.java @@ -26,38 +26,16 @@ package gov.nist.secauto.metaschema.core.model; -import gov.nist.secauto.metaschema.core.util.ObjectUtils; - -import javax.xml.namespace.QName; - import edu.umd.cs.findbugs.annotations.NonNull; -import nl.talsmasoftware.lazy4j.Lazy; public abstract class AbstractGlobalDefinition - implements IDefinition { + extends AbstractDefinition { @NonNull private final MODULE module; - @NonNull - private final Lazy qname; - @NonNull - private final Lazy definitionQName; protected AbstractGlobalDefinition(@NonNull MODULE module, @NonNull NameInitializer initializer) { + super(initializer); this.module = module; - this.qname = ObjectUtils.notNull(Lazy.lazy(() -> initializer.apply(getEffectiveName()))); - this.definitionQName = ObjectUtils.notNull(Lazy.lazy(() -> initializer.apply(getName()))); - } - - @SuppressWarnings("null") - @Override - public final QName getXmlQName() { - return qname.get(); - } - - @SuppressWarnings("null") - @Override - public final QName getDefinitionQName() { - return definitionQName.get(); } @Override @@ -76,10 +54,4 @@ public final INSTANCE getInlineInstance() { // never inline return null; } - - @FunctionalInterface - public interface NameInitializer { - @NonNull - QName apply(@NonNull String name); - } } diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/AbstractNamedInstance.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/AbstractNamedInstance.java index f9a6fce72..3f33fc4ca 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/AbstractNamedInstance.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/AbstractNamedInstance.java @@ -26,7 +26,7 @@ package gov.nist.secauto.metaschema.core.model; -import gov.nist.secauto.metaschema.core.model.AbstractGlobalDefinition.NameInitializer; +import gov.nist.secauto.metaschema.core.model.AbstractDefinition.NameInitializer; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import javax.xml.namespace.QName; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundDefinitionModelComplex.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundDefinitionModelComplex.java index 5e0bc499e..ef39ace33 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundDefinitionModelComplex.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundDefinitionModelComplex.java @@ -26,8 +26,13 @@ package gov.nist.secauto.metaschema.databind.model; +import gov.nist.secauto.metaschema.core.util.ObjectUtils; +import gov.nist.secauto.metaschema.databind.io.BindingException; import gov.nist.secauto.metaschema.databind.model.info.IFeatureComplexItemValueHandler; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.util.Map; import java.util.function.Predicate; @@ -42,4 +47,102 @@ public interface IBoundDefinitionModelComplex @NonNull Map getJsonProperties(@Nullable Predicate flagFilter); + + @Override + default boolean isInline() { + return getBoundClass().getEnclosingClass() != null; + } + + /** + * Gets a new instance of the bound class. + * + * @param + * the type of the bound class + * @return a Java object for the class + * @throws RuntimeException + * if the instance cannot be created due to a binding error + */ + @SuppressWarnings("PMD.AvoidThrowingRawExceptionTypes") + @Override + @NonNull + default CLASS newInstance() { + Class clazz = getBoundClass(); + try { + @SuppressWarnings("unchecked") Constructor constructor + = (Constructor) clazz.getDeclaredConstructor(); + return ObjectUtils.notNull(constructor.newInstance()); + } catch (NoSuchMethodException ex) { + String msg = String.format("Class '%s' does not have a required no-arg constructor.", clazz.getName()); + throw new RuntimeException(msg, ex); + } catch (InstantiationException | IllegalAccessException | InvocationTargetException ex) { + throw new RuntimeException(ex); + } + } + + @Nullable + Method getBeforeDeserializeMethod(); + + /** + * Calls the method named "beforeDeserialize" on each class in the object's + * hierarchy if the method exists on the class. + *

+ * These methods can be used to set the initial state of the target bound object + * before data is read and applied during deserialization. + * + * @param targetObject + * the data object target to call the method(s) on + * @param parentObject + * the object target's parent object, which is used as the method + * argument + * @throws BindingException + * if an error occurs while calling the method + */ + @Override + default void callBeforeDeserialize(Object targetObject, Object parentObject) throws BindingException { + Method beforeDeserializeMethod = getBeforeDeserializeMethod(); + if (beforeDeserializeMethod != null) { + try { + beforeDeserializeMethod.invoke(targetObject, parentObject); + } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { + throw new BindingException(ex); + } + } + } + + @Nullable + Method getAfterDeserializeMethod(); + + /** + * Calls the method named "afterDeserialize" on each class in the object's + * hierarchy if the method exists. + *

+ * These methods can be used to modify the state of the target bound object + * after data is read and applied during deserialization. + * + * @param targetObject + * the data object target to call the method(s) on + * @param parentObject + * the object target's parent object, which is used as the method + * argument + * @throws BindingException + * if an error occurs while calling the method + */ + @Override + default void callAfterDeserialize(Object targetObject, Object parentObject) throws BindingException { + Method afterDeserializeMethod = getAfterDeserializeMethod(); + if (afterDeserializeMethod != null) { + try { + afterDeserializeMethod.invoke(targetObject, parentObject); + } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { + throw new BindingException(ex); + } + } + } + + // @Override + // public String getJsonKeyFlagName() { + // // definition items never have a JSON key + // return null; + // } + } diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/impl/AbstractBoundDefinitionModelComplex.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/impl/AbstractBoundDefinitionModelComplex.java index 3d749bea1..716d8d705 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/impl/AbstractBoundDefinitionModelComplex.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/impl/AbstractBoundDefinitionModelComplex.java @@ -35,10 +35,10 @@ import gov.nist.secauto.metaschema.databind.model.IFeatureBoundContainerFlag; import java.lang.annotation.Annotation; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import javax.xml.namespace.QName; + import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.Nullable; import nl.talsmasoftware.lazy4j.Lazy; @@ -53,6 +53,10 @@ public abstract class AbstractBoundDefinitionModelComplex private final IBindingContext bindingContext; @NonNull private final Lazy module; + @NonNull + private final Lazy qname; + @NonNull + private final Lazy definitionQName; @Nullable private final Method beforeDeserializeMethod; @Nullable @@ -67,6 +71,8 @@ protected AbstractBoundDefinitionModelComplex( this.annotation = annotation; this.bindingContext = bindingContext; this.module = ObjectUtils.notNull(Lazy.lazy(() -> bindingContext.registerModule(moduleClass))); + this.qname = ObjectUtils.notNull(Lazy.lazy(() -> getContainingModule().toModelQName(getEffectiveName()))); + this.definitionQName = ObjectUtils.notNull(Lazy.lazy(() -> getContainingModule().toModelQName(getName()))); this.beforeDeserializeMethod = ClassIntrospector.getMatchingMethod( clazz, "beforeDeserialize", @@ -86,11 +92,6 @@ public A getAnnotation() { return annotation; } - @Override - public boolean isInline() { - return getBoundClass().getEnclosingClass() != null; - } - @Override @NonNull public IBoundModule getContainingModule() { @@ -103,82 +104,31 @@ public IBindingContext getBindingContext() { return bindingContext; } - /** - * Gets a new instance of the bound class. - * - * @param - * the type of the bound class - * @return a Java object for the class - * @throws RuntimeException - * if the instance cannot be created due to a binding error - */ - @SuppressWarnings("PMD.AvoidThrowingRawExceptionTypes") + @SuppressWarnings("null") @Override - @NonNull - public CLASS newInstance() { - Class clazz = getBoundClass(); - try { - @SuppressWarnings("unchecked") Constructor constructor - = (Constructor) clazz.getDeclaredConstructor(); - return ObjectUtils.notNull(constructor.newInstance()); - } catch (NoSuchMethodException ex) { - String msg = String.format("Class '%s' does not have a required no-arg constructor.", clazz.getName()); - throw new RuntimeException(msg, ex); - } catch (InstantiationException | IllegalAccessException | InvocationTargetException ex) { - throw new RuntimeException(ex); - } + public final QName getXmlQName() { + return qname.get(); } - /** - * Calls the method named "beforeDeserialize" on each class in the object's - * hierarchy if the method exists on the class. - *

- * These methods can be used to set the initial state of the target bound object - * before data is read and applied during deserialization. - * - * @param targetObject - * the data object target to call the method(s) on - * @param parentObject - * the object target's parent object, which is used as the method - * argument - * @throws BindingException - * if an error occurs while calling the method - */ + @SuppressWarnings("null") @Override - public void callBeforeDeserialize(Object targetObject, Object parentObject) throws BindingException { - if (beforeDeserializeMethod != null) { - try { - beforeDeserializeMethod.invoke(targetObject, parentObject); - } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { - throw new BindingException(ex); - } - } + public final QName getDefinitionQName() { + return definitionQName.get(); } - /** - * Calls the method named "afterDeserialize" on each class in the object's - * hierarchy if the method exists. - *

- * These methods can be used to modify the state of the target bound object - * after data is read and applied during deserialization. - * - * @param targetObject - * the data object target to call the method(s) on - * @param parentObject - * the object target's parent object, which is used as the method - * argument - * @throws BindingException - * if an error occurs while calling the method - */ @Override - public void callAfterDeserialize(Object targetObject, Object parentObject) throws BindingException { - if (afterDeserializeMethod != null) { - try { - afterDeserializeMethod.invoke(targetObject, parentObject); - } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { - throw new BindingException(ex); - } - } + public boolean isInline() { + return getBoundClass().getEnclosingClass() != null; + } + + @Override + public Method getBeforeDeserializeMethod() { + return beforeDeserializeMethod; + } + + @Override + public Method getAfterDeserializeMethod() { + return afterDeserializeMethod; } // @Override diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/impl/DefinitionAssembly.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/impl/DefinitionAssembly.java index d7fefe1d5..8cdcec222 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/impl/DefinitionAssembly.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/impl/DefinitionAssembly.java @@ -65,6 +65,7 @@ public class DefinitionAssembly IBoundInstanceModelField, IBoundInstanceModelAssembly, IBoundInstanceModelChoiceGroup> { + @NonNull private final Lazy flagContainer; @NonNull @@ -92,19 +93,9 @@ private DefinitionAssembly( super(clazz, annotation, moduleClass, bindingContext); String rootLocalName = ModelUtil.resolveNoneOrDefault(getAnnotation().rootName(), null); - this.xmlRootQName = ObjectUtils.notNull(Lazy.lazy(() -> { - QName retval = null; - if (rootLocalName != null) { - String namespace = ModelUtil.resolveOptionalNamespace( - getAnnotation().rootNamespace(), - () -> getContainingModule().getXmlNamespace().toASCIIString()); - if (namespace == null) { - namespace = getXmlNamespace(); - } - retval = new QName(namespace, rootLocalName); - } - return retval; - })); + this.xmlRootQName = ObjectUtils.notNull(Lazy.lazy(() -> rootLocalName == null + ? null + : getContainingModule().toModelQName(rootLocalName))); this.flagContainer = ObjectUtils.notNull(Lazy.lazy(() -> new FlagContainerSupport(this, null))); this.modelContainer = ObjectUtils.notNull(Lazy.lazy(() -> new AssemblyModelContainerSupport(this))); this.constraints = ObjectUtils.notNull(Lazy.lazy(() -> { diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/impl/FlagContainerSupport.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/impl/FlagContainerSupport.java index 9da3e2624..e6cdc5bea 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/impl/FlagContainerSupport.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/impl/FlagContainerSupport.java @@ -29,6 +29,7 @@ import gov.nist.secauto.metaschema.core.model.IContainerFlagSupport; import gov.nist.secauto.metaschema.core.util.CollectionUtil; import gov.nist.secauto.metaschema.core.util.ObjectUtils; +import gov.nist.secauto.metaschema.databind.model.IBoundDefinitionModelComplex; import gov.nist.secauto.metaschema.databind.model.IBoundInstanceFlag; import gov.nist.secauto.metaschema.databind.model.annotations.BoundFlag; import gov.nist.secauto.metaschema.databind.model.annotations.Ignore; @@ -60,7 +61,7 @@ public class FlagContainerSupport implements IContainerFlagSupport definition, + @NonNull IBoundDefinitionModelComplex definition, @Nullable Consumer peeker) { Class clazz = definition.getBoundClass(); @@ -111,12 +112,7 @@ protected static Collection getFlagInstanceFields(Class clazz) { } for (Field field : fields) { - if (!field.isAnnotationPresent(BoundFlag.class)) { - // skip non-flag fields - continue; - } - - if (field.isAnnotationPresent(Ignore.class)) { + if (!field.isAnnotationPresent(BoundFlag.class) || field.isAnnotationPresent(Ignore.class)) { // skip this field, since it is ignored continue; } diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/AssemblyConstraints.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/AssemblyConstraints.java index 47cf9db51..f51a776c3 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/AssemblyConstraints.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/AssemblyConstraints.java @@ -55,7 +55,7 @@ public class AssemblyConstraints implements IModelConstraintsBase { formalName = "Constraint Let Expression", useName = "let", maxOccurs = -1, - groupAs = @GroupAs(name = "lets", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "lets", inJson = JsonGroupAsBehavior.LIST)) private List _lets; @BoundChoiceGroup( @@ -77,7 +77,7 @@ public class AssemblyConstraints implements IModelConstraintsBase { @BoundGroupedAssembly(formalName = "Targeted Cardinality Constraint", useName = "has-cardinality", binding = TargetedHasCardinalityConstraint.class) }, - groupAs = @GroupAs(name = "rules", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "rules", inJson = JsonGroupAsBehavior.LIST)) private List _rules; @Override diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/AssemblyModel.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/AssemblyModel.java index c1f4df539..7e793c778 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/AssemblyModel.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/AssemblyModel.java @@ -77,7 +77,7 @@ public class AssemblyModel { @BoundGroupedAssembly(formalName = "Choice Grouping", useName = "choice-group", binding = ChoiceGroup.class) }, groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "instances", - namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + inJson = JsonGroupAsBehavior.LIST)) private List _instances; @BoundAssembly( @@ -159,7 +159,7 @@ public static class ChoiceGroup { binding = DefineField.class) }, groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "choices", - namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + inJson = JsonGroupAsBehavior.LIST)) private List _choices; @BoundField( @@ -271,7 +271,7 @@ public static class Assembly { useName = "prop", maxOccurs = -1, groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "props", - namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + inJson = JsonGroupAsBehavior.LIST)) private List _props; @BoundField( @@ -440,7 +440,7 @@ public static class DefineAssembly { useName = "prop", maxOccurs = -1, groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "props", - namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + inJson = JsonGroupAsBehavior.LIST)) private List _props; @BoundField( @@ -457,7 +457,7 @@ public static class DefineAssembly { @BoundGroupedAssembly(formalName = "Flag Reference", useName = "flag", binding = FlagReference.class) }, groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "flags", - namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + inJson = JsonGroupAsBehavior.LIST)) private List _flags; @BoundAssembly( @@ -479,7 +479,7 @@ public static class DefineAssembly { useName = "example", maxOccurs = -1, groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "examples", - namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + inJson = JsonGroupAsBehavior.LIST)) private List _examples; public String getName() { @@ -701,7 +701,7 @@ public static class Field { useName = "prop", maxOccurs = -1, groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "props", - namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + inJson = JsonGroupAsBehavior.LIST)) private List _props; @BoundField( @@ -920,7 +920,7 @@ public static class DefineField { useName = "prop", maxOccurs = -1, groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "props", - namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + inJson = JsonGroupAsBehavior.LIST)) private List _props; @BoundField( @@ -948,7 +948,7 @@ public static class DefineField { @BoundGroupedAssembly(formalName = "Flag Reference", useName = "flag", binding = FlagReference.class) }, groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "flags", - namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + inJson = JsonGroupAsBehavior.LIST)) private List _flags; @BoundAssembly( @@ -966,7 +966,7 @@ public static class DefineField { useName = "example", maxOccurs = -1, groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "examples", - namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + inJson = JsonGroupAsBehavior.LIST)) private List _examples; public String getName() { @@ -1170,7 +1170,7 @@ public static class Choice { binding = InlineDefineField.class) }, groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "choices", - namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + inJson = JsonGroupAsBehavior.LIST)) private List _choices; @BoundAssembly( diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/AssemblyReference.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/AssemblyReference.java index 5b1acc190..870118793 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/AssemblyReference.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/AssemblyReference.java @@ -41,13 +41,13 @@ import gov.nist.secauto.metaschema.databind.model.annotations.Matches; import gov.nist.secauto.metaschema.databind.model.annotations.MetaschemaAssembly; import gov.nist.secauto.metaschema.databind.model.annotations.ValueConstraints; -import java.lang.Override; -import java.lang.String; + +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + import java.math.BigInteger; import java.util.LinkedList; import java.util.List; -import org.apache.commons.lang3.builder.ReflectionToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; @SuppressWarnings({ "PMD.DataClass", @@ -110,7 +110,7 @@ public class AssemblyReference { formalName = "Property", useName = "prop", maxOccurs = -1, - groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "props", namespace = "##default", + groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST)) private List _props; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FieldConstraints.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FieldConstraints.java index 469a616e9..a4d5f1f9d 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FieldConstraints.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FieldConstraints.java @@ -54,7 +54,7 @@ public class FieldConstraints implements IValueConstraintsBase { formalName = "Constraint Let Expression", useName = "let", maxOccurs = -1, - groupAs = @GroupAs(name = "lets", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "lets", inJson = JsonGroupAsBehavior.LIST)) private List _lets; @BoundChoiceGroup( @@ -70,7 +70,7 @@ public class FieldConstraints implements IValueConstraintsBase { @BoundGroupedAssembly(formalName = "Value Matches Constraint", useName = "matches", binding = TargetedMatchesConstraint.class) }, - groupAs = @GroupAs(name = "rules", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "rules", inJson = JsonGroupAsBehavior.LIST)) private List _rules; @Override diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FieldReference.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FieldReference.java index 0cbff61d7..a5688ec66 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FieldReference.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FieldReference.java @@ -43,13 +43,13 @@ import gov.nist.secauto.metaschema.databind.model.annotations.Matches; import gov.nist.secauto.metaschema.databind.model.annotations.MetaschemaAssembly; import gov.nist.secauto.metaschema.databind.model.annotations.ValueConstraints; -import java.lang.Override; -import java.lang.String; + +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + import java.math.BigInteger; import java.util.LinkedList; import java.util.List; -import org.apache.commons.lang3.builder.ReflectionToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; @SuppressWarnings({ "PMD.DataClass", @@ -131,7 +131,7 @@ public class FieldReference { formalName = "Property", useName = "prop", maxOccurs = -1, - groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "props", namespace = "##default", + groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST)) private List _props; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagAllowedValues.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagAllowedValues.java index c1091c614..85fb6111c 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagAllowedValues.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagAllowedValues.java @@ -122,7 +122,7 @@ public class FlagAllowedValues implements IConstraintBase { formalName = "Property", useName = "prop", maxOccurs = -1, - groupAs = @GroupAs(name = "props", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST)) private List _props; @BoundField( @@ -130,7 +130,7 @@ public class FlagAllowedValues implements IConstraintBase { useName = "enum", minOccurs = 1, maxOccurs = -1, - groupAs = @GroupAs(name = "enums", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "enums", inJson = JsonGroupAsBehavior.LIST)) private List _enums; @BoundField( diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagConstraints.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagConstraints.java index 6f6db71a9..3ed9b9082 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagConstraints.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagConstraints.java @@ -55,7 +55,7 @@ public class FlagConstraints implements IValueConstraintsBase { formalName = "Constraint Let Expression", useName = "let", maxOccurs = -1, - groupAs = @GroupAs(name = "lets", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "lets", inJson = JsonGroupAsBehavior.LIST)) private List _lets; @BoundChoiceGroup( @@ -71,7 +71,7 @@ public class FlagConstraints implements IValueConstraintsBase { @BoundGroupedAssembly(formalName = "Value Matches Constraint", useName = "matches", binding = FlagMatches.class) }, - groupAs = @GroupAs(name = "rules", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "rules", inJson = JsonGroupAsBehavior.LIST)) private List _rules; @Override diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagExpect.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagExpect.java index f609191c7..3b2c87921 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagExpect.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagExpect.java @@ -104,7 +104,7 @@ public class FlagExpect implements IConstraintBase { formalName = "Property", useName = "prop", maxOccurs = -1, - groupAs = @GroupAs(name = "props", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST)) private List _props; @BoundField( diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagIndexHasKey.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagIndexHasKey.java index 53fb36ed1..7707bf98c 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagIndexHasKey.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagIndexHasKey.java @@ -103,7 +103,7 @@ public class FlagIndexHasKey implements IConstraintBase { formalName = "Property", useName = "prop", maxOccurs = -1, - groupAs = @GroupAs(name = "props", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST)) private List _props; @BoundAssembly( @@ -111,7 +111,7 @@ public class FlagIndexHasKey implements IConstraintBase { useName = "key-field", minOccurs = 1, maxOccurs = -1, - groupAs = @GroupAs(name = "key-fields", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "key-fields", inJson = JsonGroupAsBehavior.LIST)) private List _keyFields; @BoundField( diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagMatches.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagMatches.java index dedba477e..52efdaddd 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagMatches.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagMatches.java @@ -127,7 +127,7 @@ public class FlagMatches implements IConstraintBase { formalName = "Property", useName = "prop", maxOccurs = -1, - groupAs = @GroupAs(name = "props", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST)) private List _props; @BoundField( diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagReference.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagReference.java index e0f529c33..8e507ccac 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagReference.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/FlagReference.java @@ -42,13 +42,13 @@ import gov.nist.secauto.metaschema.databind.model.annotations.GroupAs; import gov.nist.secauto.metaschema.databind.model.annotations.MetaschemaAssembly; import gov.nist.secauto.metaschema.databind.model.annotations.ValueConstraints; -import java.lang.Override; -import java.lang.String; + +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + import java.math.BigInteger; import java.util.LinkedList; import java.util.List; -import org.apache.commons.lang3.builder.ReflectionToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; @SuppressWarnings({ "PMD.DataClass", @@ -110,7 +110,7 @@ public class FlagReference { formalName = "Property", useName = "prop", maxOccurs = -1, - groupAs = @GroupAs(name = "props", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST)) private List _props; @BoundField( diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/InlineDefineAssembly.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/InlineDefineAssembly.java index 8be25ca5f..c6dad361f 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/InlineDefineAssembly.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/InlineDefineAssembly.java @@ -43,14 +43,13 @@ import gov.nist.secauto.metaschema.databind.model.annotations.Matches; import gov.nist.secauto.metaschema.databind.model.annotations.MetaschemaAssembly; import gov.nist.secauto.metaschema.databind.model.annotations.ValueConstraints; -import java.lang.Object; -import java.lang.Override; -import java.lang.String; + +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + import java.math.BigInteger; import java.util.LinkedList; import java.util.List; -import org.apache.commons.lang3.builder.ReflectionToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; @SuppressWarnings({ "PMD.DataClass", @@ -113,7 +112,7 @@ public class InlineDefineAssembly { formalName = "Property", useName = "prop", maxOccurs = -1, - groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "props", namespace = "##default", + groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST)) private List _props; @@ -135,7 +134,7 @@ public class InlineDefineAssembly { binding = InlineDefineFlag.class), @BoundGroupedAssembly(formalName = "Flag Reference", useName = "flag", binding = FlagReference.class) }, - groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "flags", namespace = "##default", + groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "flags", inJson = JsonGroupAsBehavior.LIST)) private List _flags; @@ -158,7 +157,7 @@ public class InlineDefineAssembly { useName = "example", maxOccurs = -1, groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "examples", - namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + inJson = JsonGroupAsBehavior.LIST)) private List _examples; public String getName() { diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/InlineDefineField.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/InlineDefineField.java index 5ed0f442d..b13ae5daf 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/InlineDefineField.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/InlineDefineField.java @@ -45,14 +45,13 @@ import gov.nist.secauto.metaschema.databind.model.annotations.Matches; import gov.nist.secauto.metaschema.databind.model.annotations.MetaschemaAssembly; import gov.nist.secauto.metaschema.databind.model.annotations.ValueConstraints; -import java.lang.Object; -import java.lang.Override; -import java.lang.String; + +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + import java.math.BigInteger; import java.util.LinkedList; import java.util.List; -import org.apache.commons.lang3.builder.ReflectionToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; @SuppressWarnings({ "PMD.DataClass", @@ -161,7 +160,7 @@ public class InlineDefineField { formalName = "Property", useName = "prop", maxOccurs = -1, - groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "props", namespace = "##default", + groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST)) private List _props; @@ -194,7 +193,7 @@ public class InlineDefineField { binding = InlineDefineFlag.class), @BoundGroupedAssembly(formalName = "Flag Reference", useName = "flag", binding = FlagReference.class) }, - groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "flags", namespace = "##default", + groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "flags", inJson = JsonGroupAsBehavior.LIST)) private List _flags; @@ -213,7 +212,7 @@ public class InlineDefineField { useName = "example", maxOccurs = -1, groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "examples", - namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + inJson = JsonGroupAsBehavior.LIST)) private List _examples; public String getName() { diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/InlineDefineFlag.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/InlineDefineFlag.java index 048be4ea8..b14dab385 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/InlineDefineFlag.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/InlineDefineFlag.java @@ -42,13 +42,13 @@ import gov.nist.secauto.metaschema.databind.model.annotations.GroupAs; import gov.nist.secauto.metaschema.databind.model.annotations.MetaschemaAssembly; import gov.nist.secauto.metaschema.databind.model.annotations.ValueConstraints; -import java.lang.Override; -import java.lang.String; + +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + import java.math.BigInteger; import java.util.LinkedList; import java.util.List; -import org.apache.commons.lang3.builder.ReflectionToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; @SuppressWarnings({ "PMD.DataClass", @@ -135,7 +135,7 @@ public class InlineDefineFlag { formalName = "Property", useName = "prop", maxOccurs = -1, - groupAs = @GroupAs(name = "props", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST)) private List _props; @BoundAssembly( @@ -152,7 +152,7 @@ public class InlineDefineFlag { formalName = "Example", useName = "example", maxOccurs = -1, - groupAs = @GroupAs(name = "examples", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "examples", inJson = JsonGroupAsBehavior.LIST)) private List _examples; public String getName() { diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/METASCHEMA.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/METASCHEMA.java index 94f036f94..4a2e711e4 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/METASCHEMA.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/METASCHEMA.java @@ -49,15 +49,14 @@ import gov.nist.secauto.metaschema.databind.model.annotations.MetaschemaAssembly; import gov.nist.secauto.metaschema.databind.model.annotations.MetaschemaField; import gov.nist.secauto.metaschema.databind.model.annotations.ValueConstraints; -import java.lang.Object; -import java.lang.Override; -import java.lang.String; + +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + import java.math.BigInteger; import java.net.URI; import java.util.LinkedList; import java.util.List; -import org.apache.commons.lang3.builder.ReflectionToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; /** * A declaration of the Metaschema module. @@ -139,7 +138,7 @@ public class METASCHEMA { description = "Imports a set of Metaschema modules contained in another resource. Imports support the reuse of common information structures.", useName = "import", maxOccurs = -1, - groupAs = @GroupAs(name = "imports", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "imports", inJson = JsonGroupAsBehavior.LIST)) private List _imports; @BoundChoiceGroup( @@ -153,7 +152,7 @@ public class METASCHEMA { @BoundGroupedAssembly(formalName = "Global Flag Definition", useName = "define-flag", binding = DefineFlag.class) }, - groupAs = @GroupAs(name = "definitions", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "definitions", inJson = JsonGroupAsBehavior.LIST)) private List _definitions; public String getAbstract() { @@ -346,7 +345,7 @@ public static class DefineField { formalName = "Property", useName = "prop", maxOccurs = -1, - groupAs = @GroupAs(name = "props", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST)) private List _props; @BoundField( @@ -379,7 +378,7 @@ public static class DefineField { binding = InlineDefineFlag.class), @BoundGroupedAssembly(formalName = "Flag Reference", useName = "flag", binding = FlagReference.class) }, - groupAs = @GroupAs(name = "flags", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "flags", inJson = JsonGroupAsBehavior.LIST)) private List _flags; @BoundAssembly( @@ -396,7 +395,7 @@ public static class DefineField { formalName = "Example", useName = "example", maxOccurs = -1, - groupAs = @GroupAs(name = "examples", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "examples", inJson = JsonGroupAsBehavior.LIST)) private List _examples; public String getName() { @@ -682,7 +681,7 @@ public static class DefineFlag { formalName = "Property", useName = "prop", maxOccurs = -1, - groupAs = @GroupAs(name = "props", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST)) private List _props; @BoundField( @@ -705,7 +704,7 @@ public static class DefineFlag { formalName = "Example", useName = "example", maxOccurs = -1, - groupAs = @GroupAs(name = "examples", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "examples", inJson = JsonGroupAsBehavior.LIST)) private List _examples; public String getName() { @@ -970,7 +969,7 @@ public static class DefineAssembly { formalName = "Property", useName = "prop", maxOccurs = -1, - groupAs = @GroupAs(name = "props", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST)) private List _props; @BoundField( @@ -999,7 +998,7 @@ public static class DefineAssembly { binding = InlineDefineFlag.class), @BoundGroupedAssembly(formalName = "Flag Reference", useName = "flag", binding = FlagReference.class) }, - groupAs = @GroupAs(name = "flags", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "flags", inJson = JsonGroupAsBehavior.LIST)) private List _flags; @BoundAssembly( @@ -1020,7 +1019,7 @@ public static class DefineAssembly { formalName = "Example", useName = "example", maxOccurs = -1, - groupAs = @GroupAs(name = "examples", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "examples", inJson = JsonGroupAsBehavior.LIST)) private List _examples; public String getName() { diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/MetapathContext.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/MetapathContext.java index 6edea95c9..98ea9635a 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/MetapathContext.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/MetapathContext.java @@ -52,7 +52,7 @@ public class MetapathContext { useName = "metapath", minOccurs = 1, maxOccurs = -1, - groupAs = @GroupAs(name = "metapaths", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "metapaths", inJson = JsonGroupAsBehavior.LIST)) private List _metapaths; @BoundAssembly( @@ -62,7 +62,7 @@ public class MetapathContext { @BoundAssembly( useName = "metapath-context", maxOccurs = -1, - groupAs = @GroupAs(name = "metapath-contexts", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "metapath-contexts", inJson = JsonGroupAsBehavior.LIST)) private List _metapathContexts; @BoundField( diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/MetaschemaMetaConstraints.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/MetaschemaMetaConstraints.java index 364eaaa60..057591ef7 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/MetaschemaMetaConstraints.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/MetaschemaMetaConstraints.java @@ -63,7 +63,7 @@ public class MetaschemaMetaConstraints { description = "Declares a set of Metaschema constraints from an out-of-line resource to import, supporting composition of constraint sets.", useName = "import", maxOccurs = -1, - groupAs = @GroupAs(name = "imports", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "imports", inJson = JsonGroupAsBehavior.LIST)) private List _imports; @BoundAssembly( @@ -74,7 +74,7 @@ public class MetaschemaMetaConstraints { useName = "metapath-context", minOccurs = 1, maxOccurs = -1, - groupAs = @GroupAs(name = "metapath-contexts", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "metapath-contexts", inJson = JsonGroupAsBehavior.LIST)) private List _metapathContexts; public List getImports() { diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/MetaschemaModuleConstraints.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/MetaschemaModuleConstraints.java index e40f725aa..1fb17e0fd 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/MetaschemaModuleConstraints.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/MetaschemaModuleConstraints.java @@ -83,14 +83,14 @@ public class MetaschemaModuleConstraints { description = "Declares a set of Metaschema constraints from an out-of-line resource to import, supporting composition of constraint sets.", useName = "import", maxOccurs = -1, - groupAs = @GroupAs(name = "imports", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "imports", inJson = JsonGroupAsBehavior.LIST)) private List _imports; @BoundAssembly( useName = "scope", minOccurs = 1, maxOccurs = -1, - groupAs = @GroupAs(name = "scopes", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "scopes", inJson = JsonGroupAsBehavior.LIST)) private List _scopes; public String getName() { @@ -208,7 +208,7 @@ public static class Scope { @BoundGroupedAssembly(useName = "field", binding = Field.class), @BoundGroupedAssembly(useName = "flag", binding = Flag.class) }, - groupAs = @GroupAs(name = "constraints", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "constraints", inJson = JsonGroupAsBehavior.LIST)) private List _constraints; @BoundField( @@ -278,7 +278,7 @@ public static class Flag implements IValueConstraintsBase { @BoundGroupedAssembly(formalName = "Value Matches Constraint", useName = "matches", binding = FlagMatches.class) }, - groupAs = @GroupAs(name = "rules", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "rules", inJson = JsonGroupAsBehavior.LIST)) private List _rules; @Override @@ -333,7 +333,7 @@ public static class Field implements IValueConstraintsBase { @BoundGroupedAssembly(formalName = "Value Matches Constraint", useName = "matches", binding = TargetedMatchesConstraint.class) }, - groupAs = @GroupAs(name = "rules", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "rules", inJson = JsonGroupAsBehavior.LIST)) private List _rules; public String getTarget() { @@ -394,7 +394,7 @@ public static class Assembly implements IModelConstraintsBase { @BoundGroupedAssembly(formalName = "Targeted Cardinality Constraint", useName = "has-cardinality", binding = TargetedHasCardinalityConstraint.class) }, - groupAs = @GroupAs(name = "rules", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "rules", inJson = JsonGroupAsBehavior.LIST)) private List _rules; public String getTarget() { diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedAllowedValuesConstraint.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedAllowedValuesConstraint.java index 971151767..edf02a210 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedAllowedValuesConstraint.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedAllowedValuesConstraint.java @@ -130,7 +130,7 @@ public class TargetedAllowedValuesConstraint implements ITargetedConstraintBase formalName = "Property", useName = "prop", maxOccurs = -1, - groupAs = @GroupAs(name = "props", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST)) private List _props; @BoundField( @@ -138,7 +138,7 @@ public class TargetedAllowedValuesConstraint implements ITargetedConstraintBase useName = "enum", minOccurs = 1, maxOccurs = -1, - groupAs = @GroupAs(name = "enums", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "enums", inJson = JsonGroupAsBehavior.LIST)) private List _enums; @BoundField( diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedExpectConstraint.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedExpectConstraint.java index ddd306fa6..de17f639e 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedExpectConstraint.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedExpectConstraint.java @@ -111,7 +111,7 @@ public class TargetedExpectConstraint implements ITargetedConstraintBase { formalName = "Property", useName = "prop", maxOccurs = -1, - groupAs = @GroupAs(name = "props", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST)) private List _props; @BoundField( diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedHasCardinalityConstraint.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedHasCardinalityConstraint.java index c20099b25..b6a09bf8f 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedHasCardinalityConstraint.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedHasCardinalityConstraint.java @@ -121,7 +121,7 @@ public class TargetedHasCardinalityConstraint implements ITargetedConstraintBase formalName = "Property", useName = "prop", maxOccurs = -1, - groupAs = @GroupAs(name = "props", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST)) private List _props; @BoundField( diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedIndexConstraint.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedIndexConstraint.java index 58d63835c..6051f9e97 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedIndexConstraint.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedIndexConstraint.java @@ -111,7 +111,7 @@ public class TargetedIndexConstraint implements ITargetedConstraintBase { formalName = "Property", useName = "prop", maxOccurs = -1, - groupAs = @GroupAs(name = "props", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST)) private List _props; @BoundAssembly( @@ -119,7 +119,7 @@ public class TargetedIndexConstraint implements ITargetedConstraintBase { useName = "key-field", minOccurs = 1, maxOccurs = -1, - groupAs = @GroupAs(name = "key-fields", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "key-fields", inJson = JsonGroupAsBehavior.LIST)) private List _keyFields; @BoundField( diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedIndexHasKeyConstraint.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedIndexHasKeyConstraint.java index 8dd650d3d..d9aedbb56 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedIndexHasKeyConstraint.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedIndexHasKeyConstraint.java @@ -111,7 +111,7 @@ public class TargetedIndexHasKeyConstraint implements ITargetedConstraintBase { formalName = "Property", useName = "prop", maxOccurs = -1, - groupAs = @GroupAs(name = "props", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST)) private List _props; @BoundAssembly( @@ -119,7 +119,7 @@ public class TargetedIndexHasKeyConstraint implements ITargetedConstraintBase { useName = "key-field", minOccurs = 1, maxOccurs = -1, - groupAs = @GroupAs(name = "key-fields", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "key-fields", inJson = JsonGroupAsBehavior.LIST)) private List _keyFields; @BoundField( diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedIsUniqueConstraint.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedIsUniqueConstraint.java index c4cc2e4b9..e8eedd6d6 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedIsUniqueConstraint.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedIsUniqueConstraint.java @@ -104,7 +104,7 @@ public class TargetedIsUniqueConstraint implements ITargetedConstraintBase { formalName = "Property", useName = "prop", maxOccurs = -1, - groupAs = @GroupAs(name = "props", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST)) private List _props; @BoundAssembly( @@ -112,7 +112,7 @@ public class TargetedIsUniqueConstraint implements ITargetedConstraintBase { useName = "key-field", minOccurs = 1, maxOccurs = -1, - groupAs = @GroupAs(name = "key-fields", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "key-fields", inJson = JsonGroupAsBehavior.LIST)) private List _keyFields; @BoundField( diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedMatchesConstraint.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedMatchesConstraint.java index 3eaa1a743..25ce66f60 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedMatchesConstraint.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/binding/TargetedMatchesConstraint.java @@ -134,7 +134,7 @@ public class TargetedMatchesConstraint implements ITargetedConstraintBase { formalName = "Property", useName = "prop", maxOccurs = -1, - groupAs = @GroupAs(name = "props", namespace = "##default", inJson = JsonGroupAsBehavior.LIST)) + groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST)) private List _props; @BoundField( diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/DefinitionAssemblyGlobal.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/DefinitionAssemblyGlobal.java index 5a673e161..fe9a86242 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/DefinitionAssemblyGlobal.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/DefinitionAssemblyGlobal.java @@ -30,14 +30,15 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItemFactory; +import gov.nist.secauto.metaschema.core.model.AbstractGlobalAssemblyDefinition; import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition; +import gov.nist.secauto.metaschema.core.model.IAssemblyInstance; import gov.nist.secauto.metaschema.core.model.IAssemblyInstanceAbsolute; import gov.nist.secauto.metaschema.core.model.IAttributable; import gov.nist.secauto.metaschema.core.model.IChoiceGroupInstance; import gov.nist.secauto.metaschema.core.model.IChoiceInstance; import gov.nist.secauto.metaschema.core.model.IContainerFlagSupport; import gov.nist.secauto.metaschema.core.model.IContainerModelAssemblySupport; -import gov.nist.secauto.metaschema.core.model.IFeatureContainerFlag; import gov.nist.secauto.metaschema.core.model.IFieldInstanceAbsolute; import gov.nist.secauto.metaschema.core.model.IFlagInstance; import gov.nist.secauto.metaschema.core.model.IMetaschemaModule; @@ -60,11 +61,18 @@ import nl.talsmasoftware.lazy4j.Lazy; public class DefinitionAssemblyGlobal - extends AbstractDefinition - implements IAssemblyDefinition, - IFeatureContainerFlag, - IFeatureBindingContainerModelAssembly { - + extends AbstractGlobalAssemblyDefinition< + IMetaschemaModule, + IAssemblyInstance, + IFlagInstance, + IModelInstanceAbsolute, + INamedModelInstanceAbsolute, + IFieldInstanceAbsolute, + IAssemblyInstanceAbsolute, + IChoiceInstance, + IChoiceGroupInstance> { + @NonNull + private final METASCHEMA.DefineAssembly binding; @NonNull private final Map> properties; @NonNull @@ -104,7 +112,8 @@ public DefinitionAssemblyGlobal( int position, @NonNull IMetaschemaModule module, @NonNull INodeItemFactory nodeItemFactory) { - super(binding, module); + super(module); + this.binding = binding; this.properties = ModelSupport.parseProperties(ObjectUtils.requireNonNull(binding.getProps())); this.flagContainer = ObjectUtils.notNull(Lazy.lazy(() -> { JsonKey jsonKey = getBinding().getJsonKey(); @@ -136,6 +145,11 @@ public DefinitionAssemblyGlobal( position)))); } + @NonNull + protected METASCHEMA.DefineAssembly getBinding() { + return binding; + } + @Override public IContainerFlagSupport getFlagContainer() { return ObjectUtils.notNull(flagContainer.get()); @@ -157,7 +171,6 @@ public IModelConstrained getConstraintSupport() { return ObjectUtils.notNull(modelConstraints.get()); } - @SuppressWarnings("null") @Override public IAssemblyNodeItem getNodeItem() { return boundNodeItem.get(); diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/DefinitionFieldGlobal.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/DefinitionFieldGlobal.java index 56be160ac..baf70d986 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/DefinitionFieldGlobal.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/DefinitionFieldGlobal.java @@ -30,10 +30,10 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; +import gov.nist.secauto.metaschema.core.model.AbstractGlobalFieldDefinition; import gov.nist.secauto.metaschema.core.model.IAttributable; import gov.nist.secauto.metaschema.core.model.IContainerFlagSupport; -import gov.nist.secauto.metaschema.core.model.IFeatureContainerFlag; -import gov.nist.secauto.metaschema.core.model.IFieldDefinition; +import gov.nist.secauto.metaschema.core.model.IFieldInstance; import gov.nist.secauto.metaschema.core.model.IFlagInstance; import gov.nist.secauto.metaschema.core.model.IMetaschemaModule; import gov.nist.secauto.metaschema.core.model.ModuleScopeEnum; @@ -55,9 +55,9 @@ import nl.talsmasoftware.lazy4j.Lazy; public class DefinitionFieldGlobal - extends AbstractDefinition - implements IFieldDefinition, - IFeatureContainerFlag { + extends AbstractGlobalFieldDefinition { + @NonNull + private final METASCHEMA.DefineField binding; @NonNull private final Map> properties; @NonNull @@ -76,7 +76,8 @@ public DefinitionFieldGlobal( @NonNull IBoundInstanceModelGroupedAssembly bindingInstance, int position, @NonNull IMetaschemaModule module) { - super(binding, module); + super(module); + this.binding = binding; this.properties = ModelSupport.parseProperties(ObjectUtils.requireNonNull(getBinding().getProps())); this.javaTypeAdapter = ModelSupport.dataType(getBinding().getAsType()); this.defaultValue = ModelSupport.defaultValue(getBinding().getDefault(), this.javaTypeAdapter); @@ -102,6 +103,11 @@ public DefinitionFieldGlobal( position)))); } + @NonNull + protected METASCHEMA.DefineField getBinding() { + return binding; + } + @Override public IContainerFlagSupport getFlagContainer() { return ObjectUtils.notNull(flagContainer.get()); diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/DefinitionFlagGlobal.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/DefinitionFlagGlobal.java index fae413a9f..2f158cfad 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/DefinitionFlagGlobal.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/DefinitionFlagGlobal.java @@ -31,8 +31,9 @@ import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; import gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem; import gov.nist.secauto.metaschema.core.metapath.item.node.INodeItem; +import gov.nist.secauto.metaschema.core.model.AbstractGlobalFlagDefinition; import gov.nist.secauto.metaschema.core.model.IAttributable; -import gov.nist.secauto.metaschema.core.model.IFlagDefinition; +import gov.nist.secauto.metaschema.core.model.IFlagInstance; import gov.nist.secauto.metaschema.core.model.IMetaschemaModule; import gov.nist.secauto.metaschema.core.model.ModuleScopeEnum; import gov.nist.secauto.metaschema.core.model.constraint.ISource; @@ -51,8 +52,9 @@ import nl.talsmasoftware.lazy4j.Lazy; public class DefinitionFlagGlobal - extends AbstractDefinition - implements IFlagDefinition { + extends AbstractGlobalFlagDefinition { + @NonNull + private final METASCHEMA.DefineFlag binding; @NonNull private final Map> properties; @NonNull @@ -83,7 +85,8 @@ public DefinitionFlagGlobal( @NonNull IBoundInstanceModelGroupedAssembly bindingInstance, int position, @NonNull IMetaschemaModule module) { - super(binding, module); + super(module); + this.binding = binding; this.properties = ModelSupport.parseProperties(ObjectUtils.requireNonNull(getBinding().getProps())); this.javaTypeAdapter = ModelSupport.dataType(getBinding().getAsType()); this.defaultValue = ModelSupport.defaultValue(getBinding().getDefault(), this.javaTypeAdapter); @@ -101,6 +104,11 @@ public DefinitionFlagGlobal( position)))); } + @NonNull + protected METASCHEMA.DefineFlag getBinding() { + return binding; + } + @Override public IValueConstrained getConstraintSupport() { return ObjectUtils.notNull(valueConstraints.get()); @@ -165,29 +173,4 @@ public MarkupMultiline getRemarks() { public INodeItem getNodeItem() { return boundNodeItem.get(); } - - // private class NodeItem - // extends AbstractGroupedAssemblyInstanceNodeItem { - // private NodeItem( - // @NonNull IAssemblyInstanceGrouped instance, - // int position, - // @NonNull INodeItemGenerator generator) { - // super(instance, position, generator); - // } - // - // @Override - // public IAssemblyNodeItem getParentNodeItem() { - // return getContainingModule().getBoundNodeItem(); - // } - // - // @Override - // public IAssemblyNodeItem getParentContentNodeItem() { - // return getParentNodeItem(); - // } - // - // @Override - // public METASCHEMA.DefineFlag getValue() { - // return getBinding(); - // } - // } } diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/GroupAsImpl.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/GroupAsImpl.java index d3ce622cc..0538373bb 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/GroupAsImpl.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/impl/GroupAsImpl.java @@ -26,40 +26,34 @@ package gov.nist.secauto.metaschema.databind.model.metaschema.impl; +import gov.nist.secauto.metaschema.core.model.IModule; import gov.nist.secauto.metaschema.core.model.JsonGroupAsBehavior; import gov.nist.secauto.metaschema.core.model.XmlGroupAsBehavior; import gov.nist.secauto.metaschema.core.util.ObjectUtils; import gov.nist.secauto.metaschema.databind.model.IGroupAs; import gov.nist.secauto.metaschema.databind.model.metaschema.binding.GroupAs; +import javax.xml.namespace.QName; + import edu.umd.cs.findbugs.annotations.NonNull; -import edu.umd.cs.findbugs.annotations.Nullable; class GroupAsImpl implements IGroupAs { @NonNull - private final String name; - @Nullable - private final String namespace; + private final QName qname; @NonNull private final JsonGroupAsBehavior jsonBehavior; @NonNull private final XmlGroupAsBehavior xmlBehavior; - public GroupAsImpl(@NonNull GroupAs groupAs, @Nullable String namespace) { - this.name = ObjectUtils.requireNonNull(groupAs.getName()); - this.namespace = namespace; + public GroupAsImpl(@NonNull GroupAs groupAs, @NonNull IModule module) { + this.qname = module.toModelQName(ObjectUtils.requireNonNull(groupAs.getName())); this.jsonBehavior = ModelSupport.groupAsJsonBehavior(groupAs.getInJson()); this.xmlBehavior = ModelSupport.groupAsXmlBehavior(groupAs.getInXml()); } @Override - public String getGroupAsName() { - return name; - } - - @Override - public String getGroupAsXmlNamespace() { - return namespace; + public QName getGroupAsQName() { + return qname; } @Override