net.sourceforge.pmd.lang.rule.properties

## Class AbstractDelimitedProperty<T>

- java.lang.Object
- - net.sourceforge.pmd.lang.rule.properties.AbstractProperty<T>
  - - net.sourceforge.pmd.lang.rule.properties.AbstractDelimitedProperty<T>

- Type Parameters:
    `T` -
  All Implemented Interfaces:
    Comparable<PropertyDescriptor<?>>, PropertyDescriptor<T>
  Direct Known Subclasses:
    CharacterMultiProperty, StringMultiProperty

      public abstract class AbstractDelimitedProperty<T>
      extends AbstractProperty<T>

  Concrete subclasses represent properties whose values when serialized onto a string can be problematic without specifying a unique delimiter that won't appear in the value set.
  Author:
    Brian Remedios

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractDelimitedProperty(String theName, String theDescription, T theDefault, char delimiter, float theUIOrder)` Constructor for AbstractDelimitedProperty.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addAttributesTo(Map<String,String> attributes)`
    `protected String` | `defaultAsString()`
    `protected static char` | `delimiterIn(Map<String,String> parameters)`
    `boolean` | `isMultiValue()` Returns whether the property is multi-valued, i.e. an array of strings, As unary property rule properties will return a value of one, you must use the get/setProperty accessors when working with the actual values.
    `char` | `multiValueDelimiter()` Return the character being used to delimit multiple property values within a single string.
    `protected void` | `multiValueDelimiter(char aDelimiter)`

    - ### Methods inherited from class net.sourceforge.pmd.lang.rule.properties.AbstractProperty

      `areEqual, asDelimitedString, asDelimitedString, asString, attributeValuesById, choices, compareTo, defaultHasNullValue, defaultValue, description, equals, errorFor, hashCode, isArray, isRequired, name, preferredRowCount, propertyErrorFor, toString, typeErrorFor, uiOrder, valueErrorFor, valuesErrorFor`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface net.sourceforge.pmd.PropertyDescriptor

      `type, valueFrom`

- - ### Constructor Detail

    - #### AbstractDelimitedProperty

          protected AbstractDelimitedProperty(String theName,
                                   String theDescription,
                                   T theDefault,
                                   char delimiter,
                                   float theUIOrder)

      Constructor for AbstractDelimitedProperty.
      Parameters:
        `theName` - String
        `theDescription` - String
        `theDefault` - T
        `delimiter` - char
        `theUIOrder` - float

  - ### Method Detail

    - #### delimiterIn

          protected static char delimiterIn(Map<String,String> parameters)

    - #### addAttributesTo

          protected void addAttributesTo(Map<String,String> attributes)

      Overrides:
        `addAttributesTo` in class `AbstractProperty<T>`
      Parameters:
        `attributes` - Map

    - #### defaultAsString

          protected String defaultAsString()

      Specified by:
        `defaultAsString` in class `AbstractProperty<T>`
      Returns:
        String

    - #### multiValueDelimiter

          protected void multiValueDelimiter(char aDelimiter)

      Parameters:
        `aDelimiter` - char

    - #### multiValueDelimiter

          public char multiValueDelimiter()

      Description copied from class: `AbstractProperty`
      Return the character being used to delimit multiple property values within a single string. You must ensure that this character does not appear within any rule property values to avoid deserialization errors.
      Specified by:
        `multiValueDelimiter` in interface `PropertyDescriptor<T>`
      Overrides:
        `multiValueDelimiter` in class `AbstractProperty<T>`
      Returns:
        char
      See Also:
        `PropertyDescriptor.multiValueDelimiter()`

    - #### isMultiValue

          public boolean isMultiValue()

      Description copied from class: `AbstractProperty`
      Returns whether the property is multi-valued, i.e. an array of strings, As unary property rule properties will return a value of one, you must use the get/setProperty accessors when working with the actual values. When working with multi-value properties then the get/setProperties accessors must be used.
      Specified by:
        `isMultiValue` in interface `PropertyDescriptor<T>`
      Overrides:
        `isMultiValue` in class `AbstractProperty<T>`
      Returns:
        boolean
      See Also:
        `PropertyDescriptor.isMultiValue()`

Copyright © 2002-2013 InfoEther. All Rights Reserved.