Package hudson
Class DescriptorExtensionList<T extends Describable<T>,D extends Descriptor<T>>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<T>
hudson.ExtensionList<D>
hudson.DescriptorExtensionList<T,D>
- Type Parameters:
D
- Represents the descriptor type. This isDescriptor<T>
normally but often there are subtypes of descriptors, likeViewDescriptor
,NodeDescriptor
, etc, and this parameter points to those for better type safety of users. The actual value of 'D' is not necessary for the operation of this code, so it's purely for convenience of the users of this class.
- All Implemented Interfaces:
Iterable<D>
,Collection<D>
,List<D>
,OnMaster
- Direct Known Subclasses:
Publisher.DescriptorExtensionListImpl
public class DescriptorExtensionList<T extends Describable<T>,D extends Descriptor<T>>
extends ExtensionList<D>
ExtensionList
for holding a set of Descriptor
s, which is a group of descriptors for
the same extension point.
Use Jenkins.getDescriptorList(Class)
to obtain instances.- Since:
- 1.286
-
Field Summary
Fields inherited from class hudson.ExtensionList
extensionType, hudson, jenkins
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
ModifierConstructorDescriptionprotected
DescriptorExtensionList
(Hudson hudson, Class<T> describableType) Deprecated.protected
DescriptorExtensionList
(Jenkins jenkins, Class<T> describableType) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Write access will put the instance into a legacy store.static void
Exposed just for the test harness.static <T extends Describable<T>,
D extends Descriptor<T>>
DescriptorExtensionList<T,D> createDescriptorList
(Hudson hudson, Class<T> describableType) Deprecated.as of 1.416 UseExtensionList.create(Jenkins, Class)
static <T extends Describable<T>,
D extends Descriptor<T>>
DescriptorExtensionList<T,D> createDescriptorList
(Jenkins jenkins, Class<T> describableType) Creates a new instance.Finds the descriptor that describes the given type.Deprecated.Descriptor.getId()
is supposed to be used for new code, not the descriptor class name.findByName
(String id) Finds a descriptor by theirDescriptor.getId()
.protected Object
load()
in the descriptor is not a real load activity, so locking against "this" is enough.static Iterable<Descriptor>
List up all the legacy instances currently in use.protected List<ExtensionComponent<D>>
load()
Loading the descriptors in this case means filtering the descriptor from the masterExtensionList
.protected Collection<ExtensionComponent<D>>
load
(ExtensionComponentSet delta) Picks up extensions that we care from the given list.newInstanceFromRadioList
(net.sf.json.JSONObject config) Creates a new instance of aDescribable
from the structured form submission data posted by a radio button group.newInstanceFromRadioList
(net.sf.json.JSONObject parent, String name) Creates a new instance of aDescribable
from the structured form submission data posted by a radio list.boolean
Methods inherited from class hudson.ExtensionList
add, addListener, create, create, get, get, getComponents, getDynamic, getInstance, iterator, lookup, lookupFirst, lookupSingleton, refresh, remove, removeAll, reverseView, size, sort
Methods inherited from class java.util.AbstractList
addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, removeRange, set, subList
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, retainAll, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
Constructor Details
-
DescriptorExtensionList
Deprecated.as of 1.416 UseDescriptorExtensionList(Jenkins, Class)
-
DescriptorExtensionList
-
-
Method Details
-
createDescriptorList
public static <T extends Describable<T>,D extends Descriptor<T>> DescriptorExtensionList<T,D> createDescriptorList(Jenkins jenkins, Class<T> describableType) Creates a new instance. -
createDescriptorList
@Deprecated public static <T extends Describable<T>,D extends Descriptor<T>> DescriptorExtensionList<T,D> createDescriptorList(Hudson hudson, Class<T> describableType) Deprecated.as of 1.416 UseExtensionList.create(Jenkins, Class)
-
find
Deprecated.Descriptor.getId()
is supposed to be used for new code, not the descriptor class name.Finds the descriptor that has the matching fully-qualified class name.- Parameters:
fqcn
- Fully qualified name of the descriptor, not the describable.
-
find
Finds the descriptor that describes the given type. That is, if this method returns d,d.clazz==type
-
newInstanceFromRadioList
@CheckForNull public T newInstanceFromRadioList(net.sf.json.JSONObject config) throws Descriptor.FormException Creates a new instance of aDescribable
from the structured form submission data posted by a radio button group.- Parameters:
config
- Submitted configuration for Radio List- Returns:
- New instance.
null
if none was selected in the radio list or if the value is filtered by aDescriptorVisibilityFilter
- Throws:
Descriptor.FormException
- Data submission error- Since:
- 1.312
-
newInstanceFromRadioList
@CheckForNull public T newInstanceFromRadioList(@NonNull net.sf.json.JSONObject parent, @NonNull String name) throws Descriptor.FormException Creates a new instance of aDescribable
from the structured form submission data posted by a radio list.- Parameters:
name
- Name of the form field- Returns:
- Created instance.
null
if none was selected in the radio list or if the value is filtered by aDescriptorVisibilityFilter
- Throws:
Descriptor.FormException
- Data submission error- Since:
- 1.312
-
findByName
Finds a descriptor by theirDescriptor.getId()
. If none is found, null is returned. -
add
Description copied from class:ExtensionList
Write access will put the instance into a legacy store.- Specified by:
add
in interfaceCollection<T extends Describable<T>>
- Specified by:
add
in interfaceList<T extends Describable<T>>
- Overrides:
add
in classExtensionList<D extends Descriptor<T>>
-
remove
- Specified by:
remove
in interfaceCollection<T extends Describable<T>>
- Specified by:
remove
in interfaceList<T extends Describable<T>>
- Overrides:
remove
in classExtensionList<D extends Descriptor<T>>
-
getLoadLock
load()
in the descriptor is not a real load activity, so locking against "this" is enough.- Overrides:
getLoadLock
in classExtensionList<D extends Descriptor<T>>
-
load
Loading the descriptors in this case means filtering the descriptor from the masterExtensionList
.- Overrides:
load
in classExtensionList<D extends Descriptor<T>>
-
load
Description copied from class:ExtensionList
Picks up extensions that we care from the given list.- Overrides:
load
in classExtensionList<D extends Descriptor<T>>
-
listLegacyInstances
List up all the legacy instances currently in use. -
clearLegacyInstances
public static void clearLegacyInstances()Exposed just for the test harness. Clear legacy instances.
-
DescriptorExtensionList(Jenkins, Class)