public final class TypeMultiProperty
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
TypeMultiProperty.TypeMultiPBuilder |
Modifier and Type | Field and Description |
---|---|
protected PackagedPropertyModule<T> |
module |
MULTI_VALUE_DELIMITER, PACKAGE_NAME_DELIMITER
DEFAULT_DELIMITER, DEFAULT_NUMERIC_DELIMITER
Constructor and Description |
---|
TypeMultiProperty(java.lang.String theName,
java.lang.String theDescription,
java.util.List<java.lang.Class> theDefaults,
java.lang.String[] legalPackageNames,
float theUIOrder)
Constructor for TypeProperty.
|
TypeMultiProperty(java.lang.String theName,
java.lang.String theDescription,
java.lang.String theTypeDefaults,
java.lang.String[] legalPackageNames,
float theUIOrder)
Constructor for TypeProperty.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addAttributesTo(java.util.Map<PropertyDescriptorField,java.lang.String> attributes)
Adds this property's attributes to the map.
|
java.lang.String |
asDelimitedString(java.util.List<V> values)
Formats the object onto a string suitable for storage within the property map.
|
java.lang.String |
asString(java.lang.Class value)
Returns a string representation of the value, even if it's null.
|
java.util.Map<PropertyDescriptorField,java.lang.String> |
attributeValuesById()
Returns a map representing all the property attributes of the receiver in string form.
|
int |
compareTo(PropertyDescriptor<?> otherProperty) |
protected java.lang.Class |
createFrom(java.lang.String toParse)
Parse a string and returns an instance of a single value (not a list).
|
protected java.lang.String |
defaultAsString()
Returns a string representation of the default value.
|
java.util.List<V> |
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.util.List<V> values)
Validation function that returns a diagnostic error message for a sample property value.
|
static PropertyDescriptorBuilderConversionWrapper.MultiValue.Packaged<java.lang.Class,TypeMultiProperty.TypeMultiPBuilder> |
extractor() |
int |
hashCode() |
boolean |
isDefinedExternally()
True if this descriptor was defined in the ruleset xml.
|
boolean |
isMultiValue()
Returns whether the property is multi-valued, i.e.
|
java.lang.String[] |
legalPackageNames()
Returns the legal package names.
|
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.
|
static TypeMultiProperty.TypeMultiPBuilder |
named(java.lang.String name) |
protected java.lang.String[] |
packageNamesIn(java.util.Map<PropertyDescriptorField,java.lang.String> params) |
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() |
java.lang.Class<java.lang.Class> |
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.
|
protected java.lang.String |
valueErrorFor(T value)
Checks a single value for a "missing value" error.
|
java.util.List<java.lang.Class> |
valueFrom(java.lang.String valueString)
Returns the value represented by this string.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
asDelimitedString, attributeValuesById, defaultValue, description, errorFor, isDefinedExternally, isMultiValue, name, preferredRowCount, propertyErrorFor, uiOrder
protected final PackagedPropertyModule<T> module
public TypeMultiProperty(java.lang.String theName, java.lang.String theDescription, java.util.List<java.lang.Class> theDefaults, java.lang.String[] legalPackageNames, float theUIOrder)
theName
- StringtheDescription
- StringtheDefaults
- Class[]legalPackageNames
- String[]theUIOrder
- floatjava.lang.IllegalArgumentException
public TypeMultiProperty(java.lang.String theName, java.lang.String theDescription, java.lang.String theTypeDefaults, java.lang.String[] legalPackageNames, float theUIOrder)
theName
- StringtheDescription
- StringtheTypeDefaults
- StringlegalPackageNames
- String[]theUIOrder
- floatjava.lang.IllegalArgumentException
public java.lang.Class<java.lang.Class> type()
PropertyDescriptor
public java.lang.String asString(java.lang.Class value)
value
- The value to describeprotected java.lang.Class createFrom(java.lang.String toParse)
toParse
- String to parsepublic java.util.List<java.lang.Class> valueFrom(java.lang.String valueString)
PropertyDescriptor
valueFrom
in interface PropertyDescriptor<java.util.List<java.lang.Class>>
valueString
- The string to parsepublic static PropertyDescriptorBuilderConversionWrapper.MultiValue.Packaged<java.lang.Class,TypeMultiProperty.TypeMultiPBuilder> extractor()
public static TypeMultiProperty.TypeMultiPBuilder named(java.lang.String name)
protected void addAttributesTo(java.util.Map<PropertyDescriptorField,java.lang.String> attributes)
PropertyDescriptorField
.attributes
- The map to fillprotected java.lang.String valueErrorFor(T value)
value
- Value to checkpublic java.lang.String[] legalPackageNames()
PackagedPropertyDescriptor
legalPackageNames
in interface PackagedPropertyDescriptor<java.util.List<T>>
protected java.lang.String[] packageNamesIn(java.util.Map<PropertyDescriptorField,java.lang.String> params)
public final boolean isMultiValue()
PropertyDescriptor
As unary property rule properties will return a value of one, you must use the get/setProperty accessors when working with the actual values. When working with multi-value properties then the get/setProperties accessors must be used.
isMultiValue
in interface PropertyDescriptor<java.util.List<V>>
public java.lang.String propertyErrorFor(Rule rule)
PropertyDescriptor
propertyErrorFor
in interface PropertyDescriptor<java.util.List<V>>
rule
- Rulepublic java.lang.String errorFor(java.util.List<V> values)
PropertyDescriptor
errorFor
in interface PropertyDescriptor<java.util.List<V>>
values
- The value to check.protected java.lang.String defaultAsString()
public java.util.List<V> defaultValue()
PropertyDescriptor
defaultValue
in interface PropertyDescriptor<java.util.List<V>>
public char multiValueDelimiter()
MultiValuePropertyDescriptor
multiValueDelimiter
in interface MultiValuePropertyDescriptor<V>
public final java.lang.String asDelimitedString(java.util.List<V> values)
PropertyDescriptor
asDelimitedString
in interface PropertyDescriptor<java.util.List<V>>
values
- Objectpublic java.lang.String description()
PropertyDescriptor
description
in interface PropertyDescriptor<T>
public float uiOrder()
PropertyDescriptor
Example:
name -> 0.0 description 1.0 minValue -> 2.0 maxValue -> 2.1
name: [ ] description: [ ] minimum: [ ] maximum: [ ]
uiOrder
in interface PropertyDescriptor<T>
public final int compareTo(PropertyDescriptor<?> otherProperty)
compareTo
in interface java.lang.Comparable<PropertyDescriptor<?>>
public int preferredRowCount()
PropertyDescriptor
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
public java.lang.String name()
PropertyDescriptor
name
in interface PropertyDescriptor<T>
public final java.util.Map<PropertyDescriptorField,java.lang.String> attributeValuesById()
PropertyDescriptor
attributeValuesById
in interface PropertyDescriptor<T>
public boolean isDefinedExternally()
PropertyDescriptor
RuleSetWriter
to write out the property correctly: if it was defined externally, then its definition must be written out,
otherwise only its value.isDefinedExternally
in interface PropertyDescriptor<T>
Copyright © 2002–2018 PMD. All rights reserved.