diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundFieldValue.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundFieldValue.java index bcfab0c3a..25b4e017c 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundFieldValue.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundFieldValue.java @@ -81,16 +81,6 @@ default Object getEffectiveDefaultValue() { return getDefaultValue(); } - @Override - default Object getValue(Object parent) { - return IBoundProperty.super.getValue(parent); - } - - @Override - default void setValue(Object parentObject, Object value) { - IBoundProperty.super.setValue(parentObject, value); - } - @Override default Object readItem(Object parent, IItemReadHandler handler) throws IOException { return handler.readItemFieldValue(ObjectUtils.requireNonNull(parent, "parent"), this); diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundInstance.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundInstance.java index e662a298b..1f99e1306 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundInstance.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundInstance.java @@ -28,10 +28,34 @@ import gov.nist.secauto.metaschema.core.model.IInstance; +import edu.umd.cs.findbugs.annotations.NonNull; +import edu.umd.cs.findbugs.annotations.Nullable; + /** * Represents a Metaschema module instance bound to Java data. */ public interface IBoundInstance extends IBoundProperty, IInstance { @Override IBoundDefinitionModel getContainingDefinition(); + + /** + * {@inheritDoc} + *
+ * Always bound to a field. + */ + @Override + @Nullable + default Object getValue(@NonNull Object parent) { + return IBoundProperty.super.getValue(parent); + } + + /** + * {@inheritDoc} + *
+ * Always bound to a field. + */ + @Override + default void setValue(@NonNull Object parentObject, @Nullable Object value) { + IBoundProperty.super.setValue(parentObject, value); + } } diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundInstanceFlag.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundInstanceFlag.java index 5f3dc64fc..7f0b8daa3 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundInstanceFlag.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundInstanceFlag.java @@ -41,7 +41,6 @@ import javax.xml.namespace.QName; import edu.umd.cs.findbugs.annotations.NonNull; -import edu.umd.cs.findbugs.annotations.Nullable; /** * Represents a flag instance bound to Java data. @@ -116,27 +115,6 @@ default IBoundInstanceFlag getInlineInstance() { return this; } - /** - * {@inheritDoc} - *
- * Always bound to a field. - */ - @Override - @Nullable - default Object getValue(@NonNull Object parent) { - return IBoundInstance.super.getValue(parent); - } - - /** - * {@inheritDoc} - *
- * Always bound to a field. - */ - @Override - default void setValue(@NonNull Object parentObject, @Nullable Object value) { - IBoundInstance.super.setValue(parentObject, value); - } - @Override default void deepCopy(@NonNull Object fromInstance, @NonNull Object toInstance) throws BindingException { Object value = getValue(fromInstance); diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundInstanceModel.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundInstanceModel.java index 6ee165e49..29839a477 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundInstanceModel.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundInstanceModel.java @@ -114,13 +114,4 @@ default Collection extends Object> getItemValues(Object value) { @Nullable IBoundInstanceFlag getItemJsonKey(@NonNull Object item); - /** - * {@inheritDoc} - *
- * Always bound to a field. - */ - @Override - default Object getValue(Object parent) { - return IBoundInstance.super.getValue(parent); - } } diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundInstanceModelField.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundInstanceModelField.java index d3307841f..d27f106da 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundInstanceModelField.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundInstanceModelField.java @@ -87,4 +87,5 @@ default boolean canHandleXmlQName(QName qname) { } return retval; } + } diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundInstanceModelFieldScalar.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundInstanceModelFieldScalar.java index 95a185227..c9c543f82 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundInstanceModelFieldScalar.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundInstanceModelFieldScalar.java @@ -90,26 +90,6 @@ default IBoundInstanceFlag getJsonValueKeyFlagInstance() { return null; } - /** - * {@inheritDoc} - *
- * Always bound to a field. - */ - @Override - default Object getValue(Object parent) { - return IBoundInstanceModelField.super.getValue(parent); - } - - /** - * {@inheritDoc} - *
- * Always bound to a field. - */ - @Override - default void setValue(Object parentObject, Object value) { - IBoundInstanceModelField.super.setValue(parentObject, value); - } - @Override default Object readItem(Object parent, IItemReadHandler handler) throws IOException { return handler.readItemField(ObjectUtils.requireNonNull(parent, "parent"), this); diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/info/IFeatureScalarItemValueHandler.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/info/IFeatureScalarItemValueHandler.java index d62b4763d..e1bd55c39 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/info/IFeatureScalarItemValueHandler.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/info/IFeatureScalarItemValueHandler.java @@ -28,17 +28,13 @@ import gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter; import gov.nist.secauto.metaschema.databind.io.BindingException; +import gov.nist.secauto.metaschema.databind.model.IValuedMutable; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.Nullable; public interface IFeatureScalarItemValueHandler - extends IItemValueHandler { - - @Nullable - Object getValue(@NonNull Object parent); - - void setValue(@NonNull Object parent, Object value); + extends IItemValueHandler, IValuedMutable { default void setValue(@NonNull Object parent, @NonNull String text) { Object item = getValueFromString(text);