net.sourceforge.pmd.lang.rule.properties
Class StringMultiProperty

java.lang.Object
  extended by net.sourceforge.pmd.lang.rule.properties.AbstractProperty<T>
      extended by net.sourceforge.pmd.lang.rule.properties.AbstractDelimitedProperty<String[]>
          extended by net.sourceforge.pmd.lang.rule.properties.StringMultiProperty
All Implemented Interfaces:
Comparable<PropertyDescriptor<?>>, PropertyDescriptor<String[]>

public class StringMultiProperty
extends AbstractDelimitedProperty<String[]>

Defines a datatype that supports multiple String values. Note that all strings must be filtered by the delimiter character.

Author:
Brian Remedios

Field Summary
static char DEFAULT_DELIMITER
           
static PropertyDescriptorFactory FACTORY
           
 
Constructor Summary
StringMultiProperty(String theName, String theDescription, String[] theDefaults, float theUIOrder, char delimiter)
          Constructor for StringProperty.
StringMultiProperty(String theName, String theDescription, String theDefaults, Map<String,String> otherParams)
          Constructor for CharacterProperty that accepts additional params from a map.
 
Method Summary
 Class<String[]> type()
          Denotes the value datatype.
protected  String valueErrorFor(Object value)
           
 String[] 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.AbstractDelimitedProperty
addAttributesTo, defaultAsString, delimiterIn, isMultiValue, multiValueDelimiter, multiValueDelimiter
 
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, valuesErrorFor
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_DELIMITER

public static final char DEFAULT_DELIMITER
See Also:
Constant Field Values

FACTORY

public static final PropertyDescriptorFactory FACTORY
Constructor Detail

StringMultiProperty

public StringMultiProperty(String theName,
                           String theDescription,
                           String[] theDefaults,
                           float theUIOrder,
                           char delimiter)
Constructor for StringProperty.

Parameters:
theName - String
theDescription - String
theDefaults - String[]
theUIOrder - float
delimiter - String
Throws:
IllegalArgumentException

StringMultiProperty

public StringMultiProperty(String theName,
                           String theDescription,
                           String theDefaults,
                           Map<String,String> otherParams)
Constructor for CharacterProperty that accepts additional params from a map.

Parameters:
theName -
theDescription -
theDefaults -
otherParams -
Method Detail

type

public Class<String[]> type()
Description copied from interface: PropertyDescriptor
Denotes the value datatype.

Returns:
Class
See Also:
PropertyDescriptor.type()

valueFrom

public String[] valueFrom(String valueString)
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
See Also:
PropertyDescriptor.valueFrom(String)

valueErrorFor

protected String valueErrorFor(Object value)
Overrides:
valueErrorFor in class AbstractProperty<String[]>
Parameters:
value - Object
Returns:
String


Copyright © 2002-2012 InfoEther. All Rights Reserved.