hudson
Class DescriptorExtensionList<T extends Describable<T>,D extends Descriptor<T>>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<T>
          extended by hudson.ExtensionList<D>
              extended by hudson.DescriptorExtensionList<T,D>
Type Parameters:
D - Represents the descriptor type. This is Descriptor<T> normally but often there are subtypes of descriptors, like ViewDescriptor, 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>
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 Descriptors, 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
protected DescriptorExtensionList(Hudson hudson, Class<T> describableType)
          Deprecated. as of 1.416 Use DescriptorExtensionList(Jenkins, Class)
protected DescriptorExtensionList(Jenkins jenkins, Class<T> describableType)
           
 
Method Summary
 boolean add(D d)
          Write access will put the instance into a legacy store.
static void clearLegacyInstances()
          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 Use ExtensionList.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.
 D find(Class<? extends T> type)
          Finds the descriptor that describes the given type.
 D find(String fqcn)
          Finds the descriptor that has the matching fully-qualified class name.
 D findByName(String id)
          Finds a descriptor by their Descriptor.getId().
protected  Object getLoadLock()
          load() in the descriptor is not a real load activity, so locking against "this" is enough.
static Iterable<Descriptor> listLegacyInstances()
          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 master ExtensionList.
protected  Collection<ExtensionComponent<D>> load(ExtensionComponentSet delta)
          Picks up extensions that we care from the given list.
 T newInstanceFromRadioList(net.sf.json.JSONObject config)
          Creates a new instance of a Describable from the structured form submission data posted by a radio button group.
 T newInstanceFromRadioList(net.sf.json.JSONObject parent, String name)
           
 boolean remove(Object o)
           
 
Methods inherited from class hudson.ExtensionList
add, create, create, get, get, getComponents, getDynamic, iterator, refresh, remove, 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, removeAll, 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.List
addAll, contains, containsAll, isEmpty, removeAll, retainAll, toArray, toArray
 

Constructor Detail

DescriptorExtensionList

protected DescriptorExtensionList(Hudson hudson,
                                  Class<T> describableType)
Deprecated. as of 1.416 Use DescriptorExtensionList(Jenkins, Class)


DescriptorExtensionList

protected DescriptorExtensionList(Jenkins jenkins,
                                  Class<T> describableType)
Method Detail

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

public static <T extends Describable<T>,D extends Descriptor<T>> DescriptorExtensionList<T,D> createDescriptorList(Hudson hudson,
                                                                                                                   Class<T> describableType)
Deprecated. as of 1.416 Use ExtensionList.create(Jenkins, Class)


find

public D find(String fqcn)
Finds the descriptor that has the matching fully-qualified class name.

Parameters:
fqcn - Fully qualified name of the descriptor, not the describable.

find

public D find(Class<? extends T> type)
Finds the descriptor that describes the given type. That is, if this method returns d, d.clazz==type


newInstanceFromRadioList

public T newInstanceFromRadioList(net.sf.json.JSONObject config)
                                                  throws Descriptor.FormException
Creates a new instance of a Describable from the structured form submission data posted by a radio button group.

Throws:
Descriptor.FormException

newInstanceFromRadioList

public T newInstanceFromRadioList(net.sf.json.JSONObject parent,
                                  String name)
                                                  throws Descriptor.FormException
Throws:
Descriptor.FormException

findByName

public D findByName(String id)
Finds a descriptor by their Descriptor.getId(). If none is found, null is returned.


add

public boolean add(D d)
Description copied from class: ExtensionList
Write access will put the instance into a legacy store.

Specified by:
add in interface Collection<D extends Descriptor<T>>
Specified by:
add in interface List<D extends Descriptor<T>>
Overrides:
add in class ExtensionList<D extends Descriptor<T>>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<D extends Descriptor<T>>
Specified by:
remove in interface List<D extends Descriptor<T>>
Overrides:
remove in class ExtensionList<D extends Descriptor<T>>

getLoadLock

protected Object getLoadLock()
load() in the descriptor is not a real load activity, so locking against "this" is enough.

Overrides:
getLoadLock in class ExtensionList<D extends Descriptor<T>>

load

protected List<ExtensionComponent<D>> load()
Loading the descriptors in this case means filtering the descriptor from the master ExtensionList.

Overrides:
load in class ExtensionList<D extends Descriptor<T>>

load

protected Collection<ExtensionComponent<D>> load(ExtensionComponentSet delta)
Description copied from class: ExtensionList
Picks up extensions that we care from the given list.

Overrides:
load in class ExtensionList<D extends Descriptor<T>>

listLegacyInstances

public static Iterable<Descriptor> listLegacyInstances()
List up all the legacy instances currently in use.


clearLegacyInstances

public static void clearLegacyInstances()
Exposed just for the test harness. Clear legacy instances.



Copyright © 2004-2013. All Rights Reserved.