net.sourceforge.pmd.lang.rule.properties

## Class AbstractPackagedProperty<T>

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

Type Parameters:
  `T` -

All Implemented Interfaces:
  Comparable<PropertyDescriptor<?>>, PropertyDescriptor<T>

Direct Known Subclasses:
  AbstractMultiPackagedProperty, MethodProperty, TypeProperty

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

Concrete subclasses manage items that reside within namespaces per the design of the Java language. Rule developers can limit the range of permissible items by specifying portions of their package names in the constructor. If the legalPackageNames value is set to null then no restrictions are made.

Author:
  Brian Remedios

### Field Summary

Fields
`protected static Map<String,Boolean>` `packagedFieldTypesByKey`

### Constructor Summary

Constructors
`protected` `AbstractPackagedProperty(String theName, String theDescription, T theDefault, String[] theLegalPackageNames, float theUIOrder)`

### Method Summary

Methods
`protected void` `addAttributesTo(Map<String,String> attributes)`
`protected abstract String` `itemTypeName()` Method itemTypeName.
`String[]` `legalPackageNames()`
`protected abstract String` `packageNameOf(Object item)`
`protected static String[]` `packageNamesIn(Map<String,String> params)`
`protected String` `valueErrorFor(Object value)`

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

`areEqual, asDelimitedString, asDelimitedString, asString, attributeValuesById, choices, compareTo, defaultAsString, defaultHasNullValue, defaultValue, description, equals, errorFor, hashCode, isArray, isMultiValue, isRequired, multiValueDelimiter, name, preferredRowCount, propertyErrorFor, toString, typeErrorFor, uiOrder, 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`

### Field Detail

#### packagedFieldTypesByKey

    protected static final Map<String,Boolean> packagedFieldTypesByKey

### Constructor Detail

#### AbstractPackagedProperty

    protected AbstractPackagedProperty(String theName,
                            String theDescription,
                            T theDefault,
                            String[] theLegalPackageNames,
                            float theUIOrder)

Parameters:
  `theName` -
  `theDescription` -
  `theDefault` -
  `theLegalPackageNames` -
  `theUIOrder` -
Throws:
  `IllegalArgumentException`

### Method Detail

#### packageNamesIn

    protected static String[] packageNamesIn(Map<String,String> params)

#### addAttributesTo

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

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

#### itemTypeName

    protected abstract String itemTypeName()

Method itemTypeName.

Returns:
  String

#### valueErrorFor

    protected String valueErrorFor(Object value)

Overrides:
  `valueErrorFor` in class `AbstractProperty<T>`
Parameters:
  `value` - Object
Returns:
  String

#### packageNameOf

    protected abstract String packageNameOf(Object item)

Parameters:
  `item` - Object
Returns:
  String

#### legalPackageNames

    public String[] legalPackageNames()

Returns:
  String[]