Package org.faktorips.runtime.validation
Interface IGenericAttributeValidationConfiguration
-
- All Known Implementing Classes:
DefaultGenericAttributeValidationConfiguration
public interface IGenericAttributeValidationConfigurationConfiguration for the generic validation ofPolicyAttributevalues. Provides specific messages for common validation errors.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MessagecreateMessageForMissingMandatoryValue(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 anullvalue.MessagecreateMessageForValueNotInAllowedValueSet(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.MessagecreateMessageForValuePresentForIrrelevantAttribute(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.booleanshouldValidate(PolicyAttribute policyAttribute, IModelObject modelObject)Decides whether the givenPolicyAttributeshould be validated for the givenIModelObject.
-
-
-
Method Detail
-
shouldValidate
boolean shouldValidate(PolicyAttribute policyAttribute, IModelObject modelObject)
Decides whether the givenPolicyAttributeshould be validated for the givenIModelObject.- Parameters:
policyAttribute- the model type reference for the validated attributemodelObject- the model object instance on which the attribute may be validated- Returns:
- whether validation for the given combination of
PolicyAttributeandIModelObjectshould 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 anullvalue.- Parameters:
policyAttribute- the model type reference for the validated attributemodelObject- the model object instance on which the attribute was validateddefiningModelObjectClass- 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 attributemodelObject- the model object instance on which the attribute was validateddefiningModelObjectClass- 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 attributemodelObject- the model object instance on which the attribute was validateddefiningModelObjectClass- the model object class where the generic validation is defined
-
-