Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,997 changes: 24 additions & 1,973 deletions dependencies.md

Large diffs are not rendered by default.

10 changes: 1 addition & 9 deletions java/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import io.spine.dependency.lib.JavaPoet
import io.spine.dependency.lib.Roaster
import io.spine.dependency.local.ProtoData

plugins {
`build-proto-model`
}

dependencies {
api(ProtoData.java)
api(project(":model"))
api(project(":proto:context"))
api(ProtoData.java)

implementation(project(":java-runtime"))
implementation(JavaPoet.lib)
implementation(Roaster.api)

runtimeOnly(Roaster.jdt)
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ import io.spine.validation.java.generate.option.RequireOptionGenerator
import io.spine.validation.java.generate.option.RequiredGenerator
import io.spine.validation.java.generate.option.ValidateGenerator
import io.spine.validation.java.generate.option.WhenGenerator
import io.spine.validation.java.rule.RuleGenerator

/**
* The main Java renderer of the validation library.
Expand All @@ -66,7 +65,6 @@ public class JavaValidationRenderer : JavaRenderer() {
private val querying = this@JavaValidationRenderer
private val generators by lazy {
listOf(
RuleGenerator(querying, typeSystem),
RequiredGenerator(querying, valueConverter),
PatternGenerator(querying),
GoesGenerator(querying, valueConverter),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ internal class ValidationCodeInjector {
execute {
messageClass.apply {
implementValidatableMessage()
declareDefaultValidateMethod()
declareValidateMethod(code.constraints)
declareSupportingFields(code.fields)
declareSupportingMethods(code.methods)
Expand Down Expand Up @@ -133,28 +132,6 @@ private fun MessagePsiClass.implementValidatableMessage() {
implement(reference)
}

/**
* Declares the `validate()` method in this [MessagePsiClass].
*
* This is an implementation of [ValidatableMessage.validate] that doesn't accept
* any parameters. The actual constraints are contained in its [overload][declareValidateMethod],
* to which this method delegates.
*/
// TODO:2025-03-12:yevhenii.nadtochii: Remove it in a favour of the default implementation
// provided in the `ValidatableMessage` interface.
// See issue: https://github.com/SpineEventEngine/validation/issues/198
private fun MessagePsiClass.declareDefaultValidateMethod() {
val psiMethod = elementFactory.createMethodFromText(
"""
public java.util.Optional<io.spine.validate.ValidationError> validate() {
var noParentPath = $FieldPathClass.getDefaultInstance();
return validate(noParentPath, null);
}
""".trimIndent(), this)
psiMethod.annotate(Override::class.java)
addLast(psiMethod)
}

/**
* Declares the `validate(parentPath, parentName)` method in this [MessagePsiClass].
*
Expand Down
136 changes: 0 additions & 136 deletions java/src/main/kotlin/io/spine/validation/java/rule/CodeGenerator.kt

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading