Package hudson.model

Class DescriptorVisibilityFilter

    • Constructor Detail

      • DescriptorVisibilityFilter

        public DescriptorVisibilityFilter()
    • Method Detail

      • filterType

        public boolean filterType​(@NonNull
                                  Class<?> contextClass,
                                  @NonNull
                                  Descriptor descriptor)
        Decides if the given descriptor should be visible to the user.
        Parameters:
        contextClass - The class of object that indicates where the visibility of a descriptor is evaluated. For example, if Jenkins is deciding whether a FreeStyleProject should gets a SCMDescriptor, the context class will be FreeStyleProject.
        descriptor - Descriptor whose visibility is evaluated. Never null.
        Returns:
        true to allow the descriptor to be visible. false to hide it. If any of the installed DescriptorVisibilityFilter returns false, the descriptor is not shown.
        Since:
        2.12
      • filter

        public abstract boolean filter​(@CheckForNull
                                       Object context,
                                       @NonNull
                                       Descriptor descriptor)
        Decides if the given descriptor should be visible to the user.
        Parameters:
        context - The object that indicates where the visibility of a descriptor is evaluated. For example, if Hudson is deciding whether a FreeStyleProject should gets a SCMDescriptor, the context object will be the FreeStyleProject. The caller can pass in null if there's no context.
        descriptor - Descriptor whose visibility is evaluated. Never null.
        Returns:
        true to allow the descriptor to be visible. false to hide it. If any of the installed DescriptorVisibilityFilter returns false, the descriptor is not shown.