Skip to content

Commit

Permalink
Added and fixed some javadocs.
Browse files Browse the repository at this point in the history
  • Loading branch information
david-waltermire committed Oct 27, 2024
1 parent 1b5abbc commit 86ba951
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core/metaschema
Submodule metaschema updated 87 files
+12 −4 schema/metaschema/metaschema-module-metaschema.xml
+1 −1 test-suite/schema-generation/allowed-values/allowed-values-basic_metaschema.xml
+1 −1 test-suite/schema-generation/allowed-values/allowed-values-basic_test_baddates_FAIL.json
+1 −1 test-suite/schema-generation/allowed-values/allowed-values-basic_test_badvalues_FAIL.json
+2 −2 test-suite/schema-generation/allowed-values/allowed-values-basic_test_valid_FAIL.xml
+1 −1 test-suite/schema-generation/allowed-values/allowed-values-basic_test_valid_PASS.json
+2 −2 test-suite/schema-generation/allowed-values/allowed-values-basic_test_valid_PASS.xml
+4 −4 test-suite/schema-generation/choice/choice-multiple_metaschema.xml
+1 −1 test-suite/schema-generation/choice/choice-multiple_test_multiple_PASS.json
+0 −61 test-suite/schema-generation/choice/target/choice-multiple_metaschema-jsonschema.json
+0 −235 test-suite/schema-generation/choice/target/choice-multiple_metaschema-xmlschema.xsd
+1 −1 test-suite/schema-generation/collapsible/collapsible-no-op_metaschema.xml
+1 −1 test-suite/schema-generation/collapsible/collapsible_metaschema.xml
+1 −1 test-suite/schema-generation/collapsible/collapsible_test_multiple_PASS.json
+1 −1 test-suite/schema-generation/collapsible/collapsible_test_singleton_PASS.json
+4 −4 test-suite/schema-generation/datatypes/datatypes-prose_metaschema.xml
+1 −1 test-suite/schema-generation/datatypes/datatypes-prose_test_bad-date_FAIL.json
+1 −1 test-suite/schema-generation/datatypes/datatypes-prose_test_valid_PASS.json
+9 −5 test-suite/schema-generation/datatypes/datatypes-token_metaschema.xml
+0 −0 test-suite/schema-generation/datatypes/datatypes-token_test_invalid2_FAIL.json
+2 −2 test-suite/schema-generation/datatypes/datatypes-token_test_invalid_FAIL.json
+2 −2 test-suite/schema-generation/datatypes/datatypes-token_test_invalid_FAIL.xml
+1 −1 test-suite/schema-generation/datatypes/datatypes-token_test_valid2_PASS.json
+3 −3 test-suite/schema-generation/datatypes/datatypes-token_test_valid_PASS.json
+1 −1 test-suite/schema-generation/datatypes/datatypes-uri_metaschema.xml
+1 −1 test-suite/schema-generation/datatypes/datatypes-uri_test_broken_FAIL.json
+1 −1 test-suite/schema-generation/datatypes/datatypes-uri_test_valid_PASS.json
+3 −3 test-suite/schema-generation/datatypes/datatypes-uuid_metaschema.xml
+1 −1 test-suite/schema-generation/datatypes/datatypes-uuid_test_valid_PASS.json
+1 −1 test-suite/schema-generation/datatypes/datatypes-uuid_test_version-1-invalid_FAIL.json
+5 −5 test-suite/schema-generation/dates-times/datatypes-date_metaschema.xml
+2 −2 test-suite/schema-generation/dates-times/datatypes-date_test_fancy_FAIL.xml
+1 −1 test-suite/schema-generation/dates-times/datatypes-date_test_tricky_FAIL.json
+1 −1 test-suite/schema-generation/dates-times/datatypes-date_test_valid_PASS.json
+2 −2 test-suite/schema-generation/dates-times/datatypes-date_test_valid_PASS.xml
+0 −62 test-suite/schema-generation/dates-times/datatypes-datetime-no-tz_json-schema.json
+5 −5 test-suite/schema-generation/dates-times/datatypes-datetime-no-tz_metaschema.xml
+1 −1 test-suite/schema-generation/dates-times/datatypes-datetime-no-tz_test_valid_PASS.json
+2 −2 test-suite/schema-generation/dates-times/datatypes-datetime-notz_test_valid_PASS.xml
+2 −2 test-suite/schema-generation/dates-times/datatypes-datetime-notz_test_various_FAIL.xml
+1 −1 test-suite/schema-generation/dates-times/datatypes-datetime_metaschema.xml
+1 −1 test-suite/schema-generation/dates-times/datatypes-datetime_test_valid_PASS.json
+2 −2 test-suite/schema-generation/dates-times/datatypes-datetime_test_valid_PASS.xml
+2 −2 test-suite/schema-generation/dates-times/datatypes-datetime_test_various_FAIL.xml
+2 −2 test-suite/schema-generation/dates-times/datatypes-datetime_test_working_FAIL.xml
+2 −2 test-suite/schema-generation/dates-times/datatypes-datetime_test_working_PASS.xml
+1 −1 test-suite/schema-generation/flag/flag-basic_metaschema.xml
+1 −1 test-suite/schema-generation/flag/flag-basic_test_datatype_FAIL.json
+1 −1 test-suite/schema-generation/flag/flag-basic_test_simple_PASS.json
+2 −2 test-suite/schema-generation/flag/flag-override_metaschema.xml
+3 −3 test-suite/schema-generation/group-as/group-as-array-bounded_metaschema.xml
+1 −1 test-suite/schema-generation/group-as/group-as-array-bounded_test_array-inside_PASS.json
+1 −1 test-suite/schema-generation/group-as/group-as-array-bounded_test_array-singleton_FAIL.json
+1 −1 test-suite/schema-generation/group-as/group-as-array-bounded_test_array-upper_FAIL.json
+4 −4 test-suite/schema-generation/group-as/group-as-array-invalid-max_metaschema.xml
+3 −3 test-suite/schema-generation/group-as/group-as-array-optional_metaschema.xml
+1 −1 test-suite/schema-generation/group-as/group-as-array-optional_test_empty_FAIL.json
+1 −1 test-suite/schema-generation/group-as/group-as-array-optional_test_valid_PASS.json
+1 −1 test-suite/schema-generation/group-as/group-as-array_metaschema.xml
+1 −1 test-suite/schema-generation/group-as/group-as-array_test_singleton_FAIL.json
+1 −1 test-suite/schema-generation/group-as/group-as-array_test_valid_PASS.json
+3 −3 test-suite/schema-generation/group-as/group-as-by-key_metaschema.xml
+1 −1 test-suite/schema-generation/group-as/group-as-by-key_test_invalid-child_FAIL.json
+1 −1 test-suite/schema-generation/group-as/group-as-by-key_test_valid_PASS.json
+4 −4 test-suite/schema-generation/group-as/group-as-misc_metaschema.xml
+3 −3 test-suite/schema-generation/group-as/group-as-singleton-or-array-optional_metaschema.xml
+1 −1 test-suite/schema-generation/group-as/group-as-singleton-or-array-optional_test_empty_FAIL.json
+1 −1 ...uite/schema-generation/group-as/group-as-singleton-or-array-optional_test_invalid-array-singleton_FAIL.json
+1 −1 test-suite/schema-generation/group-as/group-as-singleton-or-array-optional_test_valid-array_PASS.json
+1 −1 test-suite/schema-generation/group-as/group-as-singleton-or-array-optional_test_valid-singleton_PASS.json
+2 −2 test-suite/schema-generation/group-as/group-as-singleton-or-array_metaschema.xml
+1 −1 test-suite/schema-generation/group-as/group-as-singleton-or-array_test_singleton_PASS.json
+1 −1 test-suite/schema-generation/group-as/group-as-singleton-or-array_test_valid-array_PASS.json
+1 −1 test-suite/schema-generation/json-value-key/json-value-key-field_metaschema.xml
+1 −1 test-suite/schema-generation/json-value-key/json-value-key-field_test_valid_PASS.json
+1 −1 test-suite/schema-generation/json-value-key/json-value-key-label_metaschema.xml
+1 −1 test-suite/schema-generation/json-value-key/json-value-key-label_test_valid2_PASS.json
+1 −1 test-suite/schema-generation/json-value-key/json-value-key-label_test_valid_PASS.json
+0 −248 test-suite/schema-generation/json-value-key/target/json-value-key-field_metaschema-xmlschema.xsd
+0 −246 test-suite/schema-generation/json-value-key/target/json-value-key-label_metaschema-xmlschema.xsd
+5 −5 test-suite/schema-generation/local-declarations/global-and-local_metaschema.xml
+4 −4 test-suite/schema-generation/local-declarations/global-and-scoped-local_metaschema.xml
+0 −35 test-suite/schema-generation/token/datatypes-token_metaschema.xml
+0 −7 test-suite/schema-generation/token/readme.md
+0 −42 test-suite/schema-generation/token/target/datatypes-token_metaschema-jsonschema.json
+0 −217 test-suite/schema-generation/token/target/datatypes-token_metaschema-xmlschema.xsd
+11 −1 test-suite/schema-generation/unit-tests.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* SPDX-FileCopyrightText: none
* SPDX-License-Identifier: CC0-1.0
*/

package gov.nist.secauto.metaschema.core.metapath.function.library;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public final class DeserializationFeature<V>
= 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<Boolean> DESERIALIZE_XML_ALLOW_ENTITY_RESOLUTION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<METASCHEMA, IBindingMetaschemaModule>
implements IMutableConfiguration<DeserializationFeature<?>> {
Expand Down Expand Up @@ -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());
}
Expand All @@ -114,6 +124,9 @@ public IMutableConfiguration<DeserializationFeature<?>> 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);
}
Expand Down

0 comments on commit 86ba951

Please sign in to comment.