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

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

public class CharacterProperty
extends AbstractProperty<Character>

Defines a property type that supports single 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
CharacterProperty(String theName, String theDescription, Character theDefault, float theUIOrder)
          Constructor for CharacterProperty.
CharacterProperty(String theName, String theDescription, String defaultStr, float theUIOrder)
          Constructor for CharacterProperty.
 
Method Summary
static Character charFrom(String charStr)
           
protected  String defaultAsString()
          Method defaultAsString.
 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, defaultHasNullValue, defaultValue, description, equals, errorFor, hashCode, isArray, isMultiValue, 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

CharacterProperty

public CharacterProperty(String theName,
                         String theDescription,
                         Character theDefault,
                         float theUIOrder)
Constructor for CharacterProperty.

Parameters:
theName - String
theDescription - String
theDefault - Character
theUIOrder - float

CharacterProperty

public CharacterProperty(String theName,
                         String theDescription,
                         String defaultStr,
                         float theUIOrder)
Constructor for CharacterProperty.

Parameters:
theName - String
theDescription - String
defaultStr - String
theUIOrder - float
Throws:
IllegalArgumentException
Method Detail

charFrom

public static Character charFrom(String charStr)
Parameters:
charStr - String
Returns:
Character

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)

defaultAsString

protected String defaultAsString()
Method defaultAsString.

Overrides:
defaultAsString in class AbstractProperty<Character>
Returns:
String


Copyright © 2002-2015 InfoEther. All Rights Reserved.