Package hudson.model

Class AbstractProject.LabelValidator

    • Constructor Detail

      • LabelValidator

        public LabelValidator()
        Deprecated.
    • Method Detail

      • check

        @NonNull
        public abstract FormValidation check​(@NonNull
                                             AbstractProject<?,​?> project,
                                             @NonNull
                                             Label label)
        Deprecated.
        Check the use of the label within the specified context.

        Note that "OK" responses (and any text/markup that may be set on them) will be ignored. Only warnings and errors are taken into account, and aggregated across all validators.

        Parameters:
        project - the project that wants to restrict itself to the specified label.
        label - the label that the project wants to restrict itself to.
        Returns:
        the FormValidation result.
      • checkItem

        @NonNull
        public FormValidation checkItem​(@NonNull
                                        Item item,
                                        @NonNull
                                        Label label)
        Deprecated.
        Validates the use of a label within a particular context.

        Note that "OK" responses (and any text/markup that may be set on them) will be ignored. Only warnings and errors are taken into account, and aggregated across all validators.

        This method exists to allow plugins to implement an override for it, enabling checking in non-AbstractProject contexts without needing to update their Jenkins dependency (and using the new LabelValidator instead).

        Parameters:
        item - The context item to be restricted by the label.
        label - The label that the job wants to restrict itself to.
        Returns:
        The validation result.
        Since:
        2.243