Package hudson.model
Class DescriptorVisibilityFilter
- java.lang.Object
-
- hudson.model.DescriptorVisibilityFilter
-
- All Implemented Interfaces:
ExtensionPoint
- Direct Known Subclasses:
BuildDiscarderProperty.ConditionallyHidden
public abstract class DescriptorVisibilityFilter extends Object implements ExtensionPoint
HidesDescriptor
s from users.- Since:
- 1.393
- Author:
- Kohsuke Kawaguchi
- See Also:
ExtensionFilter
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description DescriptorVisibilityFilter()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static ExtensionList<DescriptorVisibilityFilter>
all()
static <T extends Descriptor>
List<T>apply(Object context, Iterable<T> source)
static <T extends Descriptor>
List<T>applyType(Class<?> contextClass, Iterable<T> source)
abstract boolean
filter(Object context, Descriptor descriptor)
Decides if the given descriptor should be visible to the user.boolean
filterType(Class<?> contextClass, Descriptor descriptor)
Decides if the given descriptor should be visible to the user.
-
-
-
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 aFreeStyleProject
should gets aSCMDescriptor
, the context class will beFreeStyleProject
.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 aFreeStyleProject
should gets aSCMDescriptor
, the context object will be theFreeStyleProject
. 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.
-
all
public static ExtensionList<DescriptorVisibilityFilter> all()
-
apply
public static <T extends Descriptor> List<T> apply(Object context, Iterable<T> source)
-
applyType
public static <T extends Descriptor> List<T> applyType(Class<?> contextClass, Iterable<T> source)
-
-