net.sourceforge.pmd.lang.rule.properties

## Class AbstractScalarProperty<T>

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

- Type Parameters:
    `T` -
  All Implemented Interfaces:
    Comparable<PropertyDescriptor<?>>, PropertyDescriptor<T>
  Direct Known Subclasses:
    AbstractNumericProperty, BooleanMultiProperty, BooleanProperty

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

  No, subclasses are not necessarily scalar per se, they're just easy to parse without error. If you can come up with a better name...
  Author:
    Brian Remedios

- - ### Constructor Summary

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

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Object[]` | `arrayFor(int size)`
    `protected abstract Object` | `createFrom(String value)`
    `T` | `valueFrom(String valueString)` If the property is multi-valued then return the separate values after parsing the propertyString provided.

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

      `addAttributesTo, areEqual, asDelimitedString, asDelimitedString, asString, attributeValuesById, choices, compareTo, defaultAsString, defaultHasNullValue, defaultValue, description, equals, errorFor, hashCode, isArray, isMultiValue, isRequired, multiValueDelimiter, 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`

- - ### Constructor Detail

    - #### AbstractScalarProperty

          protected AbstractScalarProperty(String theName,
                                String theDescription,
                                T theDefault,
                                float theUIOrder)

      Constructor for AbstractScalarProperty.
      Parameters:
        `theName` - String
        `theDescription` - String
        `theDefault` - Object
        `theUIOrder` - float

  - ### Method Detail

    - #### createFrom

          protected abstract Object createFrom(String value)

      Parameters:
        `value` - String
      Returns:
        Object

    - #### arrayFor

          protected Object[] arrayFor(int size)

      Parameters:
        `size` - int
      Returns:
        Object[]

    - #### valueFrom

          public T valueFrom(String valueString)
                      throws IllegalArgumentException

      Description copied from interface: `PropertyDescriptor`
      If the property is multi-valued then return the separate values after parsing the propertyString provided. If it isn't a multi-valued property then the value will be returned within an array of size[1].
      Parameters:
        `valueString` - String
      Returns:
        Object[]
      Throws:
        `IllegalArgumentException`
      See Also:
        `PropertyDescriptor.valueFrom(String)`

Copyright © 2002-2013 InfoEther. All Rights Reserved.