net.sourceforge.pmd.properties

Class EnumeratedProperty<E>

public class EnumeratedProperty<E> extends AbstractPMDProperty

Defines a datatype with a set of preset values of any type as held within a pair of maps. While the values are not serialized out, the labels are and serve as keys to obtain the values.

Version: $Revision$

Author: Brian Remedios

Constructor Summary
EnumeratedProperty(String theName, String theDescription, String[] theLabels, E[] theChoices, float theUIOrder)
Constructor for EnumeratedProperty.
EnumeratedProperty(String theName, String theDescription, String[] theLabels, E[] theChoices, float theUIOrder, int maxValues)
Constructor for EnumeratedProperty.
Method Summary
StringasDelimitedString(Object value)
Method asDelimitedString.
StringerrorFor(Object value)
Method errorFor.
Class<Object>type()
Method type.
ObjectvalueFrom(String value)
Method valueFrom.

Constructor Detail

EnumeratedProperty

public EnumeratedProperty(String theName, String theDescription, String[] theLabels, E[] theChoices, float theUIOrder)
Constructor for EnumeratedProperty.

Parameters: theName String theDescription String theLabels String[] theChoices E[] theUIOrder float

EnumeratedProperty

public EnumeratedProperty(String theName, String theDescription, String[] theLabels, E[] theChoices, float theUIOrder, int maxValues)
Constructor for EnumeratedProperty.

Parameters: theName String theDescription String theLabels String[] theChoices E[] theUIOrder float maxValues int

Method Detail

asDelimitedString

public String asDelimitedString(Object value)
Method asDelimitedString.

Parameters: value Object

Returns: String

See Also: asDelimitedString

errorFor

public String errorFor(Object value)
Method errorFor.

Parameters: value Object

Returns: String

See Also: errorFor

type

public Class<Object> type()
Method type.

Returns: Class

See Also: type

valueFrom

public Object valueFrom(String value)
Method valueFrom.

Parameters: value String

Returns: Object

Throws: IllegalArgumentException

See Also: valueFrom