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

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

public class CharacterMultiProperty
extends AbstractProperty<Character[]>

Defines a property type that supports multiple Character values.

Author:
Brian Remedios

Field Summary
static PropertyDescriptorFactory FACTORY
           
 
Fields inherited from class net.sourceforge.pmd.lang.rule.properties.AbstractProperty
DEFAULT_DELIMITER, DEFAULT_NUMERIC_DELIMITER
 
Constructor Summary
CharacterMultiProperty(String theName, String theDescription, Character[] theDefaults, float theUIOrder, char delimiter)
          Constructor for CharacterProperty.
 
Method Summary
 boolean isMultiValue()
          Returns whether the property is multi-valued, i.e.
 Class<Character[]> type()
          Denotes the value datatype.
 Character[] 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, 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
 

Field Detail

FACTORY

public static final PropertyDescriptorFactory FACTORY
Constructor Detail

CharacterMultiProperty

public CharacterMultiProperty(String theName,
                              String theDescription,
                              Character[] theDefaults,
                              float theUIOrder,
                              char delimiter)
Constructor for CharacterProperty.

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

type

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

Returns:
Class
See Also:
PropertyDescriptor.type()

valueFrom

public Character[] 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)

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<Character[]>
Overrides:
isMultiValue in class AbstractProperty<Character[]>
Returns:
boolean
See Also:
PropertyDescriptor.isMultiValue()


Copyright © 2002-2015 InfoEther. All Rights Reserved.