Class Validation


  • public class Validation
    extends Object
    Validation handles all validation routines. This class is constructed using default constructor (no argument constructor) and validateAttribute function is used to validate set of attributes against optional rules passed and validator specific rules. UMSException is throw if there is instanciation problems DataConstraintException is thrown when the attributes fail to validations.
    • Constructor Detail

      • Validation

        public Validation()
    • Method Detail

      • validateAttribute

        public static void validateAttribute​(Attr attr,
                                             String validatorClass,
                                             String rule)
                                      throws UMSException,
                                             DataConstraintException
        Determines whether a specific attribute is valid. Called by validateAttribute(Attr, Class). This method calls the validation method for this attribute.
        Parameters:
        attr - attribute to test
        validatorClass - the validator class name
        rule - optional rule applies to the validator
        Throws:
        UMSException - failure
        DataConstraintException - data validation failure
      • validateAttribute

        public static void validateAttribute​(Attr attr,
                                             Class cls,
                                             Guid guid)
                                      throws UMSException,
                                             DataConstraintException
        Determines whether attribute is valid. Check the attribute if there is a validation method that needs to execute.
        Parameters:
        attr - attribute to test
        cls - Class associatd with this attribute
        guid - the guid of the Organization where the config data is stored
        Throws:
        UMSException - failure
        DataConstraintException - data validation failure
      • validateAttributes

        public static void validateAttributes​(AttrSet attrSet,
                                              Class cls,
                                              Guid guid)
                                       throws UMSException,
                                              DataConstraintException
        Determines whether each attribute in the attribute set is valid. Iterates though the set checking each element to see if there is a validation method that needs to execute.
        Parameters:
        attrSet - attribute set to test
        cls - Class associated with these attribute set
        guid - the guid of the Organization where the config data is stored
        Throws:
        UMSException - failure
        DataConstraintException - data validation failure
      • validateAttributes

        public static void validateAttributes​(ModSet modSet,
                                              Class cls,
                                              Guid guid)
                                       throws UMSException,
                                              DataConstraintException
        Determines whether each attribute in the ModSet is valid.
        Parameters:
        modSet - modSet to test
        cls - Class associated with these attributes
        guid - the guid of the Organization where the config data is stored
        Throws:
        UMSException - failure
        DataConstraintException - data validation failure