|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthudson.model.Items
public class Items
Convenience methods related to Item.
| Field Summary | |
|---|---|
static List<TopLevelItemDescriptor> |
LIST
Deprecated. as of 1.286 Use all() for read access and Extension for registration. |
static com.thoughtworks.xstream.XStream |
XSTREAM
Used to load/save job configuration. |
static XStream2 |
XSTREAM2
Alias to XSTREAM so that one can access additional methods on XStream2 more easily. |
| Constructor Summary | |
|---|---|
Items()
|
|
| Method Summary | ||
|---|---|---|
static DescriptorExtensionList<TopLevelItem,TopLevelItemDescriptor> |
all()
Returns all the registered TopLevelItemDescriptors. |
|
static String |
computeRelativeNamesAfterRenaming(String oldFullName,
String newFullName,
String relativeNames,
ItemGroup context)
Compute the relative name of list of items after a rename occurred. |
|
static
|
fromNameList(ItemGroup context,
String list,
Class<T> type)
Does the opposite of toNameList(Collection). |
|
static
|
fromNameList(String list,
Class<T> type)
Deprecated. as of 1.406 Use fromNameList(ItemGroup, String, Class) |
|
static
|
getAllItems(ItemGroup root,
Class<T> type)
Gets all the Items recursively in the ItemGroup tree
and filter them by the given type. |
|
static String |
getCanonicalName(ItemGroup context,
String path)
Computes the canonical full name of a relative path in an ItemGroup context, handling relative
positions ".." and "." as absolute path starting with "/". |
|
static XmlFile |
getConfigFile(File dir)
The file we save our configuration. |
|
static XmlFile |
getConfigFile(Item item)
The file we save our configuration. |
|
static TopLevelItemDescriptor |
getDescriptor(String fqcn)
|
|
static Item |
load(ItemGroup parent,
File dir)
Loads a Item from a config file. |
|
static String |
toNameList(Collection<? extends Item> items)
Converts a list of items into a comma-separated list of full names. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final List<TopLevelItemDescriptor> LIST
all() for read access and Extension for registration.TopLevelItem types.
public static final com.thoughtworks.xstream.XStream XSTREAM
Job in a plugin, try to put the alias so
that it produces a reasonable XML.
public static final XStream2 XSTREAM2
XSTREAM so that one can access additional methods on XStream2 more easily.
| Constructor Detail |
|---|
public Items()
| Method Detail |
|---|
public static DescriptorExtensionList<TopLevelItem,TopLevelItemDescriptor> all()
TopLevelItemDescriptors.
public static TopLevelItemDescriptor getDescriptor(String fqcn)
public static String toNameList(Collection<? extends Item> items)
public static <T extends Item> List<T> fromNameList(String list,
Class<T> type)
fromNameList(ItemGroup, String, Class)
public static <T extends Item> List<T> fromNameList(ItemGroup context,
String list,
Class<T> type)
toNameList(Collection).
public static String getCanonicalName(ItemGroup context,
String path)
ItemGroup context, handling relative
positions ".." and "." as absolute path starting with "/". The resulting name is the item fullName from Jenkins
root.
public static String computeRelativeNamesAfterRenaming(String oldFullName,
String newFullName,
String relativeNames,
ItemGroup context)
ItemListener.onRenamed(hudson.model.Item, String, String).
In a hierarchical context, when a plugin has a reference to a job as ../foo/bar this method will
handle the relative path as "foo" is renamed to "zot" to compute ../zot/bar
oldFullName - the old full name of the itemnewFullName - the new full name of the itemrelativeNames - coma separated list of Item relative namescontext - the {link ItemGroup} relative names refer to
public static Item load(ItemGroup parent,
File dir)
throws IOException
Item from a config file.
dir - The directory that contains the config file, not the config file itself.
IOExceptionpublic static XmlFile getConfigFile(File dir)
public static XmlFile getConfigFile(Item item)
public static <T extends Item> List<T> getAllItems(ItemGroup root,
Class<T> type)
Items recursively in the ItemGroup tree
and filter them by the given type.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||