javax.faces.validator

Class BeanValidator

    • Field Detail

      • VALIDATOR_ID

        public static final String VALIDATOR_ID

        The standard validator id for this validator, as defined by the JSF specification.

        See Also:
        Constant Field Values
      • MESSAGE_ID

        public static final String MESSAGE_ID

        The message identifier of the FacesMessage to be created if a constraint failure is found. The message format string for this message may optionally include the following placeholders:

        • {0} replaced by the interpolated message from Bean Validation.
        • {1} replaced by a String whose value is the label of the input component that produced this message.

        The message format string provided by the default implementation should be a the placeholder {0}, thus fully delegating the message handling to Bean Validation. A developer can override this message format string to make it conform to other JSF validator messages (i.e., by including the component label)

        See Also:
        Constant Field Values
      • VALIDATOR_FACTORY_KEY

        public static final String VALIDATOR_FACTORY_KEY

        The name of the servlet context attribute which holds the object used by JSF to obtain Validator instances. If the servlet context attribute is missing or contains a null value, JSF is free to use this servlet context attribute to store the ValidatorFactory bootstrapped by this validator.

        See Also:
        Constant Field Values
      • VALIDATION_GROUPS_DELIMITER

        public static final String VALIDATION_GROUPS_DELIMITER

        The delimiter that is used to separate the list of fully-qualified group names as strings.

        See Also:
        Constant Field Values
      • EMPTY_VALIDATION_GROUPS_PATTERN

        public static final String EMPTY_VALIDATION_GROUPS_PATTERN

        The regular expression pattern that identifies an empty list of validation groups.

        See Also:
        Constant Field Values
      • DISABLE_DEFAULT_BEAN_VALIDATOR_PARAM_NAME

        public static final String DISABLE_DEFAULT_BEAN_VALIDATOR_PARAM_NAME

        If this param is defined, and calling toLowerCase().equals(“true”) on a String representation of its value returns true, the runtime must not automatically add the validator with validator-id equal to the value of the symbolic constant VALIDATOR_ID to the list of default validators. Setting this parameter to true will have the effect of disabling the automatic installation of Bean Validation to every input component in every view in the application, though manual installation is still possible.

        See Also:
        Constant Field Values
    • Constructor Detail

      • BeanValidator

        public BeanValidator()
    • Method Detail

      • setValidationGroups

        public void setValidationGroups(String validationGroups)

        A comma-separated list of validation groups which are used to filter which validations get checked by this validator. If the validationGroupsArray attribute is omitted or is empty, the validation groups will be inherited from the branch defaults or, if there are no branch defaults, the Default group will be used.

        Parameters:
        validationGroups - comma-separated list of validation groups (string with only spaces and commas treated as null)
      • getValidationGroups

        public String getValidationGroups()

        Return the validation groups passed to the Validation API when checking constraints. If the validationGroupsArray attribute is omitted or empty, the validation groups will be inherited from the branch defaults, or if there are no branch defaults, the Default group will be used.

      • saveState

        public Object saveState(FacesContext context)
        Description copied from interface: StateHolder

        Gets the state of the instance as a Serializable Object.

        If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

        This method must not alter the state of the implementing object. In other words, after executing this code:

         Object state = component.saveState(facesContext);
         

        component should be the same as before executing it.

        The return from this method must be Serializable

        Specified by:
        saveState in interface StateHolder
      • isTransient

        public boolean isTransient()
        Description copied from interface: StateHolder

        If true, the Object implementing this interface must not participate in state saving or restoring.

        Specified by:
        isTransient in interface StateHolder
      • setTransient

        public void setTransient(boolean transientValue)
        Description copied from interface: StateHolder

        Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.

        Specified by:
        setTransient in interface StateHolder
        Parameters:
        transientValue - boolean pass true if this Object will not participate in state saving or restoring, otherwise pass false.

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 11/06/2005 gemaakt, de laatste keer de 18/08/2025 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-javaee-rf-javax/faces/validator/BeanValidator.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.

Referenties

  1. Bekijk - html-document Taal van het document:fr Manuel PHP : https://docs.oracle.com, BeanValidator (Java(TM) EE 7 Specification APIs)

Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur van deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.