T
- public abstract class AbstractProperty<T> extends Object implements PropertyDescriptor<T>
Modifier and Type | Field and Description |
---|---|
static char |
DEFAULT_DELIMITER
Default delimiter for multi properties.
|
static char |
DEFAULT_NUMERIC_DELIMITER
Default delimiter for numeric properties.
|
Modifier | Constructor and Description |
---|---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
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) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
type, valueFrom
public static final char DEFAULT_DELIMITER
public static final char DEFAULT_NUMERIC_DELIMITER
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
- floatIllegalArgumentException
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
- Objectpublic String asDelimitedString(T values)
asDelimitedString
in interface PropertyDescriptor<T>
values
- Objectpublic String asDelimitedString(T values, char delimiter)
values
- Objectdelimiter
- charPropertyDescriptor.asDelimitedString(Object)
public int compareTo(PropertyDescriptor<?> otherProperty)
compareTo
in interface Comparable<PropertyDescriptor<?>>
public String errorFor(Object value)
errorFor
in interface PropertyDescriptor<T>
value
- Objectprotected String valuesErrorFor(Object value)
value
- Objectprotected static boolean isArray(Object value)
value
- Objectpublic String propertyErrorFor(Rule rule)
propertyErrorFor
in interface PropertyDescriptor<T>
rule
- Rulepublic Object[][] choices()
choices
in interface PropertyDescriptor<T>
public int preferredRowCount()
preferredRowCount
in interface PropertyDescriptor<T>
protected String defaultAsString()
public static final boolean areEqual(Object value, Object otherValue)
value
- ObjectotherValue
- Objectpublic Map<String,String> attributeValuesById()
PropertyDescriptor
attributeValuesById
in interface PropertyDescriptor<T>
Copyright © 2002-2015 InfoEther. All Rights Reserved.