Package com.xebialabs.deployit.plugin.api.reflect

# Interface Descriptor

public interface Descriptor
Encapsulates the metadata about a type in the XL Deploy type system. Example of such metadata: the available properties, the implemented interfaces, the available control tasks etc.

The Descriptor for a specific type can be retrieved using the MetadataService, which is also available as a REST API.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `areEqual(ConfigurationItem item, ConfigurationItem other)`
  `Class<?>`
  `getClazz()`
  `Type`
  `getContainerType()`
  Only applicable for `Deployed`s.
  `MethodDescriptor`
  `getControlTask(String name)`
  `Collection<MethodDescriptor>`
  `getControlTasks()`
  `CreatorDescriptor`
  `getCreator()`
  `Type`
  `getDeployableType()`
  Only applicable for `Deployed`s.
  `String`
  `getDescription()`
  `String`
  `getIcon()`
  `Set<Type>`
  `getInterfaces()`
  `String`
  `getLabel()`
  `PropertyDescriptor`
  `getPropertyDescriptor(String name)`
  `Collection<PropertyDescriptor>`
  `getPropertyDescriptors()`
  Note: The return-type is a Collection, but a List is actually returned.
  `default Metadata.ConfigurationItemRoot`
  `getRoot()`
  `String`
  `getRootName()`
  `List<Type>`
  `getSuperClasses()`
  `Type`
  `getType()`
  `boolean`
  `isAssignableTo(Type type)`
  `boolean`
  `isAssignableTo(Class<?> clazz)`
  `boolean`
  `isInspectable()`
  `boolean`
  `isVersioned()`
  `boolean`
  `isVirtual()`
  `<T extends ConfigurationItem>
  T`
  `newInstance(String id)`
  `String`
  `toString()`
  `List<ValidationMessage>`
  `validate(ConfigurationItem ci)`
  Validates the values for each property of the CI.
  `List<ValidationMessage>`
  `validate(ExtendedValidationContext context, ConfigurationItem ci)`
  `List<ValidationMessage>`
  `validateInputHint(ConfigurationItem ci)`

- ## Method Details

  - ### getType

    Type getType()
    Returns:
      The type of a `ConfigurationItem`.

  - ### getClazz

    Class<?> getClazz()
    Returns:
      The `ConfigurationItem` class object.

  - ### getDescription

    String getDescription()
    Returns:
      A textual description of this type.

  - ### getLabel

    String getLabel()
    Returns:
      The friendly name of the type

  - ### getRoot

    default Metadata.ConfigurationItemRoot getRoot()
    Returns:
      The root in the JCR tree.

  - ### getRootName

    String getRootName()
    Returns:
      The root name in the JCR tree.

  - ### getPropertyDescriptors

    Collection<PropertyDescriptor> getPropertyDescriptors()
    Note: The return-type is a Collection, but a List is actually returned. So the order of the properties is guaranteed. We cannot change the return-type as this would break binary compatibility.
    Returns:
      A list of metadata about a all the properties of this type.

  - ### getPropertyDescriptor

    PropertyDescriptor getPropertyDescriptor(String name)
    Parameters:
      `name` - The name of the property.
    Returns:
      The metadata for the given property name.

  - ### getControlTask

    MethodDescriptor getControlTask(String name)
    Parameters:
      `name` - The name of the control methods.
    Returns:
      The metadata for the given a control method name.

  - ### getControlTasks

    Collection<MethodDescriptor> getControlTasks()
    Returns:
      A list of metadata about a all the control methods of this type.

  - ### isAssignableTo

    boolean isAssignableTo(Class<?> clazz)
    Parameters:
      `clazz` - A `ConfigurationItem` class object.
    Returns:
      Whether this type is a subtype or has the same type as the type of the given CI class.

  - ### isAssignableTo

    boolean isAssignableTo(Type type)
    Parameters:
      `type` - A CI type.
    Returns:
      Whether this type is a subtype or has the same type as the given type.

  - ### getSuperClasses

    List<Type> getSuperClasses()
    Returns:
      The list of all the super classes of this `ConfigurationItem`.

  - ### getInterfaces

    Set<Type> getInterfaces()
    Returns:
      The set of all the interfaces this `ConfigurationItem` implements.

  - ### isVirtual

    boolean isVirtual()
    Returns:
      Whether this type is a virtual type.

  - ### isVersioned

    boolean isVersioned()
    Returns:
      Whether or not this is a versioned type, i.e. whether or not the JCR version history for CIs of this type is kept.

  - ### getIcon

    String getIcon()
    Returns:
      The relative path to the icon for this type.

  - ### areEqual

    boolean areEqual(ConfigurationItem item, ConfigurationItem other)
    Returns:
      Whether or not the given CIs are considered to be equal.

  - ### newInstance

    <T extends ConfigurationItem> T newInstance(String id)
    Type Parameters:
      `T` - The `ConfigurationItem` class.
    Parameters:
      `id` - The `ConfigurationItem` id.
    Returns:
      A new CI instance of the given type and id.

  - ### toString

    String toString()
    Overrides:
      `toString` in class `Object`

  - ### getDeployableType

    Type getDeployableType()
    Only applicable for `Deployed`s.
    Returns:
      The `Deployable` type that created this deployed.

  - ### getContainerType

    Type getContainerType()
    Only applicable for `Deployed`s.
    Returns:
      The `Container` type this deployed can be deployed to.

  - ### validate

    List<ValidationMessage> validate(ConfigurationItem ci)
    Validates the values for each property of the CI.
    Parameters:
      `ci` - The `ConfigurationItem` to ve validated.
    Returns:
      A list of `ValidationMessage`s.

  - ### validate

    List<ValidationMessage> validate(ExtendedValidationContext context, ConfigurationItem ci)

  - ### validateInputHint

    List<ValidationMessage> validateInputHint(ConfigurationItem ci)

  - ### isInspectable

    boolean isInspectable()
    Returns:
      Whether this type supports inspection.

  - ### getCreator

    CreatorDescriptor getCreator()