Class XWork2ScopeValidator<O>

  • Type Parameters:
    O - type of the bean to validate.

    public class XWork2ScopeValidator<O>
    extends Object
    A customized validator for a given bean. Use the method validate(Object) to obtain the messages detected by the validator for the given bean.
    Since:
    2.0
    Author:
    Tony Chemit - chemit@codelutin.com
    • Field Detail

      • type

        protected final Class<O> type
        the type of bean to validate
      • context

        protected String context
        the validation named context (can be null)
      • fieldNames

        protected Set<String> fieldNames
        the list of field names detected for this validator
      • validationSupport

        protected com.opensymphony.xwork2.ValidationAwareSupport validationSupport
      • validationContext

        protected com.opensymphony.xwork2.validator.DelegatingValidatorContext validationContext
      • validator

        protected com.opensymphony.xwork2.validator.ActionValidatorManager validator
      • vs

        protected com.opensymphony.xwork2.util.ValueStack vs
    • Constructor Detail

      • XWork2ScopeValidator

        protected XWork2ScopeValidator​(Class<O> type,
                                       String context,
                                       Set<String> fieldNames,
                                       com.opensymphony.xwork2.util.ValueStack vs)
    • Method Detail

      • getType

        public Class<O> getType()
      • getContext

        public String getContext()
      • getFieldNames

        public Set<String> getFieldNames()
      • getValidator

        public com.opensymphony.xwork2.validator.ActionValidatorManager getValidator()
      • containsField

        public boolean containsField​(String fieldName)
        Test if the validator contains the field given his name
        Parameters:
        fieldName - the name of the searched field
        Returns:
        true if validator contaisn this field, false otherwise
      • validate

        public Map<String,​List<String>> validate​(O bean)
        Valide le bean donné et retourne les messages produits.
        Parameters:
        bean - le bean a valider (il doit etre non null)
        Returns:
        le dictionnaire des messages produits par la validation indexées par le nom du champs du bean impacté.