PropertySourceAbstractRenderer, AbstractRulepublic abstract class AbstractPropertySource extends java.lang.Object implements PropertySource
| Modifier and Type | Field | Description |
|---|---|---|
protected java.util.List<PropertyDescriptor<?>> |
propertyDescriptors |
The list of known properties that can be configured.
|
protected java.util.Map<PropertyDescriptor<?>,java.lang.Object> |
propertyValuesByDescriptor |
The values for each property.
|
| Constructor | Description |
|---|---|
AbstractPropertySource() |
| Modifier and Type | Method | Description |
|---|---|---|
protected java.util.List<PropertyDescriptor<?>> |
copyPropertyDescriptors() |
Creates a copied list of the property descriptors and returns it.
|
protected java.util.Map<PropertyDescriptor<?>,java.lang.Object> |
copyPropertyValues() |
Creates a copied map of the values of the properties and returns it.
|
void |
definePropertyDescriptor(PropertyDescriptor<?> propertyDescriptor) |
Define a new property via a PropertyDescriptor.
|
java.lang.String |
dysfunctionReason() |
Returns a description of why the receiver may be dysfunctional.
|
abstract java.lang.String |
getName() |
Gets the name of the property source.
|
java.util.Map<PropertyDescriptor<?>,java.lang.Object> |
getPropertiesByPropertyDescriptor() |
Returns all the current property values for the receiver or an immutable empty map if none are specified.
|
<T> T |
getProperty(PropertyDescriptor<T> propertyDescriptor) |
Get the typed value for the given property.
|
PropertyDescriptor<?> |
getPropertyDescriptor(java.lang.String name) |
Get the PropertyDescriptor for the given property name.
|
java.util.List<PropertyDescriptor<?>> |
getPropertyDescriptors() |
Get the PropertyDescriptors for all defined properties.
|
boolean |
hasDescriptor(PropertyDescriptor<?> descriptor) |
Returns whether this Rule has the specified PropertyDescriptor.
|
java.util.Set<PropertyDescriptor<?>> |
ignoredProperties() |
Return the properties that are effectively ignored due to the configuration of the rule and values held by other
properties.
|
<V> void |
setProperty(MultiValuePropertyDescriptor<V> propertyDescriptor,
V... values) |
Sets the value of a multi value property descriptor with a variable number of arguments.
|
<T> void |
setProperty(PropertyDescriptor<T> propertyDescriptor,
T value) |
Set the property value specified (will be type-checked)
|
void |
useDefaultValueFor(PropertyDescriptor<?> desc) |
Clears out any user-specified value for the property allowing it to use the default value in the descriptor.
|
boolean |
usesDefaultValues() |
Returns whether this Rule uses default values for properties.
|
protected java.util.List<PropertyDescriptor<?>> propertyDescriptors
protected java.util.Map<PropertyDescriptor<?>,java.lang.Object> propertyValuesByDescriptor
protected java.util.List<PropertyDescriptor<?>> copyPropertyDescriptors()
protected java.util.Map<PropertyDescriptor<?>,java.lang.Object> copyPropertyValues()
public java.util.Set<PropertyDescriptor<?>> ignoredProperties()
PropertySourceignoredProperties in interface PropertySourcepublic void definePropertyDescriptor(PropertyDescriptor<?> propertyDescriptor)
PropertySourcedefinePropertyDescriptor in interface PropertySourcepropertyDescriptor - The property descriptor.public abstract java.lang.String getName()
public PropertyDescriptor<?> getPropertyDescriptor(java.lang.String name)
PropertySourcegetPropertyDescriptor in interface PropertySourcename - The name of the property.null if there is no such property defined.public boolean hasDescriptor(PropertyDescriptor<?> descriptor)
PropertySourcehasDescriptor in interface PropertySourcedescriptor - The PropertyDescriptor for which to check.true if the descriptor is present, false otherwise.public java.util.List<PropertyDescriptor<?>> getPropertyDescriptors()
PropertySourcegetPropertyDescriptors in interface PropertySourcepublic <T> T getProperty(PropertyDescriptor<T> propertyDescriptor)
PropertySourcegetProperty in interface PropertySourceT - The underlying type of the property descriptor.propertyDescriptor - The property descriptor.public <T> void setProperty(PropertyDescriptor<T> propertyDescriptor, T value)
PropertySourcesetProperty in interface PropertySourceT - The underlying type of the property descriptor.propertyDescriptor - The property descriptor.value - The value to set.public <V> void setProperty(MultiValuePropertyDescriptor<V> propertyDescriptor, V... values)
PropertySourcesetProperty in interface PropertySourceV - The type of the valuespropertyDescriptor - The property descriptor for which to add a valuevalues - Valuespublic java.util.Map<PropertyDescriptor<?>,java.lang.Object> getPropertiesByPropertyDescriptor()
PropertySourcegetPropertiesByPropertyDescriptor in interface PropertySourcepublic boolean usesDefaultValues()
PropertySourceusesDefaultValues in interface PropertySourcetrue if the properties all have default values, false otherwise.public void useDefaultValueFor(PropertyDescriptor<?> desc)
PropertySourceuseDefaultValueFor in interface PropertySourcedesc - the property to clear outpublic java.lang.String dysfunctionReason()
PropertySourcedysfunctionReason in interface PropertySourceCopyright © 2002–2018 PMD. All rights reserved.