Package jenkins
Class ExtensionFilter
- java.lang.Object
-
- jenkins.ExtensionFilter
-
- All Implemented Interfaces:
ExtensionPoint
public abstract class ExtensionFilter extends Object implements ExtensionPoint
Filters outExtensionComponents discovered byExtensionFinders, as if they were never discovered.This is useful for those who are deploying restricted/simplified version of Jenkins by reducing the functionality.
Because of the way
ExtensionFinderworks, even when an extension component is rejected by a filter, its instance still gets created first.- Since:
- 1.472
- Author:
- Kohsuke Kawaguchi
- See Also:
DescriptorVisibilityFilter,ExtensionComponentSet.filtered()
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description ExtensionFilter()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static ExtensionList<ExtensionFilter>all()All registeredExtensionFilterinstances.abstract <T> booleanallows(Class<T> type, ExtensionComponent<T> component)Checks if a newly discovered extension is allowed to participate into Jenkins.static <T> booleanisAllowed(Class<T> type, ExtensionComponent<T> component)
-
-
-
Method Detail
-
allows
public abstract <T> boolean allows(Class<T> type, ExtensionComponent<T> component)
Checks if a newly discovered extension is allowed to participate into Jenkins.To filter
Descriptors based on theDescribablesubtypes, do as follows:return !component.isDescriptorOf(Builder.class);
- Parameters:
type- The type of the extension that we are discovering. This is not the actual instance type, but the contract type, such asDescriptor,AdministrativeMonitor, etc.component- the actual discoveredExtensionobject.- Returns:
trueto let the component into Jenkins.falseto drop it and pretend as if it didn't exist. When any one ofExtensionFilters veto a component, it gets dropped.
-
isAllowed
public static <T> boolean isAllowed(Class<T> type, ExtensionComponent<T> component)
-
all
public static ExtensionList<ExtensionFilter> all()
All registeredExtensionFilterinstances.
-
-