T
- The type of the underlying PropertyDescriptor.public class PropertyDescriptorWrapper<T> extends Object implements PropertyDescriptor<T>
PropertyDescriptorFactory
to readily flag
properties it has created, versus those created by Rule classes. This is used
in the encoding of a Rule to XML format to distinguish Rule defined
PropertyDescriptors and those which were originally defined in XML.Constructor and Description |
---|
PropertyDescriptorWrapper(PropertyDescriptor<T> propertyDescriptor) |
Modifier and Type | Method and Description |
---|---|
String |
asDelimitedString(T value)
Formats the object onto a string suitable for storage within the property
map.
|
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<?> o) |
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.
|
PropertyDescriptor<T> |
getPropertyDescriptor() |
int |
hashCode() |
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() |
Class<T> |
type()
Denotes the value datatype.
|
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.
|
T |
valueFrom(String propertyString)
If the property is multi-valued then return the separate values after
parsing the propertyString provided.
|
public PropertyDescriptorWrapper(PropertyDescriptor<T> propertyDescriptor)
public PropertyDescriptor<T> getPropertyDescriptor()
public String asDelimitedString(T value)
PropertyDescriptor
asDelimitedString
in interface PropertyDescriptor<T>
value
- Objectpublic Object[][] choices()
PropertyDescriptor
choices
in interface PropertyDescriptor<T>
public int compareTo(PropertyDescriptor<?> o)
compareTo
in interface Comparable<PropertyDescriptor<?>>
public T defaultValue()
PropertyDescriptor
defaultValue
in interface PropertyDescriptor<T>
public String description()
PropertyDescriptor
description
in interface PropertyDescriptor<T>
public String errorFor(Object value)
PropertyDescriptor
errorFor
in interface PropertyDescriptor<T>
value
- Objectpublic boolean isMultiValue()
PropertyDescriptor
isMultiValue
in interface PropertyDescriptor<T>
public boolean isRequired()
PropertyDescriptor
isRequired
in interface PropertyDescriptor<T>
public char multiValueDelimiter()
PropertyDescriptor
multiValueDelimiter
in interface PropertyDescriptor<T>
public String name()
PropertyDescriptor
name
in interface PropertyDescriptor<T>
public int preferredRowCount()
PropertyDescriptor
preferredRowCount
in interface PropertyDescriptor<T>
public String propertyErrorFor(Rule rule)
PropertyDescriptor
propertyErrorFor
in interface PropertyDescriptor<T>
rule
- Rulepublic Class<T> type()
PropertyDescriptor
type
in interface PropertyDescriptor<T>
public float uiOrder()
PropertyDescriptor
uiOrder
in interface PropertyDescriptor<T>
public T valueFrom(String propertyString) throws IllegalArgumentException
PropertyDescriptor
valueFrom
in interface PropertyDescriptor<T>
propertyString
- StringIllegalArgumentException
- if the given string cannot be parsedpublic Map<String,String> attributeValuesById()
PropertyDescriptor
attributeValuesById
in interface PropertyDescriptor<T>
Copyright © 2002-2016 InfoEther. All Rights Reserved.