net.sourceforge.pmd.lang.rule.properties
Class StringMultiProperty
java.lang.Object
net.sourceforge.pmd.lang.rule.properties.AbstractProperty<String[]>
net.sourceforge.pmd.lang.rule.properties.StringMultiProperty
- All Implemented Interfaces:
- Comparable<PropertyDescriptor<?>>, PropertyDescriptor<String[]>
public class StringMultiProperty
- extends AbstractProperty<String[]>
Defines a datatype that supports multiple String values. Note that all
strings must be filtered by the delimiter character.
- Author:
- Brian Remedios
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, isRequired, multiValueDelimiter, name, preferredRowCount, propertyErrorFor, toString, typeErrorFor, uiOrder, valuesErrorFor |
FACTORY
public static final PropertyDescriptorFactory FACTORY
StringMultiProperty
public StringMultiProperty(String theName,
String theDescription,
String[] theDefaults,
float theUIOrder,
char delimiter)
- Constructor for StringProperty.
- Parameters:
theName
- StringtheDescription
- StringtheDefaults
- String[]theUIOrder
- floatdelimiter
- String
- Throws:
IllegalArgumentException
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
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<String[]>
- Overrides:
isMultiValue
in class AbstractProperty<String[]>
- Returns:
- boolean
- See Also:
PropertyDescriptor.isMultiValue()
Copyright © 2002-2015 InfoEther. All Rights Reserved.