T
- public abstract class AbstractProperty<T> extends java.lang.Object implements PropertyDescriptor<T>
Modifier | Constructor and Description |
---|---|
protected |
AbstractProperty(java.lang.String theName,
java.lang.String theDescription,
T theDefault,
float theUIOrder)
Constructor for AbstractPMDProperty.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addAttributesTo(java.util.Map<java.lang.String,java.lang.String> attributes) |
static boolean |
areEqual(java.lang.Object value,
java.lang.Object otherValue) |
java.lang.String |
asDelimitedString(T values)
Formats the object onto a string suitable for storage within the property
map.
|
java.lang.String |
asDelimitedString(T values,
char delimiter)
Return the specified values as a single string using the delimiter.
|
protected java.lang.String |
asString(java.lang.Object value)
Return the value as a string that can be easily recognized and parsed
when we see it again.
|
java.util.Map<java.lang.String,java.lang.String> |
attributeValuesById()
Returns a map representing all the property attributes of the receiver in
string form.
|
java.lang.Object[][] |
choices()
Returns a set of choice tuples if available, returns null if none are
defined.
|
int |
compareTo(PropertyDescriptor<?> otherProperty) |
protected abstract java.lang.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.
|
java.lang.String |
description()
Describes the property and the role it plays within the rule it is
specified for.
|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
errorFor(java.lang.Object value)
Validation function that returns a diagnostic error message for a sample
property value.
|
int |
hashCode() |
protected static boolean |
isArray(java.lang.Object value) |
boolean |
isMultiValue()
Returns whether the property is multi-valued, i.e.
|
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.
|
java.lang.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.
|
java.lang.String |
propertyErrorFor(Rule rule)
A convenience method that returns an error string if the rule holds onto
a property value that has a problem.
|
java.lang.String |
toString() |
protected java.lang.String |
typeErrorFor(java.lang.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 java.lang.String |
valueErrorFor(java.lang.Object value) |
protected java.lang.String |
valuesErrorFor(java.lang.Object value) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
type, valueFrom
protected AbstractProperty(java.lang.String theName, java.lang.String theDescription, T theDefault, float theUIOrder)
theName
- StringtheDescription
- StringtheDefault
- ObjecttheUIOrder
- floatjava.lang.IllegalArgumentException
public char multiValueDelimiter()
multiValueDelimiter
in interface PropertyDescriptor<T>
public java.lang.String name()
name
in interface PropertyDescriptor<T>
public java.lang.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 java.lang.String asString(java.lang.Object value)
value
- Objectpublic java.lang.String asDelimitedString(T values)
asDelimitedString
in interface PropertyDescriptor<T>
values
- Objectpublic java.lang.String asDelimitedString(T values, char delimiter)
values
- Objectdelimiter
- charPropertyDescriptor.asDelimitedString(Object)
public int compareTo(PropertyDescriptor<?> otherProperty)
compareTo
in interface java.lang.Comparable<PropertyDescriptor<?>>
public java.lang.String errorFor(java.lang.Object value)
errorFor
in interface PropertyDescriptor<T>
value
- Objectprotected java.lang.String valueErrorFor(java.lang.Object value)
value
- Objectprotected java.lang.String valuesErrorFor(java.lang.Object value)
value
- Objectprotected static boolean isArray(java.lang.Object value)
value
- Objectprotected java.lang.String typeErrorFor(java.lang.Object value)
value
- Objectpublic java.lang.String propertyErrorFor(Rule rule)
propertyErrorFor
in interface PropertyDescriptor<T>
rule
- Rulepublic java.lang.Object[][] choices()
choices
in interface PropertyDescriptor<T>
public int preferredRowCount()
preferredRowCount
in interface PropertyDescriptor<T>
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
protected abstract java.lang.String defaultAsString()
public static final boolean areEqual(java.lang.Object value, java.lang.Object otherValue)
value
- ObjectotherValue
- Objectpublic java.util.Map<java.lang.String,java.lang.String> attributeValuesById()
PropertyDescriptor
attributeValuesById
in interface PropertyDescriptor<T>
protected void addAttributesTo(java.util.Map<java.lang.String,java.lang.String> attributes)
attributes
- MapCopyright © 2002-2014 InfoEther. All Rights Reserved.