Interface IGenericAttributeValidationConfiguration

    • Method Detail

      • shouldValidate

        boolean shouldValidate​(PolicyAttribute policyAttribute,
                               IModelObject modelObject)
        Decides whether the given PolicyAttribute should be validated for the given IModelObject.
        Parameters:
        policyAttribute - the model type reference for the validated attribute
        modelObject - the model object instance on which the attribute may be validated
        Returns:
        whether validation for the given combination of PolicyAttribute and IModelObject should run
        Implementation Requirements:
        Implementers should use this to prevent validation of fields that can not yet be valid, for example because another field must first be set to derive their value set.
      • createMessageForMissingMandatoryValue

        Message createMessageForMissingMandatoryValue​(PolicyAttribute policyAttribute,
                                                      IModelObject modelObject,
                                                      java.lang.Class<? extends IModelObject> definingModelObjectClass)
        Creates a message to indicate that the given attribute's value on the given model object is missing but the value set does not allow a null value.
        Parameters:
        policyAttribute - the model type reference for the validated attribute
        modelObject - the model object instance on which the attribute was validated
        definingModelObjectClass - the model object class where the generic validation is defined
      • createMessageForValuePresentForIrrelevantAttribute

        Message createMessageForValuePresentForIrrelevantAttribute​(PolicyAttribute policyAttribute,
                                                                   IModelObject modelObject,
                                                                   java.lang.Class<? extends IModelObject> definingModelObjectClass)
        Creates a message to indicate that the given attribute's value on the given model object is set but the value set does not allow a value.
        Parameters:
        policyAttribute - the model type reference for the validated attribute
        modelObject - the model object instance on which the attribute was validated
        definingModelObjectClass - the model object class where the generic validation is defined
      • createMessageForValueNotInAllowedValueSet

        Message createMessageForValueNotInAllowedValueSet​(PolicyAttribute policyAttribute,
                                                          IModelObject modelObject,
                                                          java.lang.Class<? extends IModelObject> definingModelObjectClass)
        Creates a message to indicate that the given attribute's value on the given model object is not allowed by the value set.
        Parameters:
        policyAttribute - the model type reference for the validated attribute
        modelObject - the model object instance on which the attribute was validated
        definingModelObjectClass - the model object class where the generic validation is defined