|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthudson.util.PersistedList<T>
hudson.util.DescribableList<T,D>
public class DescribableList<T extends Describable<T>,D extends Descriptor<T>>
Persisted list of Describable
s with some operations specific
to Descriptor
s.
This class allows multiple instances of the same descriptor. Some clients
use this semantics, while other clients use it as "up to one instance per
one descriptor" model.
Some of the methods defined in this class only makes sense in the latter model,
such as remove(Descriptor)
.
Nested Class Summary | |
---|---|
static class |
DescribableList.ConverterImpl
Converter implementation for XStream. |
static interface |
DescribableList.Owner
Deprecated. since 2008-08-15. Just implement Saveable . |
Field Summary |
---|
Fields inherited from class hudson.util.PersistedList |
---|
data, owner |
Constructor Summary | |
---|---|
protected |
DescribableList()
|
|
DescribableList(DescribableList.Owner owner)
Deprecated. since 2008-08-15. Use DescribableList(Saveable) |
|
DescribableList(Saveable owner)
|
|
DescribableList(Saveable owner,
Collection<? extends T> initialList)
|
Method Summary | ||
---|---|---|
void |
buildDependencyGraph(AbstractProject owner,
DependencyGraph graph)
Picks up DependencyDeclarer s and allow it to build dependencies. |
|
boolean |
contains(D d)
|
|
|
get(Class<U> type)
|
|
T |
get(D descriptor)
|
|
T |
getDynamic(String id)
Binds items in the collection to URL. |
|
void |
rebuild(org.kohsuke.stapler.StaplerRequest req,
net.sf.json.JSONObject json,
List<? extends Descriptor<T>> descriptors)
Rebuilds the list by creating a fresh instances from the submitted form. |
|
void |
rebuild(org.kohsuke.stapler.StaplerRequest req,
net.sf.json.JSONObject json,
List<? extends Descriptor<T>> descriptors,
String prefix)
Deprecated. as of 1.271 Use rebuild(StaplerRequest, JSONObject, List) instead. |
|
void |
rebuildHetero(org.kohsuke.stapler.StaplerRequest req,
net.sf.json.JSONObject formData,
Collection<? extends Descriptor<T>> descriptors,
String key)
Rebuilds the list by creating a fresh instances from the submitted form. |
|
void |
remove(D descriptor)
|
|
void |
replace(T item)
Removes all instances of the same type, then add the new one. |
|
void |
setOwner(DescribableList.Owner owner)
Deprecated. since 2008-08-15. Use PersistedList.setOwner(Saveable) |
|
T[] |
toArray(T[] array)
Gets all the Describable s in an array. |
|
Map<D,T> |
toMap()
Creates a detached map from the current snapshot of the data, keyed from a descriptor to an instance. |
Methods inherited from class hudson.util.PersistedList |
---|
add, addAll, addAllTo, clear, contains, get, getAll, isEmpty, iterator, onModified, remove, remove, removeAll, replace, replaceBy, setOwner, size, toList |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected DescribableList()
public DescribableList(DescribableList.Owner owner)
DescribableList(Saveable)
public DescribableList(Saveable owner)
public DescribableList(Saveable owner, Collection<? extends T> initialList)
Method Detail |
---|
public void setOwner(DescribableList.Owner owner)
PersistedList.setOwner(Saveable)
public void replace(T item) throws IOException
IOException
public T getDynamic(String id)
public T get(D descriptor)
public boolean contains(D d)
public void remove(D descriptor) throws IOException
IOException
public Map<D,T> toMap()
public void rebuild(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject json, List<? extends Descriptor<T>> descriptors) throws Descriptor.FormException, IOException
This method is almost always used by the owner. This method does not invoke the save method.
json
- Structured form data that includes the data for nested descriptor list.
Descriptor.FormException
IOException
public void rebuild(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject json, List<? extends Descriptor<T>> descriptors, String prefix) throws Descriptor.FormException, IOException
rebuild(StaplerRequest, JSONObject, List)
instead.
Descriptor.FormException
IOException
public void rebuildHetero(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject formData, Collection<? extends Descriptor<T>> descriptors, String key) throws Descriptor.FormException, IOException
This version works with the the <f:hetero-list> UI tag, where the user is allowed to create multiple instances of the same descriptor. Order is also significant.
Descriptor.FormException
IOException
public void buildDependencyGraph(AbstractProject owner, DependencyGraph graph)
DependencyDeclarer
s and allow it to build dependencies.
public <U extends T> U get(Class<U> type)
get
in class PersistedList<T extends Describable<T>>
public T[] toArray(T[] array)
PersistedList
Describable
s in an array.
toArray
in class PersistedList<T extends Describable<T>>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |