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()
PropertySource
ignoredProperties
in interface PropertySource
PropertySource.ignoredProperties()
public void definePropertyDescriptor(PropertyDescriptor<?> propertyDescriptor)
PropertySource
definePropertyDescriptor
in interface PropertySource
propertyDescriptor
- The property descriptor.PropertySource.definePropertyDescriptor(PropertyDescriptor)
public abstract String getName()
public PropertyDescriptor<?> getPropertyDescriptor(String name)
PropertySource
getPropertyDescriptor
in interface PropertySource
name
- The name of the property.null
if there is no such property defined.PropertySource.getPropertyDescriptor(String)
public boolean hasDescriptor(PropertyDescriptor<?> descriptor)
PropertySource
hasDescriptor
in interface PropertySource
descriptor
- The PropertyDescriptor for which to check.true
if the descriptor is present, false
otherwise.PropertySource.hasDescriptor(PropertyDescriptor)
public List<PropertyDescriptor<?>> getPropertyDescriptors()
PropertySource
getPropertyDescriptors
in interface PropertySource
PropertySource.getPropertyDescriptors()
public <T> T getProperty(PropertyDescriptor<T> propertyDescriptor)
PropertySource
getProperty
in interface PropertySource
T
- The underlying type of the property descriptor.propertyDescriptor
- The property descriptor.PropertySource.getProperty(PropertyDescriptor)
public <T> void setProperty(PropertyDescriptor<T> propertyDescriptor, T value)
PropertySource
setProperty
in interface PropertySource
T
- 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()
PropertySource
getPropertiesByPropertyDescriptor
in interface PropertySource
PropertySource.getPropertiesByPropertyDescriptor()
public boolean usesDefaultValues()
PropertySource
usesDefaultValues
in interface PropertySource
true
if the properties all have default values, false
otherwise.PropertySource.usesDefaultValues()
public void useDefaultValueFor(PropertyDescriptor<?> desc)
PropertySource
useDefaultValueFor
in interface PropertySource
public String dysfunctionReason()
PropertySource
dysfunctionReason
in interface PropertySource
PropertySource.dysfunctionReason()
Copyright © 2002-2013 InfoEther. All Rights Reserved.