|
||||||||||
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>
T
- public abstract class AbstractProperty<T>
Field Summary | |
---|---|
static char |
DEFAULT_DELIMITER
Default delimiter for multi properties. |
static char |
DEFAULT_NUMERIC_DELIMITER
Default delimiter for numeric properties. |
Constructor Summary | |
---|---|
protected |
AbstractProperty(String theName,
String theDescription,
T theDefault,
float theUIOrder)
|
protected |
AbstractProperty(String theName,
String theDescription,
T theDefault,
float theUIOrder,
char delimiter)
Constructor for AbstractPMDProperty. |
Method Summary | |
---|---|
protected void |
addAttributesTo(Map<String,String> attributes)
|
static boolean |
areEqual(Object value,
Object otherValue)
|
String |
asDelimitedString(T values)
Formats the object onto a string suitable for storage within the property map. |
String |
asDelimitedString(T values,
char delimiter)
Return the specified values as a single string using the delimiter. |
protected String |
asString(Object value)
Return the value as a string that can be easily recognized and parsed when we see it again. |
Map<String,String> |
attributeValuesById()
Returns a map representing all the property attributes of the receiver in string form. |
Object[][] |
choices()
Returns a set of choice tuples if available, returns null if none are defined. |
int |
compareTo(PropertyDescriptor<?> otherProperty)
|
protected String |
defaultAsString()
|
protected boolean |
defaultHasNullValue()
Method defaultHasNullValue. |
T |
defaultValue()
Default value to use when the user hasn't specified one or when they wish to revert to a known-good state. |
String |
description()
Describes the property and the role it plays within the rule it is specified for. |
boolean |
equals(Object obj)
|
String |
errorFor(Object value)
Validation function that returns a diagnostic error message for a sample property value. |
int |
hashCode()
|
protected static boolean |
isArray(Object value)
|
boolean |
isMultiValue()
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. |
boolean |
isRequired()
Denotes whether the value is required before the rule can be executed. |
char |
multiValueDelimiter()
Return the character being used to delimit multiple property values within a single string. |
String |
name()
The name of the property without spaces as it serves as the key into the property map. |
int |
preferredRowCount()
If the datatype is a String then return the preferred number of rows to allocate in the text widget, returns a value of one for all other types. |
String |
propertyErrorFor(Rule rule)
A convenience method that returns an error string if the rule holds onto a property value that has a problem. |
String |
toString()
|
protected String |
typeErrorFor(Object value)
|
float |
uiOrder()
Denotes the relative order the property field should occupy if we are using an auto-generated UI to display and edit property values. |
protected String |
valueErrorFor(Object value)
|
protected String |
valuesErrorFor(Object value)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.sourceforge.pmd.PropertyDescriptor |
---|
type, valueFrom |
Field Detail |
---|
public static final char DEFAULT_DELIMITER
public static final char DEFAULT_NUMERIC_DELIMITER
Constructor Detail |
---|
protected AbstractProperty(String theName, String theDescription, T theDefault, float theUIOrder)
protected AbstractProperty(String theName, String theDescription, T theDefault, float theUIOrder, char delimiter)
theName
- StringtheDescription
- StringtheDefault
- ObjecttheUIOrder
- float
IllegalArgumentException
Method Detail |
---|
public char multiValueDelimiter()
multiValueDelimiter
in interface PropertyDescriptor<T>
public String name()
name
in interface PropertyDescriptor<T>
public String description()
description
in interface PropertyDescriptor<T>
public T defaultValue()
defaultValue
in interface PropertyDescriptor<T>
protected boolean defaultHasNullValue()
public boolean isMultiValue()
isMultiValue
in interface PropertyDescriptor<T>
public boolean isRequired()
isRequired
in interface PropertyDescriptor<T>
public float uiOrder()
uiOrder
in interface PropertyDescriptor<T>
protected String asString(Object value)
value
- Object
public String asDelimitedString(T values)
asDelimitedString
in interface PropertyDescriptor<T>
values
- Object
public String asDelimitedString(T values, char delimiter)
values
- Objectdelimiter
- char
PropertyDescriptor.asDelimitedString(Object)
public int compareTo(PropertyDescriptor<?> otherProperty)
compareTo
in interface Comparable<PropertyDescriptor<?>>
public String errorFor(Object value)
errorFor
in interface PropertyDescriptor<T>
value
- Object
protected String valueErrorFor(Object value)
value
- Object
protected String valuesErrorFor(Object value)
value
- Object
protected static boolean isArray(Object value)
value
- Object
protected String typeErrorFor(Object value)
value
- Object
public String propertyErrorFor(Rule rule)
propertyErrorFor
in interface PropertyDescriptor<T>
rule
- Rule
public Object[][] choices()
choices
in interface PropertyDescriptor<T>
public int preferredRowCount()
preferredRowCount
in interface PropertyDescriptor<T>
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
protected String defaultAsString()
public static final boolean areEqual(Object value, Object otherValue)
value
- ObjectotherValue
- Object
public Map<String,String> attributeValuesById()
PropertyDescriptor
attributeValuesById
in interface PropertyDescriptor<T>
protected void addAttributesTo(Map<String,String> attributes)
attributes
- Map
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |