hudson.model
Class TopLevelItemDescriptor

java.lang.Object
  extended by hudson.model.Descriptor<TopLevelItem>
      extended by hudson.model.TopLevelItemDescriptor
All Implemented Interfaces:
Saveable
Direct Known Subclasses:
AbstractProject.AbstractProjectDescriptor, MockFolder.DescriptorImpl

public abstract class TopLevelItemDescriptor
extends Descriptor<TopLevelItem>

Descriptor for TopLevelItems.

Author:
Kohsuke Kawaguchi

Nested Class Summary
 
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
 
Field Summary
 
Fields inherited from class hudson.model.Descriptor
clazz
 
Fields inherited from interface hudson.model.Saveable
NOOP
 
Constructor Summary
protected TopLevelItemDescriptor()
          Infers the type of the corresponding TopLevelItem from the outer class.
protected TopLevelItemDescriptor(Class<? extends TopLevelItem> clazz)
           
 
Method Summary
static ExtensionList<TopLevelItemDescriptor> all()
          Returns all the registered TopLevelItem descriptors.
abstract  String getDisplayName()
          Human readable name of this kind of configurable object.
 boolean isApplicable(Descriptor descriptor)
          TopLevelItemDescriptors often uses other descriptors to decorate itself.
abstract  TopLevelItem newInstance(ItemGroup parent, String name)
          Creates a new TopLevelItem for the specified parent.
 TopLevelItem newInstance(org.kohsuke.stapler.StaplerRequest req)
          Deprecated. since 2007-01-19. This is not a valid operation for Jobs.
 TopLevelItem newInstance(String name)
          Deprecated. as of 1.390 Use newInstance(ItemGroup, String)
 boolean testInstance(TopLevelItem i)
          Tests if the given instance belongs to this descriptor, in the sense that this descriptor can produce items like the given one.
 
Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, calcAutoCompleteSettings, calcFillSettings, configure, configure, doHelp, find, find, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TopLevelItemDescriptor

protected TopLevelItemDescriptor(Class<? extends TopLevelItem> clazz)

TopLevelItemDescriptor

protected TopLevelItemDescriptor()
Infers the type of the corresponding TopLevelItem from the outer class. This version works when you follow the common convention, where a descriptor is written as the static nested class of the describable class.

Since:
1.278
Method Detail

isApplicable

public boolean isApplicable(Descriptor descriptor)
TopLevelItemDescriptors often uses other descriptors to decorate itself. This method allows the subtype of TopLevelItemDescriptors to filter them out.

This is useful for a workflow/company specific job type that wants to eliminate options that the user would see.

Since:
1.294

testInstance

public boolean testInstance(TopLevelItem i)
Tests if the given instance belongs to this descriptor, in the sense that this descriptor can produce items like the given one.

TopLevelItemDescriptors that act like a wizard and produces different object types than Descriptor.clazz can override this method to augment instance-descriptor relationship.


getDisplayName

public abstract String getDisplayName()
Human readable name of this kind of configurable object.

Used as the caption when the user chooses what job type to create. The descriptor implementation also needs to have newJobDetail.jelly script, which will be used to render the text below the caption that explains the job type.

Specified by:
getDisplayName in class Descriptor<TopLevelItem>

newInstance

@Deprecated
public TopLevelItem newInstance(org.kohsuke.stapler.StaplerRequest req)
                         throws Descriptor.FormException
Deprecated. since 2007-01-19. This is not a valid operation for Jobs.

Overrides:
newInstance in class Descriptor<TopLevelItem>
Throws:
Descriptor.FormException

newInstance

public TopLevelItem newInstance(String name)
Deprecated. as of 1.390 Use newInstance(ItemGroup, String)

Creates a new TopLevelItem.


newInstance

public abstract TopLevelItem newInstance(ItemGroup parent,
                                         String name)
Creates a new TopLevelItem for the specified parent.

Since:
1.390

all

public static ExtensionList<TopLevelItemDescriptor> all()
Returns all the registered TopLevelItem descriptors.



Copyright © 2004-2013. All Rights Reserved.