Class AbstractNuitonValidatorContext<O,​V,​E>

    • Field Detail

      • bean

        protected O bean
        Bean to validate.
      • messages

        protected NuitonValidatorResult messages
        State of validation (keep all messages of validation for the filled bean).
      • conversionErrors

        protected final Map<String,​String> conversionErrors
        map of conversion errors detected by this validator
      • canValidate

        protected boolean canValidate
        State to know if the validator can be used (we keep this state for performance reasons : do not want to compute this value each time a validation is asked...).
    • Constructor Detail

      • AbstractNuitonValidatorContext

        public AbstractNuitonValidatorContext()
    • Method Detail

      • getBean

        public O getBean()
      • setBean

        public void setBean​(O bean)
      • isCanValidate

        public boolean isCanValidate()
      • setCanValidate

        public void setCanValidate​(boolean canValidate)
      • isValid

        public boolean isValid()
      • hasFatalErrors

        public boolean hasFatalErrors()
      • hasErrors

        public boolean hasErrors()
      • hasWarnings

        public boolean hasWarnings()
      • hasInfos

        public boolean hasInfos()
      • isValid

        public boolean isValid​(String fieldName)
      • convert

        public <T> T convert​(String fieldName,
                             String value,
                             Class<T> valueClass)
        Convert a value. If an error occurs, then add an error in validator.
        Type Parameters:
        T - the type of conversion
        Parameters:
        fieldName - the name of the bean property
        value - the value to convert
        valueClass - the type of converted value
        Returns:
        the converted value, or null if conversion was not ok