public abstract class AbstractPropertySource extends Object implements PropertySource
| Modifier and Type | Field and Description |
|---|---|
protected List<PropertyDescriptor<?>> |
propertyDescriptors |
protected Map<PropertyDescriptor<?>,Object> |
propertyValuesByDescriptor |
| Constructor and Description |
|---|
AbstractPropertySource() |
| Modifier and Type | Method and Description |
|---|---|
protected List<PropertyDescriptor<?>> |
copyPropertyDescriptors() |
protected Map<PropertyDescriptor<?>,Object> |
copyPropertyValues() |
void |
definePropertyDescriptor(PropertyDescriptor<?> propertyDescriptor)
Define a new property via a PropertyDescriptor.
|
String |
dysfunctionReason()
Returns a description of why the receiver may be dysfunctional.
|
abstract String |
getName() |
Map<PropertyDescriptor<?>,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(String name)
Get the PropertyDescriptor for the given property name.
|
List<PropertyDescriptor<?>> |
getPropertyDescriptors()
Get the PropertyDescriptors for all defined properties.
|
boolean |
hasDescriptor(PropertyDescriptor<?> descriptor)
Returns whether this Rule has the specified PropertyDescriptor.
|
Set<PropertyDescriptor<?>> |
ignoredProperties()
Return the properties that are effectively ignored due to the configuration
of the rule and values held by other properties.
|
<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 List<PropertyDescriptor<?>> propertyDescriptors
protected Map<PropertyDescriptor<?>,Object> propertyValuesByDescriptor
protected List<PropertyDescriptor<?>> copyPropertyDescriptors()
protected Map<PropertyDescriptor<?>,Object> copyPropertyValues()
public Set<PropertyDescriptor<?>> ignoredProperties()
PropertySourceignoredProperties in interface PropertySourcePropertySource.ignoredProperties()public void definePropertyDescriptor(PropertyDescriptor<?> propertyDescriptor)
PropertySourcedefinePropertyDescriptor in interface PropertySourcepropertyDescriptor - The property descriptor.PropertySource.definePropertyDescriptor(PropertyDescriptor)public abstract String getName()
public PropertyDescriptor<?> getPropertyDescriptor(String name)
PropertySourcegetPropertyDescriptor in interface PropertySourcename - The name of the property.null if there is no such property defined.PropertySource.getPropertyDescriptor(String)public boolean hasDescriptor(PropertyDescriptor<?> descriptor)
PropertySourcehasDescriptor in interface PropertySourcedescriptor - The PropertyDescriptor for which to check.true if the descriptor is present, false otherwise.PropertySource.hasDescriptor(PropertyDescriptor)public List<PropertyDescriptor<?>> getPropertyDescriptors()
PropertySourcegetPropertyDescriptors in interface PropertySourcePropertySource.getPropertyDescriptors()public <T> T getProperty(PropertyDescriptor<T> propertyDescriptor)
PropertySourcegetProperty in interface PropertySourceT - The underlying type of the property descriptor.propertyDescriptor - The property descriptor.PropertySource.getProperty(PropertyDescriptor)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.PropertySource.setProperty(PropertyDescriptor, Object)public Map<PropertyDescriptor<?>,Object> getPropertiesByPropertyDescriptor()
PropertySourcegetPropertiesByPropertyDescriptor in interface PropertySourcePropertySource.getPropertiesByPropertyDescriptor()public boolean usesDefaultValues()
PropertySourceusesDefaultValues in interface PropertySourcetrue if the properties all have default values, false otherwise.PropertySource.usesDefaultValues()public void useDefaultValueFor(PropertyDescriptor<?> desc)
PropertySourceuseDefaultValueFor in interface PropertySourcepublic String dysfunctionReason()
PropertySourcedysfunctionReason in interface PropertySourcePropertySource.dysfunctionReason()Copyright © 2002-2013 InfoEther. All Rights Reserved.