Class PropertyDescriptor<T>

java.lang.Object
net.sourceforge.pmd.properties.PropertyDescriptor<T>
Type Parameters:
T - Type of the property's value

public final class PropertyDescriptor<T> extends Object
Describes a property of a rule or a renderer.

Usage of this API is described on PropertyFactory.

A property descriptor provides validation, serialization, and default values for a datatype <T>. Property descriptors are immutable and can be shared freely.

Author:
Brian Remedios, Clément Fournier
Version:
7.0.0
See Also:
  • Method Details

    • name

      public String name()
      The name of the property without spaces as it serves as the key into the property map.
      Returns:
      String
    • description

      public String description()
      Describes the property and the role it plays within the rule it is specified for. Could be used in a tooltip.
      Returns:
      String
    • defaultValue

      public T defaultValue()
      Default value to use when the user hasn't specified one or when they wish to revert to a known-good state.
      Returns:
      Object
    • serializer

      public PropertySerializer<T> serializer()
      Returns the strategy used to read and write this property to XML. May support strings too.
    • isXPathAvailable

      public boolean isXPathAvailable()
      Returns whether the property is available to XPath queries.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object