diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/Validation.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/Validation.kt index e10eea540f..ae0ea41f5f 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/Validation.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/Validation.kt @@ -36,7 +36,7 @@ object Validation { /** * The version of the Validation library artifacts. */ - const val version = "2.0.0-SNAPSHOT.406" + const val version = "2.0.0-SNAPSHOT.407" /** * The last version of Validation compatible with ProtoData. diff --git a/dependencies.md b/dependencies.md index 63e6983e1a..4faffa4ce0 100644 --- a/dependencies.md +++ b/dependencies.md @@ -1,6 +1,6 @@ -# Dependencies of `io.spine.tools:validation-context:2.0.0-SNAPSHOT.407` +# Dependencies of `io.spine.tools:validation-context:2.0.0-SNAPSHOT.408` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.20.0. @@ -1147,14 +1147,14 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Mar 25 14:25:23 WET 2026** using +This report was generated on **Wed Mar 25 15:40:53 WET 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:validation-context-tests:2.0.0-SNAPSHOT.407` +# Dependencies of `io.spine.tools:validation-context-tests:2.0.0-SNAPSHOT.408` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.20.0. @@ -1751,28 +1751,28 @@ This report was generated on **Wed Mar 25 14:25:23 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Mar 25 14:25:23 WET 2026** using +This report was generated on **Wed Mar 25 15:40:53 WET 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:validation-docs:2.0.0-SNAPSHOT.407` +# Dependencies of `io.spine.tools:validation-docs:2.0.0-SNAPSHOT.408` ## Runtime ## Compile, tests, and tooling The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Tue Mar 24 18:44:03 WET 2026** using +This report was generated on **Wed Mar 25 15:38:27 WET 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:validation-gradle-plugin:2.0.0-SNAPSHOT.407` +# Dependencies of `io.spine.tools:validation-gradle-plugin:2.0.0-SNAPSHOT.408` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.20.0. @@ -2889,14 +2889,14 @@ This report was generated on **Tue Mar 24 18:44:03 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Mar 25 14:25:23 WET 2026** using +This report was generated on **Wed Mar 25 15:40:53 WET 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:validation-java:2.0.0-SNAPSHOT.407` +# Dependencies of `io.spine.tools:validation-java:2.0.0-SNAPSHOT.408` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.20.0. @@ -3975,14 +3975,14 @@ This report was generated on **Wed Mar 25 14:25:23 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Mar 25 14:25:23 WET 2026** using +This report was generated on **Wed Mar 25 15:40:53 WET 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:validation-java-bundle:2.0.0-SNAPSHOT.407` +# Dependencies of `io.spine.tools:validation-java-bundle:2.0.0-SNAPSHOT.408` ## Runtime 1. **Group** : org.jetbrains. **Name** : annotations. **Version** : 13.0. @@ -4029,14 +4029,14 @@ This report was generated on **Wed Mar 25 14:25:23 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Mar 25 14:25:22 WET 2026** using +This report was generated on **Wed Mar 25 15:40:52 WET 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine:validation-jvm-runtime:2.0.0-SNAPSHOT.407` +# Dependencies of `io.spine:validation-jvm-runtime:2.0.0-SNAPSHOT.408` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -4869,14 +4869,14 @@ This report was generated on **Wed Mar 25 14:25:22 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Mar 25 14:25:23 WET 2026** using +This report was generated on **Wed Mar 25 15:40:53 WET 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:validation-consumer:2.0.0-SNAPSHOT.407` +# Dependencies of `io.spine.tools:validation-consumer:2.0.0-SNAPSHOT.408` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.20.0. @@ -5463,14 +5463,14 @@ This report was generated on **Wed Mar 25 14:25:23 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Mar 25 14:25:22 WET 2026** using +This report was generated on **Wed Mar 25 15:40:52 WET 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:validation-consumer-dependency:2.0.0-SNAPSHOT.407` +# Dependencies of `io.spine.tools:validation-consumer-dependency:2.0.0-SNAPSHOT.408` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -5989,14 +5989,14 @@ This report was generated on **Wed Mar 25 14:25:22 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Mar 25 14:25:23 WET 2026** using +This report was generated on **Wed Mar 25 15:40:52 WET 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:validation-extensions:2.0.0-SNAPSHOT.407` +# Dependencies of `io.spine.tools:validation-extensions:2.0.0-SNAPSHOT.408` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.20.0. @@ -6684,14 +6684,14 @@ This report was generated on **Wed Mar 25 14:25:23 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Mar 25 14:25:23 WET 2026** using +This report was generated on **Wed Mar 25 15:40:53 WET 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:validation-runtime:2.0.0-SNAPSHOT.407` +# Dependencies of `io.spine.tools:validation-runtime:2.0.0-SNAPSHOT.408` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -7325,14 +7325,14 @@ This report was generated on **Wed Mar 25 14:25:23 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Mar 25 14:25:23 WET 2026** using +This report was generated on **Wed Mar 25 15:40:53 WET 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:validation-validating:2.0.0-SNAPSHOT.407` +# Dependencies of `io.spine.tools:validation-validating:2.0.0-SNAPSHOT.408` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -8005,14 +8005,14 @@ This report was generated on **Wed Mar 25 14:25:23 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Mar 25 14:25:23 WET 2026** using +This report was generated on **Wed Mar 25 15:40:53 WET 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:validation-validator:2.0.0-SNAPSHOT.407` +# Dependencies of `io.spine.tools:validation-validator:2.0.0-SNAPSHOT.408` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.20.0. @@ -8799,14 +8799,14 @@ This report was generated on **Wed Mar 25 14:25:23 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Mar 25 14:25:23 WET 2026** using +This report was generated on **Wed Mar 25 15:40:53 WET 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:validation-validator-dependency:2.0.0-SNAPSHOT.407` +# Dependencies of `io.spine.tools:validation-validator-dependency:2.0.0-SNAPSHOT.408` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -9080,14 +9080,14 @@ This report was generated on **Wed Mar 25 14:25:23 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Mar 25 14:25:23 WET 2026** using +This report was generated on **Wed Mar 25 15:40:52 WET 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:validation-vanilla:2.0.0-SNAPSHOT.407` +# Dependencies of `io.spine.tools:validation-vanilla:2.0.0-SNAPSHOT.408` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -9434,6 +9434,6 @@ This report was generated on **Wed Mar 25 14:25:23 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Mar 25 14:25:22 WET 2026** using +This report was generated on **Wed Mar 25 15:40:52 WET 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file diff --git a/docs/_examples b/docs/_examples index 7be713d773..4c1c5a231c 160000 --- a/docs/_examples +++ b/docs/_examples @@ -1 +1 @@ -Subproject commit 7be713d773d490f15d5549f49f86d0f1c4e952ce +Subproject commit 4c1c5a231cc7beb19a5ff9a335ad8175d9a45285 diff --git a/docs/content/docs/validation/01-getting-started/adding-to-build.md b/docs/content/docs/validation/01-getting-started/adding-to-build.md index ae92990d25..c5d793bb99 100644 --- a/docs/content/docs/validation/01-getting-started/adding-to-build.md +++ b/docs/content/docs/validation/01-getting-started/adding-to-build.md @@ -90,7 +90,7 @@ Add the Validation plugin to the build. ```kotlin plugins { module - id("io.spine.validation") version "2.0.0-SNAPSHOT.407" + id("io.spine.validation") version "2.0.0-SNAPSHOT.408" } ``` diff --git a/jvm-runtime/src/main/java/io/spine/validation/option/AlwaysRequired.java b/jvm-runtime/src/main/java/io/spine/validation/option/AlwaysRequired.java deleted file mode 100644 index 8034d28279..0000000000 --- a/jvm-runtime/src/main/java/io/spine/validation/option/AlwaysRequired.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2025, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.validation.option; - -import com.google.errorprone.annotations.Immutable; -import io.spine.code.proto.FieldContext; - -/** - * A special case of {@code Required} option that assumes that the option is present regardless - * of the actual field declaration. - * - * @deprecated Please use generated validation code. - */ -@Immutable -@Deprecated(forRemoval = true) -final class AlwaysRequired extends Required { - - /** - * Creates a new instance of this option. - */ - AlwaysRequired() { - super(); - } - - /** - * {@inheritDoc} - * - *
For {@code AlwaysRequired}, validation happens every time. - */ - @Override - public boolean shouldValidate(FieldContext context) { - checkUsage(context.targetDeclaration()); - return true; - } -} diff --git a/jvm-runtime/src/main/java/io/spine/validation/option/FieldValidatingOption.java b/jvm-runtime/src/main/java/io/spine/validation/option/FieldValidatingOption.java deleted file mode 100644 index cb5d9b1acd..0000000000 --- a/jvm-runtime/src/main/java/io/spine/validation/option/FieldValidatingOption.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright 2025, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.validation.option; - -import com.google.errorprone.annotations.Immutable; -import com.google.errorprone.annotations.ImmutableTypeParameter; -import com.google.protobuf.DescriptorProtos.FieldOptions; -import com.google.protobuf.Descriptors.FieldDescriptor; -import com.google.protobuf.GeneratedMessage.GeneratedExtension; -import io.spine.code.proto.FieldContext; -import io.spine.code.proto.FieldOption; - -import java.util.Optional; - -import static java.lang.String.format; - -/** - * An option that validates a field. - * - *
Validating options impose constraint on fields that they are applied to.
- *
- * @param If a {@code required} field is missing, an error is produced.
- *
- * @deprecated Please use generated validation code.
- */
-@Immutable
-@Deprecated(forRemoval = true)
-public class Required extends FieldValidatingOption If the specified parameter is {@code true}, a returned option always assumes a field to
- * be {@code required}, regardless of the field value.
- * If the specified parameter is {@code false}, a returned option checks the actual value.
- *
- * @param strict
- * specifies if a field is assumed to be a required one regardless of the actual
- * Protobuf option value
- * @return a new instance of the {@code Required} option
- */
- public static Required create(boolean strict) {
- return strict
- ? new AlwaysRequired()
- : new Required();
- }
-
- private boolean notAssumingRequired(FieldContext context) {
- var defaultValue = context.targetDeclaration().isId();
- return valueFrom(context.target())
- .orElse(defaultValue);
- }
-
- @Override
- public boolean shouldValidate(FieldContext context) {
- return notAssumingRequired(context);
- }
-
- /**
- * Produces warnings if the {@code required} option was applied incorrectly.
- *
- * Examples of incorrect application include attempting to apply the option to a numeric
- * field.
- *
- * @param field
- * a value that the option is applied to
- */
- @SuppressWarnings("UseOfSystemOutOrSystemErr") /* We're migrating off runtime validation
- AND we do not want dependency of Validation Runtime on Spine Logging.
- So we use `System.err` for the warnings. */
- void checkUsage(FieldDeclaration field) {
- var type = field.javaType();
- if (!CAN_BE_REQUIRED.contains(type) && field.isNotCollection()) {
- var isTheFirstField = field.descriptor().getIndex() == 0;
- if (isTheFirstField) {
- // The first field declared in a message type could be assumed as required
- // because by convention it is an ID field of the message.
- // If so, do not log the warning message for this field because ID fields
- // could be of any reasonable type.
- var messageClass = field.declaringType().javaClass();
- if (CommandMessage.class.isAssignableFrom(messageClass)
- || EntityState.class.isAssignableFrom(messageClass)) {
- return;
- }
- }
- var typeName = field.descriptor().getType().name();
- System.err.printf(
- "The field `%s.%s` has the type %s and" +
- " should not be declared as `(required)`.%n",
- field.declaringType().name(), field.name(), typeName);
- }
- }
-}
diff --git a/jvm-runtime/src/main/java/io/spine/validation/option/ValidatingOption.java b/jvm-runtime/src/main/java/io/spine/validation/option/ValidatingOption.java
deleted file mode 100644
index e67cccedb0..0000000000
--- a/jvm-runtime/src/main/java/io/spine/validation/option/ValidatingOption.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2025, TeamDev. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Redistribution and use in source and/or binary forms, with or without
- * modification, must retain the above copyright notice and the following
- * disclaimer.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package io.spine.validation.option;
-
-import com.google.errorprone.annotations.Immutable;
-import com.google.errorprone.annotations.ImmutableTypeParameter;
-import com.google.protobuf.Descriptors.GenericDescriptor;
-import io.spine.code.proto.Option;
-
-/**
- * The interface common to all standard validation options.
- *
- * @param