Package org.openremote.model.validation
Class AttributeInfoValidator
java.lang.Object
org.openremote.model.validation.AttributeInfoValidator
- All Implemented Interfaces:
jakarta.validation.ConstraintValidator<AttributeInfoValid,
,AttributeInfo> org.hibernate.validator.constraintvalidation.HibernateConstraintValidator<AttributeInfoValid,
AttributeInfo>
public class AttributeInfoValidator
extends Object
implements org.hibernate.validator.constraintvalidation.HibernateConstraintValidator<AttributeInfoValid,AttributeInfo>
A JSR-380 validator that uses
ValueUtil
to ensure that the
Asset.getAttributes()
conforms to the AttributeDescriptor
s for the
given Asset
type. Checks the following:
- Required attributes are present and the type matches the
AttributeDescriptor
; if noAssetTypeInfo
can be found for the givenAsset
then this step is skipped
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected jakarta.validation.ClockProvider
static final System.Logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
initialize
(jakarta.validation.metadata.ConstraintDescriptor<AttributeInfoValid> constraintDescriptor, org.hibernate.validator.constraintvalidation.HibernateConstraintValidatorInitializationContext initializationContext) boolean
isValid
(AttributeInfo attributeInfo, jakarta.validation.ConstraintValidatorContext context) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface jakarta.validation.ConstraintValidator
initialize
-
Field Details
-
LOG
-
clockProvider
protected jakarta.validation.ClockProvider clockProvider
-
-
Constructor Details
-
AttributeInfoValidator
public AttributeInfoValidator()
-
-
Method Details
-
initialize
public void initialize(jakarta.validation.metadata.ConstraintDescriptor<AttributeInfoValid> constraintDescriptor, org.hibernate.validator.constraintvalidation.HibernateConstraintValidatorInitializationContext initializationContext) - Specified by:
initialize
in interfaceorg.hibernate.validator.constraintvalidation.HibernateConstraintValidator<AttributeInfoValid,
AttributeInfo>
-
isValid
public boolean isValid(AttributeInfo attributeInfo, jakarta.validation.ConstraintValidatorContext context) - Specified by:
isValid
in interfacejakarta.validation.ConstraintValidator<AttributeInfoValid,
AttributeInfo>
-