net.sourceforge.pmd.properties
Class TypeProperty

java.lang.Object
  extended by net.sourceforge.pmd.properties.AbstractPMDProperty
      extended by net.sourceforge.pmd.properties.StringProperty
          extended by net.sourceforge.pmd.properties.TypeProperty
All Implemented Interfaces:
java.lang.Comparable<PropertyDescriptor>, PropertyDescriptor

public class TypeProperty
extends StringProperty

Defines a property that supports class types, even for primitive values!

Version:
$Revision$
Author:
Brian Remedios

Field Summary
 
Fields inherited from class net.sourceforge.pmd.properties.StringProperty
defaultDelimiter
 
Fields inherited from class net.sourceforge.pmd.properties.AbstractPMDProperty
multiValueDelimiter
 
Fields inherited from interface net.sourceforge.pmd.PropertyDescriptor
emptyPropertySet
 
Constructor Summary
TypeProperty(java.lang.String theName, java.lang.String theDescription, java.lang.Class[] theDefaults, float theUIOrder)
          Constructor for TypeProperty.
TypeProperty(java.lang.String theName, java.lang.String theDescription, java.lang.Class theDefault, float theUIOrder)
          Constructor for TypeProperty.
 
Method Summary
protected  java.lang.String asString(java.lang.Object value)
          Method asString.
 java.lang.Class<java.lang.Class> type()
          Method type.
protected  java.lang.String valueErrorFor(java.lang.Object value)
          Neutralize unwanted superclass functionality that will result in a class cast exception.
 java.lang.Object valueFrom(java.lang.String valueString)
          Method valueFrom.
 
Methods inherited from class net.sourceforge.pmd.properties.StringProperty
preferredRowCount
 
Methods inherited from class net.sourceforge.pmd.properties.AbstractPMDProperty
areEqual, asDelimitedString, choices, compareTo, defaultValue, description, errorFor, isArray, isRequired, maxValueCount, maxValueCount, multiValueDelimiter, multiValueDelimiter, name, propertyErrorFor, typeErrorFor, uiOrder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeProperty

public TypeProperty(java.lang.String theName,
                    java.lang.String theDescription,
                    java.lang.Class theDefault,
                    float theUIOrder)
Constructor for TypeProperty.

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

TypeProperty

public TypeProperty(java.lang.String theName,
                    java.lang.String theDescription,
                    java.lang.Class[] theDefaults,
                    float theUIOrder)
Constructor for TypeProperty.

Parameters:
theName - String
theDescription - String
theDefaults - Class[]
theUIOrder - float
Method Detail

type

public java.lang.Class<java.lang.Class> type()
Method type.

Specified by:
type in interface PropertyDescriptor
Overrides:
type in class StringProperty
Returns:
Class
See Also:
PropertyDescriptor.type()

asString

protected java.lang.String asString(java.lang.Object value)
Method asString.

Overrides:
asString in class AbstractPMDProperty
Parameters:
value - Object
Returns:
String

valueFrom

public java.lang.Object valueFrom(java.lang.String valueString)
Method valueFrom.

Specified by:
valueFrom in interface PropertyDescriptor
Overrides:
valueFrom in class StringProperty
Parameters:
valueString - String
Returns:
Object
See Also:
PropertyDescriptor.valueFrom(String)

valueErrorFor

protected java.lang.String valueErrorFor(java.lang.Object value)
Neutralize unwanted superclass functionality that will result in a class cast exception.

Overrides:
valueErrorFor in class StringProperty
Parameters:
value - Object
Returns:
String


Copyright © 2002-2011 InfoEther. All Rights Reserved.