net.sourceforge.pmd.lang.rule.properties
Class BooleanMultiProperty
java.lang.Object
net.sourceforge.pmd.lang.rule.properties.AbstractProperty<T>
net.sourceforge.pmd.lang.rule.properties.AbstractScalarProperty<java.lang.Boolean[]>
net.sourceforge.pmd.lang.rule.properties.BooleanMultiProperty
- All Implemented Interfaces:
- java.lang.Comparable<PropertyDescriptor<?>>, PropertyDescriptor<java.lang.Boolean[]>
public class BooleanMultiProperty
- extends AbstractScalarProperty<java.lang.Boolean[]>
Defines a property type that supports multiple Boolean values.
- Author:
- Brian Remedios
Constructor Summary |
BooleanMultiProperty(java.lang.String theName,
java.lang.String theDescription,
java.lang.Boolean[] defaultValues,
float theUIOrder)
Constructor for BooleanMultiProperty that allows for multiple values. |
Method Summary |
protected java.lang.Boolean[] |
arrayFor(int size)
|
protected java.lang.Object |
createFrom(java.lang.String value)
Creates and returns a Boolean instance from a raw string |
protected java.lang.String |
defaultAsString()
|
boolean |
isMultiValue()
Returns whether the property is multi-valued, i.e. |
java.lang.Class<java.lang.Boolean[]> |
type()
Denotes the value datatype. |
Methods inherited from class net.sourceforge.pmd.lang.rule.properties.AbstractProperty |
addAttributesTo, areEqual, asDelimitedString, asDelimitedString, asString, attributeValuesById, choices, compareTo, defaultHasNullValue, defaultValue, description, equals, errorFor, hashCode, isArray, isRequired, multiValueDelimiter, name, preferredRowCount, propertyErrorFor, toString, typeErrorFor, uiOrder, valueErrorFor, valuesErrorFor |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
FACTORY
public static final PropertyDescriptorFactory FACTORY
BooleanMultiProperty
public BooleanMultiProperty(java.lang.String theName,
java.lang.String theDescription,
java.lang.Boolean[] defaultValues,
float theUIOrder)
- Constructor for BooleanMultiProperty that allows for multiple values.
- Parameters:
theName
- StringtheDescription
- StringdefaultValues
- Boolean[]theUIOrder
- float
type
public java.lang.Class<java.lang.Boolean[]> type()
- Description copied from interface:
PropertyDescriptor
- Denotes the value datatype.
- Returns:
- Class
- See Also:
PropertyDescriptor.type()
isMultiValue
public boolean isMultiValue()
- Description copied from class:
AbstractProperty
- 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.
When working with multi-value properties then the get/setProperties
accessors must be used.
- Specified by:
isMultiValue
in interface PropertyDescriptor<java.lang.Boolean[]>
- Overrides:
isMultiValue
in class AbstractProperty<java.lang.Boolean[]>
- Returns:
- boolean
- See Also:
PropertyDescriptor.isMultiValue()
createFrom
protected java.lang.Object createFrom(java.lang.String value)
- Creates and returns a Boolean instance from a raw string
- Specified by:
createFrom
in class AbstractScalarProperty<java.lang.Boolean[]>
- Parameters:
value
- String
- Returns:
- Object
arrayFor
protected java.lang.Boolean[] arrayFor(int size)
- Overrides:
arrayFor
in class AbstractScalarProperty<java.lang.Boolean[]>
- Parameters:
size
- int
- Returns:
- Object[]
defaultAsString
protected java.lang.String defaultAsString()
- Overrides:
defaultAsString
in class AbstractProperty<java.lang.Boolean[]>
- Returns:
- String
Copyright © 2002-2015 InfoEther. All Rights Reserved.