public class AbstractFieldPathValidator implements DataSearchValidator
Base Class of interface DataSearchValidator
to validate interface FieldExpression
according to their FieldExpression.fieldInfo
.
Example:
Let's assume the following model:
@Entity
class Person(
...
@Column(unique = true, length = 100)
val email: String? = null,
...
@OneToOne(mappedBy = "person", cascade = [CascadeType.ALL], orphanRemoval = true)
@JsonIgnoreProperties("person")
val jobEntity: Job? = null,
...
)
@Entity
class Job(
...
@Column(unique = true, length = 100)
val email: String? = null,
...
)
Let's assume a Validator to validate Person email and Job email.
This validator should be instantiated with the different FieldExpression.fieldInfo
, and added to a interface SearchDescriptor
:
fun personSearchDescriptor(): SearchDescriptor = SearchDescriptorBuilder.builder()
.validators(EmailValidator("email", "job.email"))
.build()
public AbstractFieldPathValidator(@NotNull java.lang.String... fieldPaths)
Base Class of interface DataSearchValidator
to validate interface FieldExpression
according to their FieldExpression.fieldInfo
.
Example:
Let's assume the following model:
@Entity
class Person(
...
@Column(unique = true, length = 100)
val email: String? = null,
...
@OneToOne(mappedBy = "person", cascade = [CascadeType.ALL], orphanRemoval = true)
@JsonIgnoreProperties("person")
val jobEntity: Job? = null,
...
)
@Entity
class Job(
...
@Column(unique = true, length = 100)
val email: String? = null,
...
)
Let's assume a Validator to validate Person email and Job email.
This validator should be instantiated with the different FieldExpression.fieldInfo
, and added to a interface SearchDescriptor
:
fun personSearchDescriptor(): SearchDescriptor = SearchDescriptorBuilder.builder()
.validators(EmailValidator("email", "job.email"))
.build()
public boolean supports(@NotNull FieldExpression fieldExpression)
Checks if the given interface FieldExpression
is supported by the validator.
fieldExpression
- interface FieldExpression
to checktrue
if the validator supports the interface FieldExpression
, false
instead.interface FieldExpression