From 86ba9513069d478592b19134554019f707f3119d Mon Sep 17 00:00:00 2001 From: David Waltermire Date: Sun, 27 Oct 2024 00:19:59 -0400 Subject: [PATCH] Added and fixed some javadocs. --- core/metaschema | 2 +- .../core/metapath/item/atomic/IIntegerItem.java | 6 ++---- .../function/library/FnDocumentAvailableTest.java | 4 ++++ .../databind/io/DeserializationFeature.java | 2 +- .../model/metaschema/BindingModuleLoader.java | 13 +++++++++++++ 5 files changed, 21 insertions(+), 6 deletions(-) diff --git a/core/metaschema b/core/metaschema index 5911830cd..73e2499c2 160000 --- a/core/metaschema +++ b/core/metaschema @@ -1 +1 @@ -Subproject commit 5911830cd91da3d0dd270d26c43dd5ead24ed6f3 +Subproject commit 73e2499c2ea345b4afd1876eca04da1107a9e3c0 diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IIntegerItem.java b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IIntegerItem.java index db6b14002..4cc2b3945 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IIntegerItem.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/metapath/item/atomic/IIntegerItem.java @@ -55,8 +55,7 @@ static IIntegerItem valueOf(@NonNull String value) { @NonNull static IIntegerItem valueOf(int value) { @SuppressWarnings("null") - @NonNull - BigInteger bigInteger = BigInteger.valueOf(value); + @NonNull BigInteger bigInteger = BigInteger.valueOf(value); return valueOf(bigInteger); } @@ -70,8 +69,7 @@ static IIntegerItem valueOf(int value) { @NonNull static IIntegerItem valueOf(long value) { @SuppressWarnings("null") - @NonNull - BigInteger bigInteger = BigInteger.valueOf(value); + @NonNull BigInteger bigInteger = BigInteger.valueOf(value); return valueOf(bigInteger); } diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDocumentAvailableTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDocumentAvailableTest.java index 3c03fa371..3f7ec6be0 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDocumentAvailableTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/function/library/FnDocumentAvailableTest.java @@ -1,3 +1,7 @@ +/* + * SPDX-FileCopyrightText: none + * SPDX-License-Identifier: CC0-1.0 + */ package gov.nist.secauto.metaschema.core.metapath.function.library; diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/DeserializationFeature.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/DeserializationFeature.java index fc3d008c0..c01766b92 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/DeserializationFeature.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/io/DeserializationFeature.java @@ -24,7 +24,7 @@ public final class DeserializationFeature = new DeserializationFeature<>("validate", Boolean.class, false); /** - * If enabled, perform constraint validation on the deserialized bound objects. + * If enabled, allow inline XML entities to be automatically replaced. */ @NonNull public static final DeserializationFeature DESERIALIZE_XML_ALLOW_ENTITY_RESOLUTION diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/BindingModuleLoader.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/BindingModuleLoader.java index 7d7d1c228..16c4c7213 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/BindingModuleLoader.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/metaschema/BindingModuleLoader.java @@ -18,6 +18,7 @@ import gov.nist.secauto.metaschema.databind.model.IBoundDefinitionModelAssembly; import gov.nist.secauto.metaschema.databind.model.binding.metaschema.METASCHEMA; import gov.nist.secauto.metaschema.databind.model.binding.metaschema.METASCHEMA.Import; +import gov.nist.secauto.metaschema.databind.model.binding.metaschema.MetaschemaModelModule; import gov.nist.secauto.metaschema.databind.model.metaschema.impl.BindingModule; import java.io.IOException; @@ -29,6 +30,10 @@ import edu.umd.cs.findbugs.annotations.NonNull; import nl.talsmasoftware.lazy4j.Lazy; +/** + * A module loader implementation that parses Metaschema modules using the + * built-in model {@link MetaschemaModelModule} binding. + */ public class BindingModuleLoader extends AbstractModuleLoader implements IMutableConfiguration> { @@ -89,6 +94,11 @@ protected METASCHEMA parseModule(URI resource) throws IOException { return getLoader().load(METASCHEMA.class, resource); } + /** + * Get the underlying bound loader. + * + * @return the loader + */ protected IBoundLoader getLoader() { return ObjectUtils.notNull(loader.get()); } @@ -114,6 +124,9 @@ public IMutableConfiguration> set(DeserializationFeatu return getLoader().set(feature, value); } + /** + * Allow inline XML entities to be automatically replaced. + */ public void allowEntityResolution() { enableFeature(DeserializationFeature.DESERIALIZE_XML_ALLOW_ENTITY_RESOLUTION); }