Metadata about a configurable instance.
{@link Descriptor} is an object that has metadata about a {@link Describable}object, and also serves as a factory (in a way this relationship is similar to {@link Object}/ {@link Class} relationship.A {@link Descriptor}/ {@link Describable}combination is used throughout in Hudson to implement a configuration/extensibility mechanism.
Take the list view support as an example, which is implemented in {@link ListView} class. Whenever a new view is created, a new{@link ListView} instance is created with the configurationinformation. This instance gets serialized to XML, and this instance will be called to render the view page. This is the job of {@link Describable} — each instance represents a specificconfiguration of a view (what projects are in it, regular expression, etc.)
For Hudson to create such configured {@link ListView} instance, Hudsonneeds another object that captures the metadata of {@link ListView}, and that is what a {@link Descriptor} is for. {@link ListView} classhas a singleton descriptor, and this descriptor helps render the configuration form, remember system-wide configuration, and works as a factory.
{@link Descriptor} also usually have its associated views.
Persistence
{@link Descriptor} can persist data just by storing them in fields.However, it is the responsibility of the derived type to properly invoke {@link #save()} and {@link #load()}.
Reflection Enhancement
{@link Descriptor} defines addition to the standard Java reflectionand provides reflective information about its corresponding {@link Describable}. These are primarily used by tag libraries to keep the Jelly scripts concise.
@author Kohsuke Kawaguchi
@see Describable