|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.pmd.lang.rule.properties.AbstractProperty<T> net.sourceforge.pmd.lang.rule.properties.AbstractEnumeratedProperty<E,Object[]> net.sourceforge.pmd.lang.rule.properties.EnumeratedMultiProperty<E>
E
- public class EnumeratedMultiProperty<E>
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. The choices() method provides the ordered selections to be used in an editor widget.
Field Summary | |
---|---|
static PropertyDescriptorFactory |
FACTORY
|
Fields inherited from class net.sourceforge.pmd.lang.rule.properties.AbstractEnumeratedProperty |
---|
choices, choicesByLabel, labelsByChoice |
Fields inherited from class net.sourceforge.pmd.lang.rule.properties.AbstractProperty |
---|
DEFAULT_DELIMITER, DEFAULT_NUMERIC_DELIMITER |
Constructor Summary | |
---|---|
EnumeratedMultiProperty(String theName,
String theDescription,
String[] theLabels,
E[] theChoices,
int[] choiceIndices,
float theUIOrder)
Constructor for EnumeratedProperty. |
Method Summary | |
---|---|
String |
asDelimitedString(Object[] value)
Formats the object onto a string suitable for storage within the property map. |
String |
errorFor(Object value)
Validation function that returns a diagnostic error message for a sample property value. |
boolean |
isMultiValue()
Returns whether the property is multi-valued, i.e. |
Class<Object[]> |
type()
Denotes the value datatype. |
Object[] |
valueFrom(String value)
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.AbstractEnumeratedProperty |
---|
choiceFrom, choices, defaultAsString, nonLegalValueMsgFor |
Methods inherited from class net.sourceforge.pmd.lang.rule.properties.AbstractProperty |
---|
addAttributesTo, areEqual, asDelimitedString, asString, attributeValuesById, compareTo, defaultHasNullValue, defaultValue, description, equals, 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 |
---|
public static final PropertyDescriptorFactory FACTORY
Constructor Detail |
---|
public EnumeratedMultiProperty(String theName, String theDescription, String[] theLabels, E[] theChoices, int[] choiceIndices, float theUIOrder)
theName
- StringtheDescription
- StringtheLabels
- String[]theChoices
- E[]choiceIndices
- int[]theUIOrder
- float
IllegalArgumentException
Method Detail |
---|
public Class<Object[]> type()
PropertyDescriptor
PropertyDescriptor.type()
public boolean isMultiValue()
AbstractProperty
isMultiValue
in interface PropertyDescriptor<Object[]>
isMultiValue
in class AbstractProperty<Object[]>
PropertyDescriptor.isMultiValue()
public String errorFor(Object value)
AbstractProperty
errorFor
in interface PropertyDescriptor<Object[]>
errorFor
in class AbstractProperty<Object[]>
value
- Object
PropertyDescriptor.errorFor(Object)
public Object[] valueFrom(String value) throws IllegalArgumentException
PropertyDescriptor
value
- String
IllegalArgumentException
PropertyDescriptor.valueFrom(String)
public String asDelimitedString(Object[] value)
AbstractProperty
asDelimitedString
in interface PropertyDescriptor<Object[]>
asDelimitedString
in class AbstractProperty<Object[]>
value
- Object
PropertyDescriptor.asDelimitedString(Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |