net.sourceforge.pmd.lang.rule.properties
Class AbstractPackagedProperty<T>

java.lang.Object
  extended by net.sourceforge.pmd.lang.rule.properties.AbstractProperty<T>
      extended by 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
protected static Map<String,Boolean> PACKAGED_FIELD_TYPES_BY_KEY
           
 
Fields inherited from class net.sourceforge.pmd.lang.rule.properties.AbstractProperty
DEFAULT_DELIMITER, DEFAULT_NUMERIC_DELIMITER
 
Constructor Summary
protected AbstractPackagedProperty(String theName, String theDescription, T theDefault, String[] theLegalPackageNames, float theUIOrder)
           
 
Method Summary
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

PACKAGED_FIELD_TYPES_BY_KEY

protected static final Map<String,Boolean> PACKAGED_FIELD_TYPES_BY_KEY
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

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[]


Copyright © 2002-2015 InfoEther. All Rights Reserved.